-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: methods cannot be used as constructor
The spec says that invoking a method as a constructor is not valid, but invoking normal functions is. This is, for example, `node`: ```js > o = { method() {}, notAMethod: function() {} } { method: [Function: method], notAMethod: [Function: notAMethod] } > new o.method() Uncaught TypeError: o.method is not a constructor > new o.notAMethod() notAMethod {} ``` This PR implements the same behavior in Rhino, and fixes #1299.
- Loading branch information
1 parent
a65afb3
commit b462d96
Showing
4 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters