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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2977583002: Fix handling of async patches. (Closed)
Patch Set: Fix Created 3 years, 5 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 | « no previous file | sdk/lib/_internal/js_runtime/lib/isolate_patch.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 library elements.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Identifiers; 8 import '../common/names.dart' show Identifiers;
9 import '../common/resolution.dart' show Resolution, ParsingContext; 9 import '../common/resolution.dart' show Resolution, ParsingContext;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 get asyncMarker { 334 get asyncMarker {
335 throw new UnsupportedError("asyncMarker"); 335 throw new UnsupportedError("asyncMarker");
336 } 336 }
337 337
338 @override 338 @override
339 set asyncMarker(_) { 339 set asyncMarker(_) {
340 throw new UnsupportedError("asyncMarker="); 340 throw new UnsupportedError("asyncMarker=");
341 } 341 }
342 342
343 @override 343 @override
344 get _asyncMarker {
345 throw new UnsupportedError("_asyncMarker");
346 }
347
348 @override
349 set _asyncMarker(_) {
350 throw new UnsupportedError("_asyncMarker=");
351 }
352
353 @override
344 get effectiveTargetInternal { 354 get effectiveTargetInternal {
345 throw new UnsupportedError("effectiveTargetInternal"); 355 throw new UnsupportedError("effectiveTargetInternal");
346 } 356 }
347 357
348 @override 358 @override
349 set effectiveTargetInternal(_) { 359 set effectiveTargetInternal(_) {
350 throw new UnsupportedError("effectiveTargetInternal="); 360 throw new UnsupportedError("effectiveTargetInternal=");
351 } 361 }
352 362
353 @override 363 @override
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 abstract class BaseFunctionElementX extends ElementX 2048 abstract class BaseFunctionElementX extends ElementX
2039 with PatchMixin<FunctionElement>, AstElementMixin 2049 with PatchMixin<FunctionElement>, AstElementMixin
2040 implements FunctionElement { 2050 implements FunctionElement {
2041 ResolutionDartType typeCache; 2051 ResolutionDartType typeCache;
2042 final Modifiers modifiers; 2052 final Modifiers modifiers;
2043 2053
2044 List<FunctionElement> nestedClosures = new List<FunctionElement>(); 2054 List<FunctionElement> nestedClosures = new List<FunctionElement>();
2045 2055
2046 FunctionSignature _functionSignatureCache; 2056 FunctionSignature _functionSignatureCache;
2047 2057
2048 AsyncMarker asyncMarker = AsyncMarker.SYNC; 2058 AsyncMarker _asyncMarker = AsyncMarker.SYNC;
2049 2059
2050 BaseFunctionElementX(String name, ElementKind kind, Modifiers this.modifiers, 2060 BaseFunctionElementX(String name, ElementKind kind, Modifiers this.modifiers,
2051 Element enclosing) 2061 Element enclosing)
2052 : super(name, kind, enclosing) { 2062 : super(name, kind, enclosing) {
2053 assert(modifiers != null); 2063 assert(modifiers != null);
2054 } 2064 }
2055 2065
2066 AsyncMarker get asyncMarker {
2067 if (isPatched) {
2068 return patch.asyncMarker;
2069 }
2070 return _asyncMarker;
2071 }
2072
2073 void set asyncMarker(AsyncMarker value) {
2074 if (isPatched) {
2075 BaseFunctionElementX function = patch;
2076 function.asyncMarker = value;
2077 } else {
2078 _asyncMarker = value;
2079 }
2080 }
2081
2056 bool get isExternal => modifiers.isExternal; 2082 bool get isExternal => modifiers.isExternal;
2057 2083
2058 bool get isInstanceMember { 2084 bool get isInstanceMember {
2059 return isClassMember && !isConstructor && !isStatic; 2085 return isClassMember && !isConstructor && !isStatic;
2060 } 2086 }
2061 2087
2062 ParameterStructure get parameterStructure => 2088 ParameterStructure get parameterStructure =>
2063 functionSignature.parameterStructure; 2089 functionSignature.parameterStructure;
2064 2090
2065 bool get hasFunctionSignature => _functionSignatureCache != null; 2091 bool get hasFunctionSignature => _functionSignatureCache != null;
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 body = node.asFunctionExpression().body; 3601 body = node.asFunctionExpression().body;
3576 } 3602 }
3577 return new ParsedResolvedAst( 3603 return new ParsedResolvedAst(
3578 declaration, 3604 declaration,
3579 node, 3605 node,
3580 body, 3606 body,
3581 definingElement.treeElements, 3607 definingElement.treeElements,
3582 definingElement.compilationUnit.script.resourceUri); 3608 definingElement.compilationUnit.script.resourceUri);
3583 } 3609 }
3584 } 3610 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/isolate_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698