Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 14049034: Revert "Revert "Fix x.runtimeType for native classes"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 6dcad8db1106a21deb79de2dfaece4baf2e7f6e4..7feb253ee3c6375dd5dbdd799c38e770855572b9 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -959,6 +959,7 @@ class JavaScriptBackend extends Backend {
void validateInterceptorImplementsAllObjectMethods(
ClassElement interceptorClass) {
if (interceptorClass == null) return;
+ interceptorClass.ensureResolved(compiler);
compiler.objectClass.forEachMember((_, Element member) {
if (member.isGenerativeConstructor()) return;
Element interceptorMember = interceptorClass.lookupMember(member.name);
@@ -978,6 +979,7 @@ class JavaScriptBackend extends Backend {
Set<Element> set = interceptedElements.putIfAbsent(
member.name, () => new Set<Element>());
set.add(member);
+ if (classElement == jsInterceptorClass) return;
if (!classElement.isNative()) {
MixinApplicationElement mixinApplication = classElement;
assert(member.getEnclosingClass() == mixinApplication.mixin);
@@ -1367,6 +1369,11 @@ class JavaScriptBackend extends Backend {
return new native.NativeCodegenEnqueuer(world, compiler, emitter);
}
+ ClassElement defaultSuperclass(ClassElement element) {
+ // Native classes inherit from Interceptor.
+ return element.isNative() ? jsInterceptorClass : compiler.objectClass;
+ }
+
/**
* Unit test hook that returns code of an element as a String.
*
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/compiler.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698