| 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 import 'dart:_js_primitives' show printString; | 5 import 'dart:_js_primitives' show printString; |
| 6 import 'dart:_js_helper' show patch; | 6 import 'dart:_js_helper' show patch; |
| 7 import 'dart:_interceptors' show JSArray; | 7 import 'dart:_interceptors' show JSArray; |
| 8 import 'dart:_foreign_helper' show JS; | 8 import 'dart:_foreign_helper' show JS; |
| 9 | 9 |
| 10 @patch | 10 @patch |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const PrivateSymbol(this._name, this._nativeSymbol); | 36 const PrivateSymbol(this._name, this._nativeSymbol); |
| 37 | 37 |
| 38 static String getName(core.Symbol symbol) => (symbol as PrivateSymbol)._name; | 38 static String getName(core.Symbol symbol) => (symbol as PrivateSymbol)._name; |
| 39 | 39 |
| 40 static Object getNativeSymbol(core.Symbol symbol) { | 40 static Object getNativeSymbol(core.Symbol symbol) { |
| 41 if (symbol is PrivateSymbol) return symbol._nativeSymbol; | 41 if (symbol is PrivateSymbol) return symbol._nativeSymbol; |
| 42 return null; | 42 return null; |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool operator ==(other) => | 45 bool operator ==(other) => |
| 46 other is PrivateSymbol && identical(_nativeSymbol, other._nativeSymbol); | 46 other is PrivateSymbol && |
| 47 _name == other._name && |
| 48 identical(_nativeSymbol, other._nativeSymbol); |
| 49 |
| 50 get hashCode => _nativeSymbol.hashCode; |
| 47 | 51 |
| 48 // TODO(jmesserly): is this equivalent to _nativeSymbol toString? | 52 // TODO(jmesserly): is this equivalent to _nativeSymbol toString? |
| 49 toString() => 'Symbol("$_name")'; | 53 toString() => 'Symbol("$_name")'; |
| 50 } | 54 } |
| 51 | 55 |
| 52 @patch | 56 @patch |
| 53 void printToConsole(String line) { | 57 void printToConsole(String line) { |
| 54 printString('$line'); | 58 printString('$line'); |
| 55 } | 59 } |
| 56 | 60 |
| 57 @patch | 61 @patch |
| 58 List/*<E>*/ makeListFixedLength/*<E>*/(List/*<E>*/ growableList) { | 62 List/*<E>*/ makeListFixedLength/*<E>*/(List/*<E>*/ growableList) { |
| 59 JSArray.markFixedList(growableList); | 63 JSArray.markFixedList(growableList); |
| 60 return growableList; | 64 return growableList; |
| 61 } | 65 } |
| 62 | 66 |
| 63 @patch | 67 @patch |
| 64 List/*<E>*/ makeFixedListUnmodifiable/*<E>*/(List/*<E>*/ fixedLengthList) { | 68 List/*<E>*/ makeFixedListUnmodifiable/*<E>*/(List/*<E>*/ fixedLengthList) { |
| 65 JSArray.markUnmodifiableList(fixedLengthList); | 69 JSArray.markUnmodifiableList(fixedLengthList); |
| 66 return fixedLengthList; | 70 return fixedLengthList; |
| 67 } | 71 } |
| OLD | NEW |