| Summary: | Class contructor and methods shouldn't have "arguments" and "caller" | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||||||
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | commit-queue, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, saam | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 140491 | ||||||||||||
| Attachments: |
|
||||||||||||
Same goes for "caller". Created attachment 277849 [details]
Patch
Created attachment 277850 [details]
Patch
Patch for review
Created attachment 277851 [details]
Patch
Small improvement
Created attachment 277854 [details]
Patch
Remove debug code
I think define arguments property should be fixed in separate patch, we already has one https://bugs.webkit.org/show_bug.cgi?id=152985 Comment on attachment 277854 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=277854&action=review > LayoutTests/js/script-tests/class-method-and-constructor-properties.js:55 > + caller() { return 'value'; } How about staric ones? (In reply to comment #7) > Comment on attachment 277854 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=277854&action=review > > > LayoutTests/js/script-tests/class-method-and-constructor-properties.js:55 > > + caller() { return 'value'; } > > How about staric ones? Oh, never mind. Didn't see the comment there Comment on attachment 277854 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=277854&action=review > Source/JavaScriptCore/runtime/JSFunction.cpp:371 > + GetterSetter* errorGetterSetter = thisObject->jsExecutable()->isClassConstructorFunction() || thisObject->jsExecutable()->parseMode() == SourceParseMode::MethodMode Please add a static local helper function instead of duplicating the code. (In reply to comment #9) > Comment on attachment 277854 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=277854&action=review > > > Source/JavaScriptCore/runtime/JSFunction.cpp:371 > > + GetterSetter* errorGetterSetter = thisObject->jsExecutable()->isClassConstructorFunction() || thisObject->jsExecutable()->parseMode() == SourceParseMode::MethodMode > > Please add a static local helper function instead of duplicating the code. Done Committed r 200321: <http://trac.webkit.org/changeset/200321> Closing the bug since the patch was landed in http://trac.webkit.org/changeset/200321. |
Apparently ES6 gutted "arguments" property from class constructors and methods. Authors should also be able to define a property named "arguments"; e.g. class A { static arguments() {} } class B { static get arguments() {} }