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

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

Issue 2908153003: It's alive! (Closed)
Patch Set: Updated cf. comments Created 3 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
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.js_emitter.class_stub_generator; 5 library dart2js.js_emitter.class_stub_generator;
6 6
7 import '../common/names.dart' show Identifiers; 7 import '../common/names.dart' show Identifiers;
8 import '../common_elements.dart' show CommonElements; 8 import '../common_elements.dart' show CommonElements;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../js/js.dart' as jsAst; 10 import '../js/js.dart' as jsAst;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 /// * `isIntercepted. 237 /// * `isIntercepted.
238 List<jsAst.Statement> buildTearOffCode(CompilerOptions options, Emitter emitter, 238 List<jsAst.Statement> buildTearOffCode(CompilerOptions options, Emitter emitter,
239 Namer namer, CommonElements commonElements) { 239 Namer namer, CommonElements commonElements) {
240 FunctionEntity closureFromTearOff = commonElements.closureFromTearOff; 240 FunctionEntity closureFromTearOff = commonElements.closureFromTearOff;
241 jsAst.Expression tearOffAccessExpression; 241 jsAst.Expression tearOffAccessExpression;
242 jsAst.Expression tearOffGlobalObjectString; 242 jsAst.Expression tearOffGlobalObjectString;
243 jsAst.Expression tearOffGlobalObject; 243 jsAst.Expression tearOffGlobalObject;
244 if (closureFromTearOff != null) { 244 if (closureFromTearOff != null) {
245 tearOffAccessExpression = emitter.staticFunctionAccess(closureFromTearOff); 245 tearOffAccessExpression = emitter.staticFunctionAccess(closureFromTearOff);
246 tearOffGlobalObject = 246 tearOffGlobalObject =
247 js.stringPart(namer.globalObjectForMethod(closureFromTearOff)); 247 js.stringPart(namer.globalObjectForMember(closureFromTearOff));
248 tearOffGlobalObjectString = 248 tearOffGlobalObjectString =
249 js.string(namer.globalObjectForMethod(closureFromTearOff)); 249 js.string(namer.globalObjectForMember(closureFromTearOff));
250 } else { 250 } else {
251 // Default values for mocked-up test libraries. 251 // Default values for mocked-up test libraries.
252 tearOffAccessExpression = 252 tearOffAccessExpression =
253 js(r'''function() { throw "Helper 'closureFromTearOff' missing." }'''); 253 js(r'''function() { throw "Helper 'closureFromTearOff' missing." }''');
254 tearOffGlobalObjectString = js.string('MissingHelperFunction'); 254 tearOffGlobalObjectString = js.string('MissingHelperFunction');
255 tearOffGlobalObject = js( 255 tearOffGlobalObject = js(
256 r'''(function() { throw "Helper 'closureFromTearOff' missing." })()'''); 256 r'''(function() { throw "Helper 'closureFromTearOff' missing." })()''');
257 } 257 }
258 258
259 jsAst.Statement tearOffGetter; 259 jsAst.Statement tearOffGetter;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 if (cache === void 0) cache = #tearOff( 313 if (cache === void 0) cache = #tearOff(
314 this, funcs, reflectionInfo, true, [], name).prototype; 314 this, funcs, reflectionInfo, true, [], name).prototype;
315 return cache; 315 return cache;
316 } 316 }
317 : tearOffGetter(funcs, reflectionInfo, name, isIntercepted); 317 : tearOffGetter(funcs, reflectionInfo, name, isIntercepted);
318 }''', 318 }''',
319 {'tearOff': tearOffAccessExpression}); 319 {'tearOff': tearOffAccessExpression});
320 320
321 return <jsAst.Statement>[tearOffGetter, tearOff]; 321 return <jsAst.Statement>[tearOffGetter, tearOff];
322 } 322 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/js_emitter/full_emitter/class_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698