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

In assignments, property keys should be evaluated only after checking the object is not null #1600

Open
andreabergia opened this issue Aug 30, 2024 · 0 comments
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec

Comments

@andreabergia
Copy link
Contributor

This should throw a TypeError because we are accessing null, but instead it is throwing a MyError:

function MyError() {}
MyError.prototype.toString = () => 'MyError';

var base = null;
var prop = {
    toString: function() {
        throw new MyError();
    }
  };
 
base[prop] = 42;
@p-bakker p-bakker added Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec bug Issues considered a bug labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec
Projects
None yet
Development

No branches or pull requests

2 participants