| 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 // TODO(ahe): Share these with js_helper.dart. | 7 // TODO(ahe): Share these with js_helper.dart. |
| 8 const FUNCTION_INDEX = 0; | 8 const FUNCTION_INDEX = 0; |
| 9 const NAME_INDEX = 1; | 9 const NAME_INDEX = 1; |
| 10 const CALL_NAME_INDEX = 2; | 10 const CALL_NAME_INDEX = 2; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 var optionalParameterCount = optionalParameterInfo >> 1; | 98 var optionalParameterCount = optionalParameterInfo >> 1; |
| 99 var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1; | 99 var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1; |
| 100 var isIntercepted =''' // Break long line. | 100 var isIntercepted =''' // Break long line. |
| 101 ''' requiredParameterCount + optionalParameterCount != funcs[0].length; | 101 ''' requiredParameterCount + optionalParameterCount != funcs[0].length; |
| 102 var functionTypeIndex = ${readFunctionType("array", "2")}; | 102 var functionTypeIndex = ${readFunctionType("array", "2")}; |
| 103 var unmangledNameIndex = $unmangledNameIndex; | 103 var unmangledNameIndex = $unmangledNameIndex; |
| 104 var isReflectable = array.length > unmangledNameIndex; | 104 var isReflectable = array.length > unmangledNameIndex; |
| 105 | 105 |
| 106 if (getterStubName) { | 106 if (getterStubName) { |
| 107 f = tearOff(funcs, array, isStatic, name, isIntercepted); | 107 f = tearOff(funcs, array, isStatic, name, isIntercepted); |
| 108 descriptor[name].\$getter = f; | |
| 109 ''' | 108 ''' |
| 110 /* Used to create an isolate using spawnFunction.*/ | 109 /* Used to create an isolate using spawnFunction.*/ |
| 111 ''' | 110 ''' |
| 112 if (isStatic) init.globalFunctions[name] = f; | 111 if (isStatic) init.globalFunctions[name] = f; |
| 113 originalDescriptor[getterStubName] = descriptor[getterStubName] = f; | 112 originalDescriptor[getterStubName] = descriptor[getterStubName] = f; |
| 114 funcs.push(f); | 113 funcs.push(f); |
| 115 if (getterStubName) functions.push(getterStubName); | 114 if (getterStubName) functions.push(getterStubName); |
| 116 f.\$stubName = getterStubName; | 115 f.\$stubName = getterStubName; |
| 117 f.\$callName = null; | 116 f.\$callName = null; |
| 118 } | 117 } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 (function() { | 348 (function() { |
| 350 var result = $array[$index]; | 349 var result = $array[$index]; |
| 351 if ($check) { | 350 if ($check) { |
| 352 throw new Error( | 351 throw new Error( |
| 353 name + ": expected value of type \'$type\' at index " + ($index) + | 352 name + ": expected value of type \'$type\' at index " + ($index) + |
| 354 " but got " + (typeof result)); | 353 " but got " + (typeof result)); |
| 355 } | 354 } |
| 356 return result; | 355 return result; |
| 357 })()'''; | 356 })()'''; |
| 358 } | 357 } |
| OLD | NEW |