dillon1000/react
Commit
Browse files [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]>
Changed paths3 files
First-parent comparisonpackages/react-client/src/ReactFlightClient.js ModifiedA packages/react-server-dom-webpack/src/__tests__/ReactFlightNonWritablePromiseThen-test.js AddedM packages/react-server/src/ReactFlightReplyServer.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…