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 = {})); |