| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Analysis to determine how to generate code for typed JavaScript interop. | 5 /// Analysis to determine how to generate code for typed JavaScript interop. |
| 6 library compiler.src.js_backend.js_interop_analysis; | 6 library compiler.src.js_backend.js_interop_analysis; |
| 7 | 7 |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../constants/values.dart' | 9 import '../constants/values.dart' |
| 10 show ConstantValue, ConstructedConstantValue, StringConstantValue; | 10 show ConstantValue, ConstructedConstantValue, StringConstantValue; |
| 11 import '../elements/resolution_types.dart' | 11 import '../elements/resolution_types.dart' |
| 12 show DartType, DynamicType, FunctionType; | 12 show ResolutionDartType, ResolutionDynamicType, ResolutionFunctionType; |
| 13 import '../diagnostics/messages.dart' show MessageKind; | 13 import '../diagnostics/messages.dart' show MessageKind; |
| 14 import '../elements/elements.dart' | 14 import '../elements/elements.dart' |
| 15 show | 15 show |
| 16 ClassElement, | 16 ClassElement, |
| 17 Element, | 17 Element, |
| 18 FieldElement, | 18 FieldElement, |
| 19 FunctionElement, | 19 FunctionElement, |
| 20 LibraryElement, | 20 LibraryElement, |
| 21 ParameterElement, | 21 ParameterElement, |
| 22 MetadataAnnotation; | 22 MetadataAnnotation; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 var name = backend.namer.invocationName(selector); | 181 var name = backend.namer.invocationName(selector); |
| 182 statements.add(js.statement( | 182 statements.add(js.statement( |
| 183 'Function.prototype.# = function(#) { return this(#) }', | 183 'Function.prototype.# = function(#) { return this(#) }', |
| 184 [name, parameters, parameters])); | 184 [name, parameters, parameters])); |
| 185 } | 185 } |
| 186 }); | 186 }); |
| 187 }); | 187 }); |
| 188 return new jsAst.Block(statements); | 188 return new jsAst.Block(statements); |
| 189 } | 189 } |
| 190 | 190 |
| 191 FunctionType buildJsFunctionType() { | 191 ResolutionFunctionType buildJsFunctionType() { |
| 192 // TODO(jacobr): consider using codegenWorld.isChecks to determine the | 192 // TODO(jacobr): consider using codegenWorld.isChecks to determine the |
| 193 // range of positional arguments that need to be supported by JavaScript | 193 // range of positional arguments that need to be supported by JavaScript |
| 194 // function types. | 194 // function types. |
| 195 return new FunctionType.synthesized(const DynamicType(), [], | 195 return new ResolutionFunctionType.synthesized( |
| 196 new List<DartType>.filled(16, const DynamicType())); | 196 const ResolutionDynamicType(), |
| 197 [], |
| 198 new List<ResolutionDartType>.filled(16, const ResolutionDynamicType())); |
| 197 } | 199 } |
| 198 } | 200 } |
| OLD | NEW |