Skip to content

Commit

Permalink
[Fix] babel's "loose mode" class transform enbrittles BufferList
Browse files Browse the repository at this point in the history
```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.
  • Loading branch information
ljharb committed Feb 13, 2020
1 parent 7783afa commit 744c5d2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .babelrc
Expand Up @@ -13,11 +13,5 @@
],
"debug": true
}]
],
"plugins": [
// Included in the preset, but we can't specify per-plugin options there
["@babel/plugin-transform-classes", {
"loose": true
}]
]
}

0 comments on commit 744c5d2

Please sign in to comment.