Skip to content

An issue about Object.prototype.isPrototypeOf #656

@YiWen-y

Description

@YiWen-y
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions