| 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 library dart._js_mirrors; | 5 library dart._js_mirrors; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection' show UnmodifiableListView; | 8 import 'dart:collection' show UnmodifiableListView; |
| 9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
| 10 | 10 |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 int type, | 498 int type, |
| 499 String reflectiveName, | 499 String reflectiveName, |
| 500 List arguments) { | 500 List arguments) { |
| 501 String cacheName = Primitives.mirrorInvokeCacheName; | 501 String cacheName = Primitives.mirrorInvokeCacheName; |
| 502 var cache = JS('', r'#.constructor[#]', reflectee, cacheName); | 502 var cache = JS('', r'#.constructor[#]', reflectee, cacheName); |
| 503 if (cache == null) { | 503 if (cache == null) { |
| 504 cache = JsCache.allocate(); | 504 cache = JsCache.allocate(); |
| 505 JS('void', r'#.constructor[#] = #', reflectee, cacheName, cache); | 505 JS('void', r'#.constructor[#] = #', reflectee, cacheName, cache); |
| 506 } | 506 } |
| 507 var cacheEntry = JsCache.fetch(cache, reflectiveName); | 507 var cacheEntry = JsCache.fetch(cache, reflectiveName); |
| 508 cacheEntry = null; // Work around bug in caching. | |
| 509 var result; | 508 var result; |
| 510 Invocation invocation; | 509 Invocation invocation; |
| 511 if (cacheEntry == null) { | 510 if (cacheEntry == null) { |
| 512 disableTreeShaking(); | 511 disableTreeShaking(); |
| 513 String mangledName = reflectiveNames[reflectiveName]; | 512 String mangledName = reflectiveNames[reflectiveName]; |
| 514 // TODO(ahe): Get the argument names. | 513 // TODO(ahe): Get the argument names. |
| 515 List<String> argumentNames = []; | 514 List<String> argumentNames = []; |
| 516 // TODO(ahe): We don't need to create an invocation mirror here. The | 515 // TODO(ahe): We don't need to create an invocation mirror here. The |
| 517 // logic from JSInvocationMirror.getCachedInvocation could easily be | 516 // logic from JSInvocationMirror.getCachedInvocation could easily be |
| 518 // inlined here. | 517 // inlined here. |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 void operator []=(K key, V value) => _throw(); | 1352 void operator []=(K key, V value) => _throw(); |
| 1354 | 1353 |
| 1355 V putIfAbsent(K key, V ifAbsent()) { _throw(); } | 1354 V putIfAbsent(K key, V ifAbsent()) { _throw(); } |
| 1356 | 1355 |
| 1357 void addAll(Map<K, V> other) => _throw(); | 1356 void addAll(Map<K, V> other) => _throw(); |
| 1358 | 1357 |
| 1359 V remove(K key) { _throw(); } | 1358 V remove(K key) { _throw(); } |
| 1360 | 1359 |
| 1361 void clear() => _throw(); | 1360 void clear() => _throw(); |
| 1362 } | 1361 } |
| OLD | NEW |