Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion javascript/extractor/src/com/semmle/jcorn/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,9 @@ protected void parsePropertyValue(PropertyInfo pi) {
&& pi.key instanceof Identifier
&& (((Identifier) pi.key).getName().equals("get")
|| ((Identifier) pi.key).getName().equals("set"))
&& (this.type != TokenType.comma && this.type != TokenType.braceR)) {
&& (this.type != TokenType.comma
&& this.type != TokenType.braceR
&& this.type != TokenType.eq)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asgerf :til:! I haven't done this for previous JS extractor fixes. Is this something I should fixup for this PR and start doing going forward?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. TRAP caching has been superseded by overlay support.

if (pi.isGenerator || pi.isAsync || pi.isPattern) this.unexpected();
pi.kind = ((Identifier) pi.key).getName();
PropertyInfo pi2 = new PropertyInfo(false, false, this.startLoc);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
({x = 1}) => x;
({x = 1}) => x;

const example = ({ set = {}, unset = [] }, replacements) => {
return { set, unset };
};
({ get = {}, set = [] }) => ({ get, set });
async ({ get = 1, set = 2 } = {}) => ({ get, set });

let get, set;
({ get = 1, set = 2 } = {});
function defaults({ get = 1, set = 2 }) {
return { get, set };
}

({
get value() { return get; },
set value(v) { set = v; },
get,
set
});
({ get() {}, set(value) {} });
Loading
Loading