-
-
Notifications
You must be signed in to change notification settings - Fork 123
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
11.0.4
Link to runnable example
No response
Steps to reproduce
The CallableInstance class is using Object.defineProperty
without checking descriptor.configurable
. When we used unified in a android mobile environment, we saw some differences in how the Processor class was being constructed that caused an error.
The difference we saw was if the javascript is transformed to target ES5 (ECMAScript 5.0), the Processor's copy
method had a different number of property names defined than in ES6. Some of these properties are configurable: false
, so calling Object.defineProperty
on them throws a "Cannot redefine property: arguments" error.
Notice in ES6, the number of property names is simply ['length', 'name']
, but in ES5 it includes additional property names that are not configurable. I believe simply checking configurable
would solve this issue.
Expected behavior
Should be able to call unified()
without error.
Actual behavior
Calling unified()
throws an error "Cannot redefine property: arguments" during the super('copy')
within the Processor's constructor.
Affected runtime and version
Affected package manager and version
Affected OS and version
No response
Build and bundle tools
No response