| 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 library dev_compiler.src.codegen.js_codegen; | 5 library dev_compiler.src.codegen.js_codegen; |
| 6 | 6 |
| 7 import 'dart:collection' show HashSet, HashMap; | 7 import 'dart:collection' show HashSet, HashMap; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; | 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; |
| 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; | 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 return js.call( | 1920 return js.call( |
| 1921 'dart.$dynamicHelper(#, #)', [_visit(target), _visitList(args)]); | 1921 'dart.$dynamicHelper(#, #)', [_visit(target), _visitList(args)]); |
| 1922 } | 1922 } |
| 1923 return js.call('dart.$DSEND(#, #, #)', [ | 1923 return js.call('dart.$DSEND(#, #, #)', [ |
| 1924 _visit(target), | 1924 _visit(target), |
| 1925 memberName, | 1925 memberName, |
| 1926 _visitList(args) | 1926 _visitList(args) |
| 1927 ]); | 1927 ]); |
| 1928 } | 1928 } |
| 1929 | 1929 |
| 1930 if (_isJSBuiltinType(type)) { | |
| 1931 // static call pattern for builtins. | |
| 1932 return js.call('#.#(#, #)', [ | |
| 1933 _emitTypeName(type), | |
| 1934 memberName, | |
| 1935 _visit(target), | |
| 1936 _visitList(args) | |
| 1937 ]); | |
| 1938 } | |
| 1939 // Generic dispatch to a statically known method. | 1930 // Generic dispatch to a statically known method. |
| 1940 return js.call('#.#(#)', [_visit(target), memberName, _visitList(args)]); | 1931 return js.call('#.#(#)', [_visit(target), memberName, _visitList(args)]); |
| 1941 } | 1932 } |
| 1942 | 1933 |
| 1943 @override | 1934 @override |
| 1944 visitIndexExpression(IndexExpression node) { | 1935 visitIndexExpression(IndexExpression node) { |
| 1945 return _emitSend(_getTarget(node), '[]', [node.index]); | 1936 return _emitSend(_getTarget(node), '[]', [node.index]); |
| 1946 } | 1937 } |
| 1947 | 1938 |
| 1948 /// Gets the target of a [PropertyAccess] or [IndexExpression]. | 1939 /// Gets the target of a [PropertyAccess] or [IndexExpression]. |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2475 | 2466 |
| 2476 /// A special kind of element created by the compiler, signifying a temporary | 2467 /// A special kind of element created by the compiler, signifying a temporary |
| 2477 /// variable. These objects use instance equality, and should be shared | 2468 /// variable. These objects use instance equality, and should be shared |
| 2478 /// everywhere in the tree where they are treated as the same variable. | 2469 /// everywhere in the tree where they are treated as the same variable. |
| 2479 class TemporaryVariableElement extends LocalVariableElementImpl { | 2470 class TemporaryVariableElement extends LocalVariableElementImpl { |
| 2480 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); | 2471 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); |
| 2481 | 2472 |
| 2482 int get hashCode => identityHashCode(this); | 2473 int get hashCode => identityHashCode(this); |
| 2483 bool operator ==(Object other) => identical(this, other); | 2474 bool operator ==(Object other) => identical(this, other); |
| 2484 } | 2475 } |
| OLD | NEW |