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

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

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased Created 3 years, 11 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) 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 // TODO(floitsch): the native-emitter should not know about ClassBuilders. 8 // TODO(floitsch): the native-emitter should not know about ClassBuilders.
9 final Map<Element, full_js_emitter.ClassBuilder> cachedBuilders; 9 final Map<Element, full_js_emitter.ClassBuilder> cachedBuilders;
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 FunctionSignature parameters = member.functionSignature; 257 FunctionSignature parameters = member.functionSignature;
258 Element converter = helpers.closureConverter; 258 Element converter = helpers.closureConverter;
259 jsAst.Expression closureConverter = 259 jsAst.Expression closureConverter =
260 emitterTask.staticFunctionAccess(converter); 260 emitterTask.staticFunctionAccess(converter);
261 parameters.forEachParameter((ParameterElement parameter) { 261 parameters.forEachParameter((ParameterElement parameter) {
262 String name = parameter.name; 262 String name = parameter.name;
263 // If [name] is not in [stubParameters], then the parameter is an optional 263 // If [name] is not in [stubParameters], then the parameter is an optional
264 // parameter that was not provided for this stub. 264 // parameter that was not provided for this stub.
265 for (jsAst.Parameter stubParameter in stubParameters) { 265 for (jsAst.Parameter stubParameter in stubParameters) {
266 if (stubParameter.name == name) { 266 if (stubParameter.name == name) {
267 DartType type = parameter.type.unaliased; 267 ResolutionDartType type = parameter.type.unaliased;
268 if (type is FunctionType) { 268 if (type is ResolutionFunctionType) {
269 // The parameter type is a function type either directly or through 269 // The parameter type is a function type either directly or through
270 // typedef(s). 270 // typedef(s).
271 FunctionType functionType = type; 271 ResolutionFunctionType functionType = type;
272 int arity = functionType.computeArity(); 272 int arity = functionType.computeArity();
273 statements.add(js 273 statements.add(js
274 .statement('# = #(#, $arity)', [name, closureConverter, name])); 274 .statement('# = #(#, $arity)', [name, closureConverter, name]));
275 break; 275 break;
276 } 276 }
277 } 277 }
278 } 278 }
279 }); 279 });
280 } 280 }
281 281
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // used. We should also use an interceptor if the check can't be satisfied 350 // used. We should also use an interceptor if the check can't be satisfied
351 // by a native class in case we get a native instance that tries to spoof 351 // by a native class in case we get a native instance that tries to spoof
352 // the type info. i.e the criteria for whether or not to use an interceptor 352 // the type info. i.e the criteria for whether or not to use an interceptor
353 // is whether the receiver can be native, not the type of the test. 353 // is whether the receiver can be native, not the type of the test.
354 if (element == null || !element.isClass) return false; 354 if (element == null || !element.isClass) return false;
355 ClassElement cls = element; 355 ClassElement cls = element;
356 if (backend.isNativeOrExtendsNative(cls)) return true; 356 if (backend.isNativeOrExtendsNative(cls)) return true;
357 return isSupertypeOfNativeClass(element); 357 return isSupertypeOfNativeClass(element);
358 } 358 }
359 } 359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698