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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart

Issue 998983002: Ensure that descriptors have a prototype. (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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 // TODO(ahe): Share these with js_helper.dart. 7 // TODO(ahe): Share these with js_helper.dart.
8 const FUNCTION_INDEX = 0; 8 const FUNCTION_INDEX = 0;
9 const NAME_INDEX = 1; 9 const NAME_INDEX = 1;
10 const CALL_NAME_INDEX = 2; 10 const CALL_NAME_INDEX = 2;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 emitter.generateEmbeddedGlobalAccess(embeddedNames.MANGLED_GLOBAL_NAMES); 48 emitter.generateEmbeddedGlobalAccess(embeddedNames.MANGLED_GLOBAL_NAMES);
49 jsAst.Expression mangledNamesAccess = 49 jsAst.Expression mangledNamesAccess =
50 emitter.generateEmbeddedGlobalAccess(embeddedNames.MANGLED_NAMES); 50 emitter.generateEmbeddedGlobalAccess(embeddedNames.MANGLED_NAMES);
51 jsAst.Expression librariesAccess = 51 jsAst.Expression librariesAccess =
52 emitter.generateEmbeddedGlobalAccess(embeddedNames.LIBRARIES); 52 emitter.generateEmbeddedGlobalAccess(embeddedNames.LIBRARIES);
53 jsAst.Expression typesAccess = 53 jsAst.Expression typesAccess =
54 emitter.generateEmbeddedGlobalAccess(embeddedNames.TYPES); 54 emitter.generateEmbeddedGlobalAccess(embeddedNames.TYPES);
55 55
56 jsAst.Statement processClassData = js.statement('''{ 56 jsAst.Statement processClassData = js.statement('''{
57 function processClassData(cls, descriptor, processedClasses) { 57 function processClassData(cls, descriptor, processedClasses) {
58 var newDesc = map(); // Use a slow object. 58 var newDesc = {};
floitsch 2015/03/11 13:11:49 comment why not map().
herhut 2015/03/11 13:36:24 Done.
59 newDesc.x = 0; delete newDesc.x; // Make object slow.
59 var previousProperty; 60 var previousProperty;
60 var properties = Object.keys(descriptor); 61 var properties = Object.keys(descriptor);
61 for (var i = 0; i < properties.length; i++) { 62 for (var i = 0; i < properties.length; i++) {
62 var property = properties[i]; 63 var property = properties[i];
63 var firstChar = property.substring(0, 1); 64 var firstChar = property.substring(0, 1);
64 if (property === "static") { 65 if (property === "static") {
65 processStatics(#embeddedStatics[cls] = descriptor[property], 66 processStatics(#embeddedStatics[cls] = descriptor[property],
66 processedClasses); 67 processedClasses);
67 } else if (firstChar === "+") { 68 } else if (firstChar === "+") {
68 mangledNames[previousProperty] = property.substring(1); 69 mangledNames[previousProperty] = property.substring(1);
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 (function() { 485 (function() {
485 var result = $array[$index]; 486 var result = $array[$index];
486 if ($check) { 487 if ($check) {
487 throw new Error( 488 throw new Error(
488 name + ": expected value of type \'$type\' at index " + ($index) + 489 name + ": expected value of type \'$type\' at index " + ($index) +
489 " but got " + (typeof result)); 490 " but got " + (typeof result));
490 } 491 }
491 return result; 492 return result;
492 })()'''; 493 })()''';
493 } 494 }
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