dillon1000/react

Commit

[Flight] Define Flight chunk `.then` with `Object.defineProperty` (#37109)

[Secure Ecmascript](https://github.com/tc39/proposal-ses) would freeze
the prototype of intrinsics. Since `ReactPromise` inherits the prototype
from `Promise`, it also copies over the writable definition.

Using `defineProperty` on an inherited property is compatible with SES
though. That's also closer to how classes are specced in JS.


---------

Co-authored-by: Claude Fable 5 <[email protected]>
Browse files
Changed paths3 files
First-parent comparison
M packages/react-client/src/ReactFlightClient.js ModifiedA packages/react-server-dom-webpack/src/__tests__/ReactFlightNonWritablePromiseThen-test.js AddedM packages/react-server/src/ReactFlightReplyServer.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…