Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26359

Make the SpiderMonkey integration more complete regarding JS_GetPrivate

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible

      Description

      We currently require bare calls to JS_GetPrivate wherever we want to dig our "special" member out of any given type. Given that we don't actually store heterogeneous types in any particular object type, we should plumb this work down into the functions we care about make it a lot harder to screw up (calling get private on the wrong object type, calling it on an invalid object, a prototype, etc).

      Some useful work:

      • Tag a private type into the Info classes if private info is used
      • Auto-generate getPrivate() off of the wraptype's that corresponds
      • shim finalizers to take the private pointer directly if private data is there
      • possibly shim all functions to take the param (plenty of classes have a helper which calls getPrivate at the top of every method, maybe we should just give it to them).
      • possibly don't call the user finalizer on prototypes
      • Make the underlying wrapper which calls get_private run checks that:
        • we have an object
        • it has the right type
        • it isn't a prototype
        • throw if things are wrong

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: