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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart

Issue 328803002: Handle metadata in the magic [^] property of class descriptions correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | tests/lib/mirrors/metadata_class_mirror_test.dart » ('j') | 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // 232 //
233 // The entries of [data] are built in [assembleProgram] above. 233 // The entries of [data] are built in [assembleProgram] above.
234 234
235 var name = data[0]; 235 var name = data[0];
236 var uri = data[1]; 236 var uri = data[1];
237 var metadata = data[2]; 237 var metadata = data[2];
238 var globalObject = data[3]; 238 var globalObject = data[3];
239 var descriptor = data[4]; 239 var descriptor = data[4];
240 var isRoot = !!data[5]; 240 var isRoot = !!data[5];
241 var fields = descriptor && descriptor["${namer.classDescriptorProperty}"]; 241 var fields = descriptor && descriptor["${namer.classDescriptorProperty}"];
242 if (fields instanceof Array) fields = fields[0];
242 var classes = []; 243 var classes = [];
243 var functions = []; 244 var functions = [];
244 processStatics(descriptor); 245 processStatics(descriptor);
245 libraries.push([name, uri, classes, functions, metadata, fields, isRoot, 246 libraries.push([name, uri, classes, functions, metadata, fields, isRoot,
246 globalObject]); 247 globalObject]);
247 } 248 }
248 '''; 249 ''';
249 250
250 return js(''' 251 return js('''
251 (function (reflectionData) { 252 (function (reflectionData) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 (function() { 374 (function() {
374 var result = $array[$index]; 375 var result = $array[$index];
375 if ($check) { 376 if ($check) {
376 throw new Error( 377 throw new Error(
377 name + ": expected value of type \'$type\' at index " + ($index) + 378 name + ": expected value of type \'$type\' at index " + ($index) +
378 " but got " + (typeof result)); 379 " but got " + (typeof result));
379 } 380 }
380 return result; 381 return result;
381 })()'''; 382 })()''';
382 } 383 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_class_mirror_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698