Chromium Code Reviews| 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 _js_helper; | 5 library _js_helper; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS, | 8 import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS, |
| 9 JS, | 9 JS, |
| 10 JS_CALL_IN_ISOLATE, | 10 JS_CALL_IN_ISOLATE, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 if (isIntercepted) { | 168 if (isIntercepted) { |
| 169 receiver = interceptor; | 169 receiver = interceptor; |
| 170 if (JS('bool', '# === #', object, interceptor)) { | 170 if (JS('bool', '# === #', object, interceptor)) { |
| 171 interceptor = null; | 171 interceptor = null; |
| 172 } | 172 } |
| 173 } else { | 173 } else { |
| 174 interceptor = null; | 174 interceptor = null; |
| 175 } | 175 } |
| 176 var method = JS('var', '#[#]', receiver, name); | 176 var method = JS('var', '#[#]', receiver, name); |
| 177 if (JS('String', 'typeof #', method) == 'function') { | 177 if (JS('String', 'typeof #', method) == 'function') { |
| 178 if (JS('bool', '#[#] == false', method, JS_GET_NAME("REFLECTABLE"))) { | 178 if (JS('bool', '!#[#]', method, JS_GET_NAME("REFLECTABLE"))) { |
|
ahe
2013/09/02 09:46:49
String reflectableProperty = JS_GET_NAME("REFLECTA
ngeoffray
2013/09/02 09:54:08
That worked. Thanks Peter.
| |
| 179 throwInvalidReflectionError(memberName); | 179 throwInvalidReflectionError(memberName); |
| 180 } | 180 } |
| 181 return new CachedInvocation(method, isIntercepted, interceptor); | 181 return new CachedInvocation(method, isIntercepted, interceptor); |
| 182 } else { | 182 } else { |
| 183 // In this case, receiver doesn't implement name. So we should | 183 // In this case, receiver doesn't implement name. So we should |
| 184 // invoke noSuchMethod instead (which will often throw a | 184 // invoke noSuchMethod instead (which will often throw a |
| 185 // NoSuchMethodError). | 185 // NoSuchMethodError). |
| 186 return new CachedNoSuchMethodInvocation(interceptor); | 186 return new CachedNoSuchMethodInvocation(interceptor); |
| 187 } | 187 } |
| 188 } | 188 } |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 /** | 1949 /** |
| 1950 * Error thrown when a runtime error occurs. | 1950 * Error thrown when a runtime error occurs. |
| 1951 */ | 1951 */ |
| 1952 class RuntimeError extends Error { | 1952 class RuntimeError extends Error { |
| 1953 final message; | 1953 final message; |
| 1954 RuntimeError(this.message); | 1954 RuntimeError(this.message); |
| 1955 String toString() => "RuntimeError: $message"; | 1955 String toString() => "RuntimeError: $message"; |
| 1956 } | 1956 } |
| OLD | NEW |