Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart |
index 05d871798cbb1d951365bec2585f97abf839b983..ad2566869c8b477a08d1271375d77508b8d14ad8 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart |
@@ -10,6 +10,12 @@ part of dart._runtime; |
defineProperty(obj, name, desc) => |
JS('', 'Object.defineProperty(#, #, #)', obj, name, desc); |
+defineValue(obj, name, value) { |
+ defineProperty(obj, name, |
+ JS('', '{ value: #, configurable: true, writable: true }', value)); |
+ return value; |
+} |
+ |
getOwnPropertyDescriptor(obj, name) => |
JS('', 'Object.getOwnPropertyDescriptor(#, #)', obj, name); |
@@ -25,7 +31,7 @@ final hasOwnProperty = JS('', 'Object.prototype.hasOwnProperty'); |
/// assertion failure (TypeError) or CastError. |
void throwStrongModeError(String message) { |
if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); |
- JS('', 'throw new #(#);', StrongModeErrorImplementation, message); |
+ throw new StrongModeErrorImplementation(message); |
} |
/// This error indicates a bug in the runtime or the compiler. |