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

An issue about Object.prototype.isPrototypeOf #656

Closed
YiWen-y opened this issue Apr 4, 2020 · 2 comments
Closed

An issue about Object.prototype.isPrototypeOf #656

YiWen-y opened this issue Apr 4, 2020 · 2 comments

Comments

@YiWen-y
Copy link

YiWen-y commented Apr 4, 2020

Revision

rhino-1.7.11

Test case
var f = function (){
    print(typeof Object.prototype.isPrototypeOf);
    var a = Object.prototype.isPrototypeOf.call(undefined, []);
    print("a:", a);
};
f();
Execution steps
java -jar rhino-1.7.11.jar -debug -version 200 testcase.js
Output
function
a: false
Expected behavior

Throw a Type Error in line 3.

Description

According to ES standard, the this value should be converted via ToObject in case of the isPrototypeOf call . The ToObject should throw and error for undefined values.

@rbri
Copy link
Collaborator

rbri commented May 19, 2020

Have added a pull request but i can't reproduce your finding. What is wrong with the test?

gbrail pushed a commit that referenced this issue May 19, 2020
@rbri
Copy link
Collaborator

rbri commented May 20, 2020

This is fixed now. Please close.

@YiWen-y YiWen-y closed this as completed May 25, 2020
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