You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File polyfill: drop JS_PROTOTYPE_CHAIN_SHIM workaround now that BabylonJS#177 landed
BabylonJS#177 fixed the JSC napi shim's Object.prototype pollution by passing the
per-class JSClassRef to JSObjectMakeConstructor, so napi-defined classes
now get a real per-class .prototype object instead of aliasing the global
Object.prototype.
That removes the entire reason for the JS_PROTOTYPE_CHAIN_SHIM and the
Napi::Eval / try/catch dance: we can wire File.prototype's [[Prototype]]
to Blob.prototype with a direct Object.setPrototypeOf call. Drops ~50
lines of explanatory comment + shim + Eval-with-IsExceptionPending guard
in File::Initialize down to a 4-line napi call.
`file instanceof Blob` regression coverage remains in tests.ts:1564 and
BabylonJS#177's `describe("napi class prototype isolation (BabylonJS#172)")` block at
tests.ts:1271 (uses Blob — and File extends Blob — to assert that
napi-defined classes don't share Object.prototype). Local Chakra build
clean.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments