Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] babel's "loose mode" class transform enbrittles BufferList #428

Merged
merged 1 commit into from Feb 13, 2020

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Feb 13, 2020

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.

```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.
@ljharb ljharb requested a review from mcollina February 13, 2020 03:47
@ljharb
Copy link
Member Author

ljharb commented Feb 13, 2020

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.

@mcollina
Copy link
Member

We support IE11 in readable-stream v3, while we still support pre-es5 environments in v2. This can land but not be backported.

@mcollina
Copy link
Member

mcollina commented Feb 13, 2020

Can you also regenerate the code?

cd build
node build.js v10.19.0

@ljharb
Copy link
Member Author

ljharb commented Feb 13, 2020

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

.babelrc Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Member

cc @vweevers what do you think?

@vweevers
Copy link
Contributor

👍

@mcollina mcollina merged commit 3bbf2d6 into master Feb 13, 2020
@mcollina mcollina deleted the ljharb-babel-spec-mode branch February 13, 2020 19:37
@ljharb
Copy link
Member Author

ljharb commented Feb 13, 2020

yay! what are the next steps to get this into core?

@mcollina
Copy link
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.

@ljharb
Copy link
Member Author

ljharb commented Mar 18, 2020

done in npm/cli#824 and nodejs/node#31977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants