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.full_emitter; | 5 part of dart2js.js_emitter.full_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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 embeddedNames.INSTANCE_FROM_CLASS_ID); | 72 embeddedNames.INSTANCE_FROM_CLASS_ID); |
73 | 73 |
74 String reflectableField = namer.reflectableField; | 74 String reflectableField = namer.reflectableField; |
75 String reflectionInfoField = namer.reflectionInfoField; | 75 String reflectionInfoField = namer.reflectionInfoField; |
76 String reflectionNameField = namer.reflectionNameField; | 76 String reflectionNameField = namer.reflectionNameField; |
77 String metadataIndexField = namer.metadataIndexField; | 77 String metadataIndexField = namer.metadataIndexField; |
78 String defaultValuesField = namer.defaultValuesField; | 78 String defaultValuesField = namer.defaultValuesField; |
79 String methodsWithOptionalArgumentsField = | 79 String methodsWithOptionalArgumentsField = |
80 namer.methodsWithOptionalArgumentsField; | 80 namer.methodsWithOptionalArgumentsField; |
81 String unmangledNameIndex = backend.mustRetainMetadata | 81 String unmangledNameIndex = backend.mustRetainMetadata |
82 ? ' 3 * optionalParameterCount + 2 * requiredParameterCount + 3' | 82 ? ' 4 * optionalParameterCount + 3 * requiredParameterCount + 3' |
83 : ' 2 * optionalParameterCount + requiredParameterCount + 3'; | 83 : ' 3 * optionalParameterCount + 2 * requiredParameterCount + 3'; |
84 String receiverParamName = compiler.enableMinification ? "r" : "receiver"; | 84 String receiverParamName = compiler.enableMinification ? "r" : "receiver"; |
85 String valueParamName = compiler.enableMinification ? "v" : "value"; | 85 String valueParamName = compiler.enableMinification ? "v" : "value"; |
86 String space = compiler.enableMinification ? "" : " "; | 86 String space = compiler.enableMinification ? "" : " "; |
87 String _ = space; | 87 String _ = space; |
88 | 88 |
89 String specProperty = '"${namer.nativeSpecProperty}"'; // "%" | 89 String specProperty = '"${namer.nativeSpecProperty}"'; // "%" |
90 jsAst.Expression nativeInfoAccess = js('prototype[$specProperty]', []); | 90 jsAst.Expression nativeInfoAccess = js('prototype[$specProperty]', []); |
91 jsAst.Expression constructorAccess = js('constructor', []); | 91 jsAst.Expression constructorAccess = js('constructor', []); |
92 Function subclassReadGenerator = | 92 Function subclassReadGenerator = |
93 (jsAst.Expression subclass) => js('allClasses[#]', subclass); | 93 (jsAst.Expression subclass) => js('allClasses[#]', subclass); |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 (function() { | 848 (function() { |
849 var result = $array[$index]; | 849 var result = $array[$index]; |
850 if ($check) { | 850 if ($check) { |
851 throw new Error( | 851 throw new Error( |
852 name + ": expected value of type \'$type\' at index " + ($index) + | 852 name + ": expected value of type \'$type\' at index " + ($index) + |
853 " but got " + (typeof result)); | 853 " but got " + (typeof result)); |
854 } | 854 } |
855 return result; | 855 return result; |
856 })()'''; | 856 })()'''; |
857 } | 857 } |
OLD | NEW |