Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Comments

Fix: Convert MetaProperty (new.target) nodes correcly (fixes #194)#195

Merged
JamesHenry merged 1 commit intoeslint:masterfrom
soda0289:fix-metaproperty
Mar 18, 2017
Merged

Fix: Convert MetaProperty (new.target) nodes correcly (fixes #194)#195
JamesHenry merged 1 commit intoeslint:masterfrom
soda0289:fix-metaproperty

Conversation

@soda0289
Copy link
Member

The MetaProperty node was added a couple of months ago into typescript. I think it landed in 2.2.
microsoft/TypeScript#12783

I have to create a identifier node for 'new' since it is not part of the typescript metaproperty node.

@eslintbot
Copy link

LGTM

result = tester.getRaw(result);
if (Object.keys(expected).length === 0) {
console.log(JSON.stringify(result, null, 4));
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I got to delete this. Sorry

Copy link
Member

Choose a reason for hiding this comment

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

Just in time 😄 I was just reviewing

@eslintbot
Copy link

LGTM

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

@soda0289 Please could we add the test case from espree for new.target as part of this?

https://github.com/eslint/espree/tree/master/tests/fixtures/ecma-version/6/newTarget

@soda0289
Copy link
Member Author

We have those tests already:
https://github.com/eslint/typescript-eslint-parser/tree/master/tests/fixtures/ecma-features/newTarget

I had to enable the new-target rule by removing it from the filter in tests/lib/ecma-features.js

Typescript does not throw an error you have an invalid metaproperty, such as new.unkown_property. I could add tests for those cases.

@JamesHenry
Copy link
Member

Ah! Sorry, that makes sense

@JamesHenry JamesHenry merged commit 0fadfc3 into eslint:master Mar 18, 2017
@soda0289 soda0289 deleted the fix-metaproperty branch May 23, 2017 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants