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 {
82718271 this . currentType = signatureReference . type . asNullable ( ) ;
82728272 return module . i32 ( 0 ) ;
82738273 }
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+ ) ;
82758280 }
82768281 this . currentType = options . usizeType ;
82778282 this . warning (
@@ -10653,7 +10658,10 @@ export class Compiler extends DiagnosticEmitter {
1065310658 case TypeKind . F32 : return module . f32 ( 0 ) ;
1065410659 case TypeKind . F64 : return module . f64 ( 0 ) ;
1065510660 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 ( ) ;
1065710665 }
1065810666 }
1065910667
Original file line number Diff line number Diff line change @@ -26,9 +26,8 @@ console.log(someObject);
2626console . log ( someKey ) ;
2727console . log ( Reflect . get ( someObject , someKey ) ) ;
2828
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;
3231assert(!nullGlobal);
3332nullGlobal = null;
3433assert(!nullGlobal);
@@ -43,10 +42,11 @@ assert(!nullGlobalInit);
4342 assert(!nullLocalInit);
4443}
4544
46- // can represent function references
45+ // funcref can represent function references
4746
4847function someFunc(): void {}
4948var funcGlobal: externref = someFunc;
5049{
5150 let funcLocal: externref = someFunc;
5251}
52+ */
You can’t perform that action at this time.
0 commit comments