File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -8271,7 +8271,12 @@ export class Compiler extends DiagnosticEmitter {
8271
8271
this . currentType = signatureReference . type . asNullable ( ) ;
8272
8272
return module . i32 ( 0 ) ;
8273
8273
}
8274
- return module . ref_null ( ) ;
8274
+ // TODO: return null ref for externref or funcref
8275
+ this . error (
8276
+ DiagnosticCode . Not_implemented_0 ,
8277
+ expression . range ,
8278
+ "null references"
8279
+ ) ;
8275
8280
}
8276
8281
this . currentType = options . usizeType ;
8277
8282
this . warning (
@@ -10653,7 +10658,10 @@ export class Compiler extends DiagnosticEmitter {
10653
10658
case TypeKind . F32 : return module . f32 ( 0 ) ;
10654
10659
case TypeKind . F64 : return module . f64 ( 0 ) ;
10655
10660
case TypeKind . V128 : return module . v128 ( v128_zero ) ;
10656
- case TypeKind . EXTERNREF : return module . ref_null ( ) ;
10661
+ case TypeKind . EXTERNREF :
10662
+ // TODO: return null ref for both externref as well as funcref
10663
+ assert ( false , 'null for externref is not yet supported' ) ;
10664
+ return module . unreachable ( ) ;
10657
10665
}
10658
10666
}
10659
10667
Original file line number Diff line number Diff line change @@ -26,9 +26,8 @@ console.log(someObject);
26
26
console . log ( someKey ) ;
27
27
console . log ( Reflect . get ( someObject , someKey ) ) ;
28
28
29
- // can represent and recognize 'null'
30
-
31
- var nullGlobal : externref ;
29
+ // TODO: can represent and recognize 'null' for both externref and funcref
30
+ /* var nullGlobal: externref;
32
31
assert(!nullGlobal);
33
32
nullGlobal = null;
34
33
assert(!nullGlobal);
@@ -43,10 +42,11 @@ assert(!nullGlobalInit);
43
42
assert(!nullLocalInit);
44
43
}
45
44
46
- // can represent function references
45
+ // funcref can represent function references
47
46
48
47
function someFunc(): void {}
49
48
var funcGlobal: externref = someFunc;
50
49
{
51
50
let funcLocal: externref = someFunc;
52
51
}
52
+ */
You can’t perform that action at this time.
0 commit comments