File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ function handleAssign(node, kind) {
291
291
if ( init . type === 'ArrowFunctionExpression' ) {
292
292
typeAnnotation = init . returnType ;
293
293
allocation = handleNode ( init ) ;
294
+ kind = undefined ;
294
295
} else {
295
296
allocation = handleAlloc ( init , typeAnnotation , name ) ;
296
297
}
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ void main() {
163
163
164
164
it ( 'works with struct' , ( ) => {
165
165
const { glsl } = buildGLSL ( ( ) => {
166
- let MyType = cls ( {
166
+ const MyType = cls ( {
167
167
fNormal : vec3 ,
168
168
vNormal : vec3
169
169
} ) ;
@@ -274,12 +274,26 @@ vec2 bar(vec2 x, float y) {
274
274
const foo = uniform ( vec2 ( 0.0 ) ) ;
275
275
const bar = vec2 ( 0.0 ) ;
276
276
let baz = vec2 ( 0.0 ) ;
277
+
278
+ const fnFloat = float ( ( ) => {
279
+ return 5.0 ;
280
+ } ) ;
281
+
282
+ const fnFVoid = ( ) => {
283
+ 5.0 + 7.0 ;
284
+ } ;
277
285
} ) ;
278
286
279
287
const expected = `
280
288
uniform vec2 foo = vec2(0.0);
281
289
const vec2 bar = vec2(0.0);
282
290
vec2 baz = vec2(0.0);
291
+ float fnFloat() {
292
+ \treturn 5.0;
293
+ }
294
+ void fnFVoid() {
295
+ \t5.0 + 7.0;
296
+ }
283
297
` ;
284
298
assert . equal ( glsl . trim ( ) , expected . trim ( ) ) ;
285
299
} ) ;
You can’t perform that action at this time.
0 commit comments