-
Type:
Enhancement
-
Resolution: Duplicate
-
Priority:
P3
-
None
-
Affects Version/s: 9
-
Component/s: core-libs
-
None
-
generic
-
generic
The pattern A extends B is commonly (would say 70% of usage) implemented in the following way:
A.prototype.__proto__ = B.prototype;
As we know, in nashorn this has no effect.
We are rewriting it as (using node 'util' module) : require("util").inherits(A, B);
We are also restructuring some code to only create instance after the prototype has been fully defined.
This imply a lot of patching.
Having an option to enable writable proto would help run existing scripts unmodified.
A.prototype.__proto__ = B.prototype;
As we know, in nashorn this has no effect.
We are rewriting it as (using node 'util' module) : require("util").inherits(A, B);
We are also restructuring some code to only create instance after the prototype has been fully defined.
This imply a lot of patching.
Having an option to enable writable proto would help run existing scripts unmodified.
- duplicates
-
JDK-8023368 Instance __proto__ property should exist and be writable.
-
- Resolved
-