Skip to content

Proxy test in getPrototypeOf fails on macOS #410

@nickva

Description

@nickva

When trying to run test262 tests in CI noticed this test was failing on macOS (Intel, Sonoma) but passing on Linux and Cosmopolitan.

On macOS

% make test2
time ./run-test262 -t -m -c test262.conf -a
test262/test/staging/sm/Proxy/getPrototypeOf.js:255: unexpected error: TypeError: proxy: inconsistent prototype
64/79180/6856

A smaller example:

tmp.js

rval = Object.prototype;
p = new Proxy({}, {getPrototypeOf() {return rval;} });

act1 = () => print("called: act1");
act2 = () => print("called: act2");

var targetProto;
var targetWithProto = new Proxy(Object.preventExtensions(Object.create(null)), {getPrototypeOf() {act2(); return targetProto;}});
p = new Proxy(targetWithProto, { getPrototypeOf() { act1(); return rval; } });

rval = null;
targetProto = null;

p_proto = Object.getPrototypeOf(p);
print("Object.getPrototypeOf(p): ", p_proto);

On macOS

% ./qjs tmp.js
called: act1
called: act2
TypeError: proxy: inconsistent prototype
    at getPrototypeOf (native)
    at <eval> (.../tmp.js:14:32)

On Linux

$ ./qjs tmp.js
called: act1
called: act2
Object.getPrototypeOf(p):  null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions