| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 class InterceptorStubGenerator { | 7 class InterceptorStubGenerator { |
| 8 final Compiler compiler; | 8 final Compiler compiler; |
| 9 final Namer namer; | 9 final Namer namer; |
| 10 final JavaScriptBackend backend; | 10 final JavaScriptBackend backend; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // The set of classes includes classes mixed-in to interceptor classes | 72 // The set of classes includes classes mixed-in to interceptor classes |
| 73 // and user extensions of native classes. | 73 // and user extensions of native classes. |
| 74 // | 74 // |
| 75 // The set of classes also includes the 'primitive' interceptor | 75 // The set of classes also includes the 'primitive' interceptor |
| 76 // PlainJavaScriptObject even when it has not been resolved, since it is | 76 // PlainJavaScriptObject even when it has not been resolved, since it is |
| 77 // only resolved through the reference in getNativeInterceptor when | 77 // only resolved through the reference in getNativeInterceptor when |
| 78 // getNativeInterceptor is marked as used. Guard against probing | 78 // getNativeInterceptor is marked as used. Guard against probing |
| 79 // unresolved PlainJavaScriptObject by testing for anyNativeClasses. | 79 // unresolved PlainJavaScriptObject by testing for anyNativeClasses. |
| 80 | 80 |
| 81 if (anyNativeClasses) { | 81 if (anyNativeClasses) { |
| 82 if (Elements.isNativeOrExtendsNative(cls)) hasNative = true; | 82 if (backend.isNativeOrExtendsNative(cls)) hasNative = true; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 if (hasDouble) { | 86 if (hasDouble) { |
| 87 hasNumber = true; | 87 hasNumber = true; |
| 88 } | 88 } |
| 89 if (hasInt) hasNumber = true; | 89 if (hasInt) hasNumber = true; |
| 90 | 90 |
| 91 if (classes.containsAll(backend.interceptedClasses)) { | 91 if (classes.containsAll(backend.interceptedClasses)) { |
| 92 // I.e. this is the general interceptor. | 92 // I.e. this is the general interceptor. |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 var map = new jsAst.ObjectInitializer(properties); | 368 var map = new jsAst.ObjectInitializer(properties); |
| 369 elements.add(map); | 369 elements.add(map); |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 } | 372 } |
| 373 | 373 |
| 374 return new jsAst.ArrayInitializer(elements); | 374 return new jsAst.ArrayInitializer(elements); |
| 375 } | 375 } |
| 376 } | 376 } |
| OLD | NEW |