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

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

Issue 779593002: Move elementAccess() from namer to emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 6 years 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
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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 Compiler compiler = backend.compiler; 311 Compiler compiler = backend.compiler;
312 312
313 Element closureFromTearOff = backend.findHelper('closureFromTearOff'); 313 Element closureFromTearOff = backend.findHelper('closureFromTearOff');
314 String tearOffAccessText; 314 String tearOffAccessText;
315 jsAst.Expression tearOffAccessExpression; 315 jsAst.Expression tearOffAccessExpression;
316 String tearOffGlobalObjectName; 316 String tearOffGlobalObjectName;
317 String tearOffGlobalObject; 317 String tearOffGlobalObject;
318 if (closureFromTearOff != null) { 318 if (closureFromTearOff != null) {
319 // We need both the AST that references [closureFromTearOff] and a string 319 // We need both the AST that references [closureFromTearOff] and a string
320 // for the NoCsp version that constructs a function. 320 // for the NoCsp version that constructs a function.
321 tearOffAccessExpression = namer.elementAccess(closureFromTearOff); 321 tearOffAccessExpression =
322 backend.emitter.staticFunctionAccess(closureFromTearOff);
322 tearOffAccessText = 323 tearOffAccessText =
323 jsAst.prettyPrint(tearOffAccessExpression, compiler).getText(); 324 jsAst.prettyPrint(tearOffAccessExpression, compiler).getText();
324 tearOffGlobalObjectName = tearOffGlobalObject = 325 tearOffGlobalObjectName = tearOffGlobalObject =
325 namer.globalObjectFor(closureFromTearOff); 326 namer.globalObjectFor(closureFromTearOff);
326 } else { 327 } else {
327 // Default values for mocked-up test libraries. 328 // Default values for mocked-up test libraries.
328 tearOffAccessText = 329 tearOffAccessText =
329 r'''function() { throw 'Helper \'closureFromTearOff\' missing.' }'''; 330 r'''function() { throw 'Helper \'closureFromTearOff\' missing.' }''';
330 tearOffAccessExpression = js(tearOffAccessText); 331 tearOffAccessExpression = js(tearOffAccessText);
331 tearOffGlobalObjectName = 'MissingHelperFunction'; 332 tearOffGlobalObjectName = 'MissingHelperFunction';
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 (function() { 415 (function() {
415 var result = $array[$index]; 416 var result = $array[$index];
416 if ($check) { 417 if ($check) {
417 throw new Error( 418 throw new Error(
418 name + ": expected value of type \'$type\' at index " + ($index) + 419 name + ": expected value of type \'$type\' at index " + ($index) +
419 " but got " + (typeof result)); 420 " but got " + (typeof result));
420 } 421 }
421 return result; 422 return result;
422 })()'''; 423 })()''';
423 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698