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

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

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: PTAL Created 5 years, 2 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_backend.patch_resolver; 5 library dart2js.js_backend.patch_resolver;
6 6
7 import '../common/tasks.dart' show 7 import '../common/tasks.dart' show
8 CompilerTask; 8 CompilerTask;
9 import '../compiler.dart' show 9 import '../compiler.dart' show
10 Compiler; 10 Compiler;
(...skipping 12 matching lines...) Expand all
23 23
24 FunctionElement resolveExternalFunction(FunctionElementX element) { 24 FunctionElement resolveExternalFunction(FunctionElementX element) {
25 if (element.isPatched) { 25 if (element.isPatched) {
26 FunctionElementX patch = element.patch; 26 FunctionElementX patch = element.patch;
27 compiler.withCurrentElement(patch, () { 27 compiler.withCurrentElement(patch, () {
28 patch.parseNode(compiler); 28 patch.parseNode(compiler);
29 patch.computeType(compiler); 29 patch.computeType(compiler);
30 }); 30 });
31 checkMatchingPatchSignatures(element, patch); 31 checkMatchingPatchSignatures(element, patch);
32 element = patch; 32 element = patch;
33 } else {
34 compiler.reportError(
35 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
36 } 33 }
37 return element; 34 return element;
38 } 35 }
39 36
40 void checkMatchingPatchParameters(FunctionElement origin, 37 void checkMatchingPatchParameters(FunctionElement origin,
41 List<Element> originParameters, 38 List<Element> originParameters,
42 List<Element> patchParameters) { 39 List<Element> patchParameters) {
43 40
44 assert(originParameters.length == patchParameters.length); 41 assert(originParameters.length == patchParameters.length);
45 for (int index = 0; index < originParameters.length; index++) { 42 for (int index = 0; index < originParameters.length; index++) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 'patchParameterCount': patchSignature.optionalParameterCount}); 148 'patchParameterCount': patchSignature.optionalParameterCount});
152 }); 149 });
153 } else { 150 } else {
154 checkMatchingPatchParameters(origin, 151 checkMatchingPatchParameters(origin,
155 originSignature.optionalParameters, 152 originSignature.optionalParameters,
156 patchSignature.optionalParameters); 153 patchSignature.optionalParameters);
157 } 154 }
158 } 155 }
159 156
160 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698