Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart

Issue 2934623003: fix #29753, use ES5 constructors for ddc (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698