Chromium Code Reviews| Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| index 80a6e7402377046c8c993bf782297cc4238b25b6..b5a243b617147773d1754430e9d56d892f6b2732 100644 |
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| @@ -508,7 +508,7 @@ class OldEmitter implements Emitter { |
| return js.statement(''' |
| { |
| - var finishedClasses = #; // finishedClassesAccess. |
| + var finishedClasses = #finishedClassesAccess; |
| function finishClass(cls) { |
| @@ -516,22 +516,21 @@ class OldEmitter implements Emitter { |
| finishedClasses[cls] = true; |
| var superclass = pendingClasses[cls]; |
| - |
| // The superclass is only false (empty string) for the Dart Object |
| // class. The minifier together with noSuchMethod can put methods on |
| // the Object.prototype object, and they show through here, so we check |
| // that we have a string. |
| if (!superclass || typeof superclass != "string") return; |
| finishClass(superclass); |
| - var constructor = allClasses[cls]; |
| var superConstructor = allClasses[superclass]; |
| if (!superConstructor) |
| superConstructor = existingIsolateProperties[superclass]; |
| + var constructor = allClasses[cls]; |
| var prototype = inheritFrom(constructor, superConstructor); |
| - if (#) { // !nativeClasses.isEmpty, |
| + if (#hasNativeClasses) { |
| // The property looks like this: |
| // |
| // HtmlElement: { |
| @@ -558,13 +557,13 @@ class OldEmitter implements Emitter { |
| if (nativeSpec[0]) { |
| var tags = nativeSpec[0].split("|"); |
| for (var i = 0; i < tags.length; i++) { |
| - #[tags[i]] = constructor; // embedded interceptorsByTag. |
| - #[tags[i]] = true; // embedded leafTags. |
| + #interceptorsByTagAccess[tags[i]] = constructor; |
| + #leafTagsAccess[tags[i]] = true; |
| } |
| } |
| if (nativeSpec[1]) { |
| tags = nativeSpec[1].split("|"); |
| - if (#) { // User subclassing of native classes? |
| + if (#allowNativesSubclassing) { |
| if (nativeSpec[2]) { |
| var subclasses = nativeSpec[2].split("|"); |
| for (var i = 0; i < subclasses.length; i++) { |
| @@ -573,21 +572,19 @@ class OldEmitter implements Emitter { |
| } |
| } |
| for (i = 0; i < tags.length; i++) { |
| - #[tags[i]] = constructor; // embedded interceptorsByTag. |
| - #[tags[i]] = false; // embedded leafTags. |
| + #interceptorsByTagAccess[tags[i]] = constructor; |
| + #leafTagsAccess[tags[i]] = false; |
| } |
| } |
| } |
| } |
| } |
| } |
| - }''', [finishedClassesAccess, |
| - !nativeClasses.isEmpty, |
| - interceptorsByTagAccess, |
| - leafTagsAccess, |
| - true, |
| - interceptorsByTagAccess, |
| - leafTagsAccess]); |
| + }''', {'finishedClassesAccess': finishedClassesAccess, |
| + 'hasNativeClasses': nativeClasses.isNotEmpty, |
| + 'interceptorsByTagAccess': interceptorsByTagAccess, |
| + 'leafTagsAccess': leafTagsAccess, |
| + 'allowNativesSubclassing': true}); |
| } |
| jsAst.Fun get finishIsolateConstructorFunction { |
| @@ -693,7 +690,7 @@ class OldEmitter implements Emitter { |
| if (!needsDefineClass) return []; |
| return defineClassFunction |
| ..add(buildInheritFrom()) |
| - ..add(js('$finishClassesName = #', finishClassesFunction)) |
| + ..add(js('$finishClassesName = #', finishClassesFunction)) |
|
floitsch
2014/11/25 14:25:13
fix indentation (already previous line).
herhut
2014/11/26 09:41:36
Done.
|
| ..add(initFinishClasses); |
| } |