Java Code Examples for jdk.nashorn.internal.runtime.ScriptObject#setPrototypeOf()
The following examples show how to use
jdk.nashorn.internal.runtime.ScriptObject#setPrototypeOf() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NativeObject.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 2
Source File: NativeObject.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 3
Source File: NativeObject.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 4
Source File: NativeObject.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 5
Source File: NativeObject.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 6
Source File: NativeObject.java From hottub with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }
Example 7
Source File: NativeObject.java From jdk8u_nashorn with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") private static Object set__proto__(final Object self, final Object proto) { // See ES6 draft spec: B.2.2.1.2 set Object.prototype.__proto__ // Step 1 Global.checkObjectCoercible(self); // Step 4 if (! (self instanceof ScriptObject)) { return UNDEFINED; } final ScriptObject sobj = (ScriptObject)self; // __proto__ assignment ignores non-nulls and non-objects // step 3: If Type(proto) is neither Object nor Null, then return undefined. if (proto == null || proto instanceof ScriptObject) { sobj.setPrototypeOf(proto); } return UNDEFINED; }