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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1111803005: fix #159, static renames for caller/arguments (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index 3e9d6baad776f3e51fff074dbb3496224f50b61f..c9c21ea81135409a3a068380013d6b5474ec4d79 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-var dart, _js_helper;
+var dart, _js_helper, _js_primitives;
(function (dart) {
'use strict';
@@ -760,7 +760,9 @@ var dart, _js_helper;
let initMethod = proto[name];
let ctor = function() { return initMethod.apply(this, arguments); }
ctor.prototype = proto;
- clazz[name] = ctor;
+ // Use defineProperty so we don't hit a property defined on Function,
+ // like `caller` and `arguments`.
+ defineProperty(clazz, name, { value: ctor, configurable: true });
}
dart.defineNamedConstructor = defineNamedConstructor;
@@ -937,4 +939,7 @@ var dart, _js_helper;
_js_helper = _js_helper || {};
_js_helper.checkNum = notNull;
+ _js_primitives = _js_primitives || {};
+ _js_primitives.printString = (s) => console.log(s);
+
})(dart || (dart = {}));
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698