[Fix] babel's "loose mode" class transform enbrittles BufferList#428
Merged
[Fix] babel's "loose mode" class transform enbrittles BufferList#428
Conversation
```js
Object.defineProperty(Object.prototype, util.inspect.custom, {
set(v) { throw 'this should not happen inside readable-stream'; }
});
```
With this change, I believe the output will use [[Define]] instead of [[Set]] for https://github.com/nodejs/node/blob/c101251a95cc82142bee4637f8db6cc360a06d82/lib/internal/streams/buffer_list.js#L167, and thus no longer fail when Object.prototype is modified.
Member
Author
|
Seems like vweevers@432d4b7 is when it first was put into loose mode, in #299, due to #293. Does readable-stream still support pre-ES5 environments? #344 implies that it does not. |
Member
|
We support IE11 in readable-stream v3, while we still support pre-es5 environments in v2. This can land but not be backported. |
Member
|
Can you also regenerate the code? |
Member
Author
|
just v3 is fine; I’m mainly concerned with the version of this that’s vendored in core; that one doesn’t need to run Babel at all :-) will update the build shortly |
744c5d2 to
186503e
Compare
ljharb
commented
Feb 13, 2020
mcollina
reviewed
Feb 13, 2020
Member
|
cc @vweevers what do you think? |
Contributor
|
👍 |
Member
Author
|
yay! what are the next steps to get this into core? |
Member
|
I think you'll have to wait for npm to do a release, and then update core to that. Or you can force a replacement directly. |
Member
Author
|
done in npm/cli#824 and nodejs/node#31977 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this change, I believe the output will use [[Define]] instead of [[Set]] for https://github.com/nodejs/node/blob/c101251a95cc82142bee4637f8db6cc360a06d82/lib/internal/streams/buffer_list.js#L167, and thus no longer fail when Object.prototype is modified.