Use Object.setPrototypeOf as __proto__ could potentially be disabled (#387)
This commit is contained in:
parent
797461ee32
commit
63469d30e4
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue