| 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; | 108 f.getterStub = true; |
| 109 f.\$getterStub = true; | |
| 110 ''' | 109 ''' |
| 111 /* Used to create an isolate using spawnFunction.*/ | 110 /* Used to create an isolate using spawnFunction.*/ |
| 112 ''' | 111 ''' |
| 113 if (isStatic) init.globalFunctions[name] = f; | 112 if (isStatic) init.globalFunctions[name] = f; |
| 114 originalDescriptor[getterStubName] = descriptor[getterStubName] = f; | 113 originalDescriptor[getterStubName] = descriptor[getterStubName] = f; |
| 115 funcs.push(f); | 114 funcs.push(f); |
| 116 if (getterStubName) functions.push(getterStubName); | 115 if (getterStubName) functions.push(getterStubName); |
| 117 f.\$stubName = getterStubName; | 116 f.\$stubName = getterStubName; |
| 118 f.\$callName = null; | 117 f.\$callName = null; |
| 119 if (isIntercepted) init.interceptedNames[getterStubName] = true; | 118 if (isIntercepted) init.interceptedNames[getterStubName] = true; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 (function() { | 351 (function() { |
| 353 var result = $array[$index]; | 352 var result = $array[$index]; |
| 354 if ($check) { | 353 if ($check) { |
| 355 throw new Error( | 354 throw new Error( |
| 356 name + ": expected value of type \'$type\' at index " + ($index) + | 355 name + ": expected value of type \'$type\' at index " + ($index) + |
| 357 " but got " + (typeof result)); | 356 " but got " + (typeof result)); |
| 358 } | 357 } |
| 359 return result; | 358 return result; |
| 360 })()'''; | 359 })()'''; |
| 361 } | 360 } |
| OLD | NEW |