@mathias What do you think of having `function.argumentNames` available in `function` scope? Similar to meta properties proposed here: https://github.com/allenwb/ESideas/blob/master/ES7MetaProps.md … It's a common use-case for debugging and argument assertion.
-
-
This is different than callee/caller/arguments, in that it's only the names of the arguments as strings. For example, with `foo(x, obj.x2)`, the `foo` function wants to know the names of its arguments for use in printing to the user. Use-cases are test-runners, input validators..
-
To achieve this in Node.js now, we have to use the V8 stack trace API, get the filename, line, and column, then read the source file from the filesystem, and then parse out the argument names. This is both slow, fragile, and doesn't work in the browser.https://github.com/sindresorhus/ow/pull/102/files#diff-0f9cc85ad0c5b1f8c52a0ccacf3f357cR13 …
End of conversation
New conversation -
-
-
Arguments were understandably blocked but I miss the heck out of callee & it has no replacement & I have zero idea why it was dropped.
-
callee is an information leak. It is common to pass the arguments object as an argument to other (perhaps untrusted) functions. callee property can give unintended access to the arguments originating function. A “thisfunction” meta property would be a safer solution.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.