You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no native API in the current version of ECMAScript (ECMAScript 2020) for accessing function parameters. There is only someFunction.length which is also imperfect. The alternative is to parse the string representation of the function. A regular expression is no longer sufficient though due to the new patterns and default values allowed in method declarations. Example:
Sadly there is no native parser in the language either. The closest is the SpiderMonkey specific extension Reflect.parse(...) which is not currently on the standards track. The 3rd party option is the acorn library. This would effectively double the size of the contracts library or more if used...
Extending the Babel or TypeScript compiler is out of scope as the desire is to keep this library standards compliant and not extend the language itself
This should be a deferred requirement...
The text was updated successfully, but these errors were encountered:
There is no native API in the current version of ECMAScript (ECMAScript 2020) for accessing function parameters. There is only
someFunction.length
which is also imperfect. The alternative is to parse the string representation of the function. A regular expression is no longer sufficient though due to the new patterns and default values allowed in method declarations. Example:Sadly there is no native parser in the language either. The closest is the SpiderMonkey specific extension
Reflect.parse(...)
which is not currently on the standards track. The 3rd party option is the acorn library. This would effectively double the size of the contracts library or more if used...Extending the Babel or TypeScript compiler is out of scope as the desire is to keep this library standards compliant and not extend the language itself
This should be a deferred requirement...
The text was updated successfully, but these errors were encountered: