Skip to content

Commit

Permalink
Use Object.setPrototypeOf as __proto__ could potentially be disab…
Browse files Browse the repository at this point in the history
…led (#387)
  • Loading branch information
bmeck committed Apr 2, 2020
1 parent 797461e commit 63469d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/index.js
Expand Up @@ -139,9 +139,9 @@ const createBuilder = (self, _styler, _isEmpty) => {
return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
};

// `__proto__` is used because we must return a function, but there is
// We alter the prototype because we must return a function, but there is
// no way to create a function with a different prototype
builder.__proto__ = proto; // eslint-disable-line no-proto
Object.setPrototypeOf(builder, proto);

builder._generator = self;
builder._styler = _styler;
Expand Down

0 comments on commit 63469d3

Please sign in to comment.