OLD | NEW |
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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 class InterceptorStubGenerator { | 7 class InterceptorStubGenerator { |
8 final Compiler compiler; | 8 final Compiler compiler; |
9 final Namer namer; | 9 final Namer namer; |
10 final JavaScriptBackend backend; | 10 final JavaScriptBackend backend; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 ''', typeCheck); | 284 ''', typeCheck); |
285 } | 285 } |
286 } | 286 } |
287 return null; | 287 return null; |
288 } | 288 } |
289 | 289 |
290 jsAst.Expression generateOneShotInterceptor(String name) { | 290 jsAst.Expression generateOneShotInterceptor(String name) { |
291 Selector selector = backend.oneShotInterceptors[name]; | 291 Selector selector = backend.oneShotInterceptors[name]; |
292 Set<ClassElement> classes = | 292 Set<ClassElement> classes = |
293 backend.getInterceptedClassesOn(selector.name); | 293 backend.getInterceptedClassesOn(selector.name); |
294 String getInterceptorName = | 294 String getInterceptorName = namer.nameForGetInterceptor(classes); |
295 namer.getInterceptorName(backend.getInterceptorMethod, classes); | |
296 | 295 |
297 List<String> parameterNames = <String>[]; | 296 List<String> parameterNames = <String>[]; |
298 parameterNames.add('receiver'); | 297 parameterNames.add('receiver'); |
299 | 298 |
300 if (selector.isSetter) { | 299 if (selector.isSetter) { |
301 parameterNames.add('value'); | 300 parameterNames.add('value'); |
302 } else { | 301 } else { |
303 for (int i = 0; i < selector.argumentCount; i++) { | 302 for (int i = 0; i < selector.argumentCount; i++) { |
304 parameterNames.add('a$i'); | 303 parameterNames.add('a$i'); |
305 } | 304 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 363 |
365 var map = new jsAst.ObjectInitializer(properties); | 364 var map = new jsAst.ObjectInitializer(properties); |
366 elements.add(map); | 365 elements.add(map); |
367 } | 366 } |
368 } | 367 } |
369 } | 368 } |
370 | 369 |
371 return new jsAst.ArrayInitializer(elements); | 370 return new jsAst.ArrayInitializer(elements); |
372 } | 371 } |
373 } | 372 } |
OLD | NEW |