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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 'allClasses': allClassesAccess, | 123 'allClasses': allClassesAccess, |
124 'debugFastObjects': DEBUG_FAST_OBJECTS, | 124 'debugFastObjects': DEBUG_FAST_OBJECTS, |
125 'isTreeShakingDisabled': backend.isTreeShakingDisabled, | 125 'isTreeShakingDisabled': backend.isTreeShakingDisabled, |
126 'precompiled': precompiledAccess, | 126 'precompiled': precompiledAccess, |
127 'finishedClassesAccess': finishedClassesAccess, | 127 'finishedClassesAccess': finishedClassesAccess, |
128 'needsMixinSupport': emitter.needsMixinSupport, | 128 'needsMixinSupport': emitter.needsMixinSupport, |
129 'needsNativeSupport': program.needsNativeSupport, | 129 'needsNativeSupport': program.needsNativeSupport, |
130 'enabledJsInterop': backend.jsInteropAnalysis.enabledJsInterop, | 130 'enabledJsInterop': backend.jsInteropAnalysis.enabledJsInterop, |
131 'jsInteropBoostrap':backend.jsInteropAnalysis.buildJsInteropBootstrap(), | 131 'jsInteropBoostrap':backend.jsInteropAnalysis.buildJsInteropBootstrap(), |
132 'isInterceptorClass': namer.operatorIs(backend.jsInterceptorClass), | 132 'isInterceptorClass': namer.operatorIs(backend.jsInterceptorClass), |
133 'isObject' : namer.operatorIs(compiler.objectClass), | 133 'isObject' : namer.operatorIs(compiler.coreClasses.objectClass), |
134 'specProperty': js.string(namer.nativeSpecProperty), | 134 'specProperty': js.string(namer.nativeSpecProperty), |
135 'trivialNsmHandlers': emitter.buildTrivialNsmHandlers(), | 135 'trivialNsmHandlers': emitter.buildTrivialNsmHandlers(), |
136 'hasRetainedMetadata': backend.hasRetainedMetadata, | 136 'hasRetainedMetadata': backend.hasRetainedMetadata, |
137 'types': typesAccess, | 137 'types': typesAccess, |
138 'objectClassName': js.quoteName( | 138 'objectClassName': js.quoteName( |
139 namer.runtimeTypeName(compiler.objectClass)), | 139 namer.runtimeTypeName(compiler.coreClasses.objectClass)), |
140 'needsStructuredMemberInfo': emitter.needsStructuredMemberInfo, | 140 'needsStructuredMemberInfo': emitter.needsStructuredMemberInfo, |
141 'usesMangledNames': | 141 'usesMangledNames': |
142 compiler.mirrorsLibrary != null || compiler.enabledFunctionApply, | 142 compiler.mirrorsLibrary != null || compiler.enabledFunctionApply, |
143 'tearOffCode': buildTearOffCode(backend), | 143 'tearOffCode': buildTearOffCode(backend), |
144 'nativeInfoHandler': nativeInfoHandler, | 144 'nativeInfoHandler': nativeInfoHandler, |
145 'operatorIsPrefix' : js.string(namer.operatorIsPrefix), | 145 'operatorIsPrefix' : js.string(namer.operatorIsPrefix), |
146 'deferredActionString': js.string(namer.deferredAction)}; | 146 'deferredActionString': js.string(namer.deferredAction)}; |
147 String skeleton = ''' | 147 String skeleton = ''' |
148 function $setupProgramName(programData, typesOffset) { | 148 function $setupProgramName(programData, typesOffset) { |
149 "use strict"; | 149 "use strict"; |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 (function() { | 852 (function() { |
853 var result = $array[$index]; | 853 var result = $array[$index]; |
854 if ($check) { | 854 if ($check) { |
855 throw new Error( | 855 throw new Error( |
856 name + ": expected value of type \'$type\' at index " + ($index) + | 856 name + ": expected value of type \'$type\' at index " + ($index) + |
857 " but got " + (typeof result)); | 857 " but got " + (typeof result)); |
858 } | 858 } |
859 return result; | 859 return result; |
860 })()'''; | 860 })()'''; |
861 } | 861 } |
OLD | NEW |