The code below produces run-time error on dart2js but no error on dart2wasm.
main() {
eval(r'''
globalThis.object1 = {
p1: 1
};
''');
print((globalContext["object1"] as JSObject).getProperty<JSString>("p1".toJS)); // On dart2js: TypeError: 1: type 'int' is not a subtype of type 'String'
}
On dart2wasm 1 is printed. I believe that there should be a run-time error on dart2wasm as well.
cc @srujzs @osa1
Dart SDK version: 3.10.0-edge.33697720bf2aba98e4ae3277e9d60d15621188b2 (main) (Sat Aug 23 14:58:03 2025 -0700) on "linux_x64"