Skip to content

Commit 5007e1a

Browse files
committed
Fix internal NSM helper to use a Dart Symbol
Not sure if this entirely handles #470, but it does fix the breaking example. [email protected] Review URL: https://codereview.chromium.org/1754773002 .
1 parent d530938 commit 5007e1a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/dev_compiler/lib/runtime/dart/_runtime.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,11 @@ dart_library.library('dart/_runtime', null, /* Imports */[
426426
}
427427
return true;
428428
}
429+
function _dartSymbol(name) {
430+
return const_(core.Symbol.new(name.toString()));
431+
}
429432
function throwNoSuchMethod(obj, name, pArgs, nArgs, extras) {
430-
throw_(new core.NoSuchMethodError(obj, name, pArgs, nArgs, extras));
433+
throw_(new core.NoSuchMethodError(obj, _dartSymbol(name), pArgs, nArgs, extras));
431434
}
432435
function throwNoSuchMethodFunc(obj, name, pArgs, opt_func) {
433436
if (obj === void 0) obj = opt_func;

pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ checkApply(type, actuals) => JS('', '''(() => {
7474
return true;
7575
})()''');
7676

77+
_dartSymbol(name) => JS('', '''
78+
$const_($Symbol.new($name.toString()))
79+
''');
7780

7881
throwNoSuchMethod(obj, name, pArgs, nArgs, extras) => JS('', '''(() => {
79-
$throw_(new $NoSuchMethodError($obj, $name, $pArgs, $nArgs, $extras));
82+
$throw_(new $NoSuchMethodError($obj, $_dartSymbol($name), $pArgs, $nArgs, $extras));
8083
})()''');
8184

8285
throwNoSuchMethodFunc(obj, name, pArgs, opt_func) => JS('', '''(() => {

0 commit comments

Comments
 (0)