Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.seal() behavior is not correct #174

Closed
RuralHunter opened this issue May 19, 2020 · 4 comments
Closed

Object.seal() behavior is not correct #174

RuralHunter opened this issue May 19, 2020 · 4 comments

Comments

@RuralHunter
Copy link
Contributor

RuralHunter commented May 19, 2020

This should be a rhino problem.
According to the specification, the values of present properties of a sealed object can be changed as long as they are writable. The code below runs correctly in real browsers but fails in htmlunit with net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot add properties to this object because extensible is false.

fun=function() 
{
    "use strict";
    var r = {};
    Object.defineProperties(r, {
        a: {
            writable: true,
            value: 'aaa'
        }
    });
    r.a='abefore';
    alert('r.a before='+r.a);
    Object.seal(r);
    r.a='aafter';
    alert('r.a after='+r.a);
};
fun();
@rbri
Copy link
Member

rbri commented May 19, 2020 via email

@RuralHunter
Copy link
Contributor Author

RuralHunter commented May 20, 2020

yes sure: mozilla/rhino#676

@rbri
Copy link
Member

rbri commented May 24, 2020

Made a PR for rhino, as soon as this is merged i will update our core-js snapshot.

@rbri
Copy link
Member

rbri commented May 28, 2020

fixed with the lastes core-js snapshot build

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

No branches or pull requests

2 participants