Skip to content

Commit 9d566bf

Browse files
committed
Use Object.create() instead of our own polyfill
1 parent 7b221c1 commit 9d566bf

File tree

1 file changed

+1
-7
lines changed
  • dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang

1 file changed

+1
-7
lines changed

dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Runtime.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ public static native void defineClass(JavaScriptObject typeId,
7777
}
7878
}-*/;
7979

80-
private static native JavaScriptObject portableObjCreate(JavaScriptObject obj) /*-{
81-
function F() {};
82-
F.prototype = obj || {};
83-
return new F();
84-
}-*/;
85-
8680
/**
8781
* Create a subclass prototype.
8882
*/
@@ -93,7 +87,7 @@ private static native JavaScriptObject createSubclassPrototype(
9387
// If it is not a prototype, then it should be a type id.
9488
superPrototype = @Runtime::prototypesByTypeId[superTypeIdOrPrototype];
9589
}
96-
return @Runtime::portableObjCreate(*)(superPrototype);
90+
return Object.create(superPrototype);
9791
}-*/;
9892

9993
public static native void copyObjectProperties(JavaScriptObject from, JavaScriptObject to) /*-{

0 commit comments

Comments
 (0)