diff --git a/pkg/dart2wasm/lib/translator.dart b/pkg/dart2wasm/lib/translator.dart index d39958f4cb9..b1e5cdb12b2 100644 --- a/pkg/dart2wasm/lib/translator.dart +++ b/pkg/dart2wasm/lib/translator.dart @@ -1860,13 +1860,13 @@ class Translator with KernelNodes { // runtime. final i = internalizedStringsForJSRuntime.length; internalizedString = module.globals.import('s', '$i', - w.GlobalType(w.RefType.extern(nullable: true), mutable: false)); + w.GlobalType(w.RefType.extern(nullable: false), mutable: false)); internalizedStringsForJSRuntime.add(s); } else { internalizedString = module.globals.import( 'S', s, - w.GlobalType(w.RefType.extern(nullable: true), mutable: false), + w.GlobalType(w.RefType.extern(nullable: false), mutable: false), ); } _internalizedStringGlobals[(module, s)] = internalizedString; diff --git a/pkg/dart2wasm/test/ir_tests/deferred.constant.wat b/pkg/dart2wasm/test/ir_tests/deferred.constant.wat index d9f9f943f8f..2e3a54604a1 100644 --- a/pkg/dart2wasm/test/ir_tests/deferred.constant.wat +++ b/pkg/dart2wasm/test/ir_tests/deferred.constant.wat @@ -25,8 +25,8 @@ (field $fun (ref $#Closure-0-1))))) (type $type256 <...>) (type $#DummyStruct <...>) - (global $S.globalH1Bar< (import "S" "globalH1Bar<") externref) - (global $S.globalH0Foo (import "S" "globalH0Foo") externref) + (global $S.globalH1Bar< (import "S" "globalH1Bar<") (ref extern)) + (global $S.globalH0Foo (import "S" "globalH0Foo") (ref extern)) (global $global29 (ref $#DummyStruct) <...>) (global $"C28 _InterfaceType" (ref $_InterfaceType) <...>) (global $"C334 \"h0\"" (ref $JSStringImpl) <...>) diff --git a/pkg/dart2wasm/test/ir_tests/hello.wat b/pkg/dart2wasm/test/ir_tests/hello.wat index e94dde2d52f..6b9c5277f06 100644 --- a/pkg/dart2wasm/test/ir_tests/hello.wat +++ b/pkg/dart2wasm/test/ir_tests/hello.wat @@ -4,7 +4,7 @@ (type $JSStringImpl (sub final $#Top (struct (field $field0 i32) (field $_ref externref)))) - (global $"S.hello world" (import "S" "hello world") externref) + (global $"S.hello world" (import "S" "hello world") (ref extern)) (global $"C329 \"hello world\"" (ref $JSStringImpl) (i32.const 4) (global.get $"S.hello world")