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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1034273003: fix for static methods and names banned in strict mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index 4033e89ccdc78f9e7d21f87f81ca5fe56b721cad..058c3216b43c96b1b7d8c799f91bdea9a74c2d2f 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -280,8 +280,9 @@ var dart, _js_helper;
* function with the same name. For example `new SomeClass.name(args)`.
*/
function defineNamedConstructor(clazz, name) {
+ var shortName = name.startsWith('::') ? name.substring(2) : name;
var proto = clazz.prototype;
- var initMethod = proto[clazz.name + '$' + name];
+ var initMethod = proto[clazz.name + '$' + shortName];
var ctor = function() { return initMethod.apply(this, arguments); }
ctor.prototype = proto;
clazz[name] = ctor;

Powered by Google App Engine
This is Rietveld 408576698