Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Intrinsics on the prototype chain aren't serialized correctly #405

Closed
sebmarkbage opened this issue Apr 14, 2017 · 3 comments
Closed

Intrinsics on the prototype chain aren't serialized correctly #405

sebmarkbage opened this issue Apr 14, 2017 · 3 comments

Comments

@sebmarkbage
Copy link
Contributor

arr = Object.create(Array.prototype);

incorrectly turns into:

arr = {};

This seems to happen with any form including:

num = new Number(123);
@hermanventer
Copy link
Contributor

I've created fixes for the two specific examples above. More fixes are needed to fix the entire class of related issues.

@NTillmann NTillmann added the bug label Apr 21, 2017
@NTillmann
Copy link
Contributor

NTillmann commented Apr 26, 2017

There are really two different things to consider here:

  1. Creation of objects with internal slots. We are tracking that issue Serialization of objects with internal slots #416.
  2. Objects (which might or might not have corresponding internal slots) with an intrinsic prototype.

Here's a test case that shows how we fail to do 2) properly:

(function() {
    var x = {}
    x.__proto__ = Number.prototype;
    inspect = function() { return x.__proto__.constructor.name; }
})();

@NTillmann
Copy link
Contributor

The general issue has been cleaned up by the referenced pull requests, and error messages are emitted for any unsupported object kinds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants