| OLD | NEW |
| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 | 2805 |
| 2806 jsAst.Expression assignment = | 2806 jsAst.Expression assignment = |
| 2807 js('$isolateProperties.$name = #', js.fun(parameters, body)); | 2807 js('$isolateProperties.$name = #', js.fun(parameters, body)); |
| 2808 | 2808 |
| 2809 buffer.write(jsAst.prettyPrint(assignment, compiler)); | 2809 buffer.write(jsAst.prettyPrint(assignment, compiler)); |
| 2810 buffer.write(N); | 2810 buffer.write(N); |
| 2811 } | 2811 } |
| 2812 } | 2812 } |
| 2813 | 2813 |
| 2814 /** | 2814 /** |
| 2815 * If [:invokeOn:] has been compiled, emit all the possible selector names | 2815 * If [JSInvocationMirror._invokeOn] has been compiled, emit all the |
| 2816 * that are intercepted into the [:interceptedNames:] top-level | 2816 * possible selector names that are intercepted into the |
| 2817 * variable. The implementation of [:invokeOn:] will use it to | 2817 * [interceptedNames] top-level variable. The implementation of |
| 2818 * determine whether it should call the method with an extra | 2818 * [_invokeOn] will use it to determine whether it should call the |
| 2819 * parameter. | 2819 * method with an extra parameter. |
| 2820 */ | 2820 */ |
| 2821 void emitInterceptedNames(CodeBuffer buffer) { | 2821 void emitInterceptedNames(CodeBuffer buffer) { |
| 2822 if (!compiler.enabledInvokeOn) return; | 2822 if (!compiler.enabledInvokeOn) return; |
| 2823 String name = backend.namer.getName(backend.interceptedNames); | 2823 String name = backend.namer.getName(backend.interceptedNames); |
| 2824 | 2824 |
| 2825 int index = 0; | 2825 int index = 0; |
| 2826 List<jsAst.ArrayElement> elements = backend.usedInterceptors.map( | 2826 List<jsAst.ArrayElement> elements = backend.usedInterceptors.map( |
| 2827 (Selector selector) { | 2827 (Selector selector) { |
| 2828 jsAst.Literal str = js.string(namer.invocationName(selector)); | 2828 jsAst.Literal str = js.string(namer.invocationName(selector)); |
| 2829 return new jsAst.ArrayElement(index++, str); | 2829 return new jsAst.ArrayElement(index++, str); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 """; | 3038 """; |
| 3039 const String HOOKS_API_USAGE = """ | 3039 const String HOOKS_API_USAGE = """ |
| 3040 // The code supports the following hooks: | 3040 // The code supports the following hooks: |
| 3041 // dartPrint(message) - if this function is defined it is called | 3041 // dartPrint(message) - if this function is defined it is called |
| 3042 // instead of the Dart [print] method. | 3042 // instead of the Dart [print] method. |
| 3043 // dartMainRunner(main) - if this function is defined, the Dart [main] | 3043 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 3044 // method will not be invoked directly. | 3044 // method will not be invoked directly. |
| 3045 // Instead, a closure that will invoke [main] is | 3045 // Instead, a closure that will invoke [main] is |
| 3046 // passed to [dartMainRunner]. | 3046 // passed to [dartMainRunner]. |
| 3047 """; | 3047 """; |
| OLD | NEW |