[BUGFIX] checking whether value key is in descriptor instead of checking if value is truthy since !!0 === false
class Foo {
static bar = 0;
}
Foo.bar++;
// Cannot assign to read only property 'bar' of function
This commit is contained in:
parent
4bd19da3c2
commit
d9cbce1862
@ -4,7 +4,7 @@
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if (descriptor.value) descriptor.writable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user