| OLD | NEW |
| 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 class NsmEmitter extends CodeEmitterHelper { | 7 class NsmEmitter extends CodeEmitterHelper { |
| 8 final List<Selector> trivialNsmHandlers = <Selector>[]; | 8 final List<Selector> trivialNsmHandlers = <Selector>[]; |
| 9 | 9 |
| 10 /// If this is true then we can generate the noSuchMethod handlers at startup | 10 /// If this is true then we can generate the noSuchMethod handlers at startup |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 assert(backend.isInterceptedName(Compiler.NO_SUCH_METHOD)); | 83 assert(backend.isInterceptedName(Compiler.NO_SUCH_METHOD)); |
| 84 jsAst.Expression expression = js('this.#(this, #(#, #, #, #, #))', [ | 84 jsAst.Expression expression = js('this.#(this, #(#, #, #, #, #))', [ |
| 85 noSuchMethodName, | 85 noSuchMethodName, |
| 86 namer.elementAccess(backend.getCreateInvocationMirror()), | 86 namer.elementAccess(backend.getCreateInvocationMirror()), |
| 87 js.string(compiler.enableMinification ? | 87 js.string(compiler.enableMinification ? |
| 88 internalName : methodName), | 88 internalName : methodName), |
| 89 js.string(internalName), | 89 js.string(internalName), |
| 90 js.number(type), | 90 js.number(type), |
| 91 new jsAst.ArrayInitializer.from(parameterNames.map(js)), | 91 new jsAst.ArrayInitializer(parameterNames.map(js).toList()), |
| 92 new jsAst.ArrayInitializer.from(argNames)]); | 92 new jsAst.ArrayInitializer(argNames)]); |
| 93 | 93 |
| 94 if (backend.isInterceptedName(selector.name)) { | 94 if (backend.isInterceptedName(selector.name)) { |
| 95 return js(r'function($receiver, #) { return # }', | 95 return js(r'function($receiver, #) { return # }', |
| 96 [parameterNames, expression]); | 96 [parameterNames, expression]); |
| 97 } else { | 97 } else { |
| 98 return js(r'function(#) { return # }', [parameterNames, expression]); | 98 return js(r'function(#) { return # }', [parameterNames, expression]); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 for (String jsName in addedJsNames.keys.toList()..sort()) { | 102 for (String jsName in addedJsNames.keys.toList()..sort()) { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 noSuchMethodName, | 379 noSuchMethodName, |
| 380 createInvocationMirror, | 380 createInvocationMirror, |
| 381 sliceOffsetParams, // argument to slice | 381 sliceOffsetParams, // argument to slice |
| 382 minify ? 'shortNames' : 'longNames', | 382 minify ? 'shortNames' : 'longNames', |
| 383 sliceOffsetArguments | 383 sliceOffsetArguments |
| 384 ])); | 384 ])); |
| 385 | 385 |
| 386 return statements; | 386 return statements; |
| 387 } | 387 } |
| 388 } | 388 } |
| OLD | NEW |