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 · 2 comments
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec
Milestone

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
@p-bakker p-bakker added this to the Release 1.7.16 milestone Oct 3, 2024
@gbrail
Copy link
Collaborator

gbrail commented Dec 23, 2024

This seems like a fairly fundamental thing to fix and I doubt that it'll get changed in time for our next release Does anyone else have a view to a solution here? I'd like to close out a new release in the next few days.

@andreabergia
Copy link
Contributor Author

I have some ideas, but this requires checking the spec carefully (and probably what other engines do). But I definitely won't get to work on this in the next couple of weeks.

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

3 participants