An option for writable prototype would greatly help making existing scripts to run on top of nashorn

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      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.

            Assignee:
            Jim Laskey
            Reporter:
            Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: