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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2850023002: dart2js: rewrite_async: Don't call JavaScript factory constructor with 'new' (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 js_backend.backend; 5 library js_backend.backend;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' 8 import '../common/backend_api.dart'
9 show ForeignResolver, NativeRegistry, ImpactTransformer; 9 show ForeignResolver, NativeRegistry, ImpactTransformer;
10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; 10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem;
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 jsAst.Expression rewriteAsync( 1281 jsAst.Expression rewriteAsync(
1282 FunctionElement element, jsAst.Expression code) { 1282 FunctionElement element, jsAst.Expression code) {
1283 AsyncRewriterBase rewriter = null; 1283 AsyncRewriterBase rewriter = null;
1284 jsAst.Name name = namer.methodPropertyName(element); 1284 jsAst.Name name = namer.methodPropertyName(element);
1285 switch (element.asyncMarker) { 1285 switch (element.asyncMarker) {
1286 case AsyncMarker.ASYNC: 1286 case AsyncMarker.ASYNC:
1287 rewriter = new AsyncRewriter(reporter, element, 1287 rewriter = new AsyncRewriter(reporter, element,
1288 asyncHelper: 1288 asyncHelper:
1289 emitter.staticFunctionAccess(commonElements.asyncHelper), 1289 emitter.staticFunctionAccess(commonElements.asyncHelper),
1290 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody), 1290 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody),
1291 newCompleter: emitter 1291 completerFactory: emitter
1292 .staticFunctionAccess(commonElements.syncCompleterConstructor), 1292 .staticFunctionAccess(commonElements.syncCompleterConstructor),
1293 safeVariableName: namer.safeVariablePrefixForAsyncRewrite, 1293 safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
1294 bodyName: namer.deriveAsyncBodyName(name)); 1294 bodyName: namer.deriveAsyncBodyName(name));
1295 break; 1295 break;
1296 case AsyncMarker.SYNC_STAR: 1296 case AsyncMarker.SYNC_STAR:
1297 rewriter = new SyncStarRewriter(reporter, element, 1297 rewriter = new SyncStarRewriter(reporter, element,
1298 endOfIteration: 1298 endOfIteration:
1299 emitter.staticFunctionAccess(commonElements.endOfIteration), 1299 emitter.staticFunctionAccess(commonElements.endOfIteration),
1300 newIterable: emitter.staticFunctionAccess( 1300 iterableFactory: emitter.staticFunctionAccess(
1301 commonElements.syncStarIterableConstructor), 1301 commonElements.syncStarIterableConstructor),
1302 yieldStarExpression: 1302 yieldStarExpression:
1303 emitter.staticFunctionAccess(commonElements.yieldStar), 1303 emitter.staticFunctionAccess(commonElements.yieldStar),
1304 uncaughtErrorExpression: emitter 1304 uncaughtErrorExpression: emitter
1305 .staticFunctionAccess(commonElements.syncStarUncaughtError), 1305 .staticFunctionAccess(commonElements.syncStarUncaughtError),
1306 safeVariableName: namer.safeVariablePrefixForAsyncRewrite, 1306 safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
1307 bodyName: namer.deriveAsyncBodyName(name)); 1307 bodyName: namer.deriveAsyncBodyName(name));
1308 break; 1308 break;
1309 case AsyncMarker.ASYNC_STAR: 1309 case AsyncMarker.ASYNC_STAR:
1310 rewriter = new AsyncStarRewriter(reporter, element, 1310 rewriter = new AsyncStarRewriter(reporter, element,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 1450
1451 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1451 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1452 return !selector.isGetter; 1452 return !selector.isGetter;
1453 } 1453 }
1454 1454
1455 /// Returns `true` if [member] is called from a subclass via `super`. 1455 /// Returns `true` if [member] is called from a subclass via `super`.
1456 bool isAliasedSuperMember(MemberEntity member) { 1456 bool isAliasedSuperMember(MemberEntity member) {
1457 return _aliasedSuperMembers.contains(member); 1457 return _aliasedSuperMembers.contains(member);
1458 } 1458 }
1459 } 1459 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698