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

Side by Side Diff: pkg/dart2js_incremental/lib/library_updater.dart

Issue 993573002: Ensure that collectedClasses always contains a [globalObject, descriptor] pair. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js_incremental.library_updater; 5 library dart2js_incremental.library_updater;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 } 921 }
922 922
923 jsAst.Expression invokeDefineClass(ClassElementX cls) { 923 jsAst.Expression invokeDefineClass(ClassElementX cls) {
924 String name = namer.className(cls); 924 String name = namer.className(cls);
925 var descriptor = js('Object.create(null)'); 925 var descriptor = js('Object.create(null)');
926 return js( 926 return js(
927 r''' 927 r'''
928 (new Function( 928 (new Function(
929 "$collectedClasses", "$desc", 929 "$collectedClasses", "$desc",
930 this.defineClass(#name, #computeFields) +"\n;return " + #name))( 930 this.defineClass(#name, #computeFields) +"\n;return " + #name))(
931 {#name: #descriptor})''', 931 {#name: [,#descriptor]})''',
932 {'name': js.string(name), 932 {'name': js.string(name),
933 'computeFields': js.stringArray(computeFields(cls)), 933 'computeFields': js.stringArray(computeFields(cls)),
934 'descriptor': descriptor}); 934 'descriptor': descriptor});
935 } 935 }
936 936
937 jsAst.Node computeMethodUpdateJs(Element element) { 937 jsAst.Node computeMethodUpdateJs(Element element) {
938 Method member = new ProgramBuilder(compiler, namer, emitter) 938 Method member = new ProgramBuilder(compiler, namer, emitter)
939 .buildMethodHackForIncrementalCompilation(element); 939 .buildMethodHackForIncrementalCompilation(element);
940 if (member == null) { 940 if (member == null) {
941 compiler.internalError(element, '${element.runtimeType}'); 941 compiler.internalError(element, '${element.runtimeType}');
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 .buildFieldsHackForIncrementalCompilation(classElement); 1487 .buildFieldsHackForIncrementalCompilation(classElement);
1488 // TODO(ahe): Rewrite for new emitter. 1488 // TODO(ahe): Rewrite for new emitter.
1489 ClassBuilder builder = new ClassBuilder(classElement, namer); 1489 ClassBuilder builder = new ClassBuilder(classElement, namer);
1490 classEmitter.emitFields(cls, builder); 1490 classEmitter.emitFields(cls, builder);
1491 return builder.fields; 1491 return builder.fields;
1492 } 1492 }
1493 } 1493 }
1494 1494
1495 // TODO(ahe): Remove this method. 1495 // TODO(ahe): Remove this method.
1496 NO_WARN(x) => x; 1496 NO_WARN(x) => x;
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698