| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** | 5 /** |
| 6 * Helpers for lazy static initialization. | 6 * Helpers for lazy static initialization. |
| 7 */ | 7 */ |
| 8 var static$uninitialized = {}; | 8 var static$uninitialized = {}; |
| 9 var static$initializing = {}; | 9 var static$initializing = {}; |
| 10 | 10 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 295 } |
| 296 | 296 |
| 297 | 297 |
| 298 /** | 298 /** |
| 299 * These operators need to work correctly with undefined | 299 * These operators need to work correctly with undefined |
| 300 * so must be functions. | 300 * so must be functions. |
| 301 */ | 301 */ |
| 302 function EQ$operator(val1, val2) { | 302 function EQ$operator(val1, val2) { |
| 303 if (val1 === $Dart$Null) { | 303 if (val1 === $Dart$Null) { |
| 304 return val2 === $Dart$Null; | 304 return val2 === $Dart$Null; |
| 305 } else { | 305 } else if (typeof(val1) == typeof(val2) && typeof val1 != 'object') { |
| 306 return (typeof(val1) == 'number' && typeof(val2) == 'number') | 306 // number, boolean, string |
| 307 ? val1 == val2 | 307 return val1 === val2; |
| 308 : val1.EQ$operator(val2); | 308 } |
| 309 } | 309 return val1.EQ$operator(val2); |
| 310 } | 310 } |
| 311 | 311 |
| 312 function NE$operator(val1, val2) { | 312 function NE$operator(val1, val2) { |
| 313 return !EQ$operator(val1, val2); | 313 return !EQ$operator(val1, val2); |
| 314 } | 314 } |
| 315 | 315 |
| 316 // The following operator-functions are not called from Dart-generated code, but | 316 // The following operator-functions are not called from Dart-generated code, but |
| 317 // only from handwritten JS code. | 317 // only from handwritten JS code. |
| 318 function INDEX$operator(obj, index) { | 318 function INDEX$operator(obj, index) { |
| 319 return obj.INDEX$operator(index); | 319 return obj.INDEX$operator(index); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 return match; | 463 return match; |
| 464 } | 464 } |
| 465 o.$dartConstId = id; | 465 o.$dartConstId = id; |
| 466 $consts[key] = o; | 466 $consts[key] = o; |
| 467 return o; | 467 return o; |
| 468 } | 468 } |
| 469 | 469 |
| 470 function $Dart$MapLiteralFactory() { | 470 function $Dart$MapLiteralFactory() { |
| 471 return native__CoreJsUtil__newMapLiteral(); | 471 return native__CoreJsUtil__newMapLiteral(); |
| 472 } | 472 } |
| OLD | NEW |