Skip to content

Commit

Permalink
fix: inject new.target replacement to work around swc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Oct 23, 2020
1 parent 6694e09 commit eeeffe7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions file-content-injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const fs = require("fs");
file: "node_modules/@wessberg/connection-observer/dist/index.js",
match: String.raw`if (new.target === undefined) {`,
replacement: String.raw`if ((this instanceof ConnectionObserver ? this.constructor : void 0) === undefined) {`
},
{
file: "/Users/wessberg/coding/polyfiller/node_modules/@polyfiller/object-fit/polyfill/index.js",
match: String.raw`if (new.target === undefined) {`,
replacement: String.raw`if ((this instanceof ComputedStyleObserver ? this.constructor : void 0) === undefined) {`
}
].forEach(replace);

Expand Down

0 comments on commit eeeffe7

Please sign in to comment.