forked from babel/babylon
-
Notifications
You must be signed in to change notification settings - Fork 5
remove get & set arrows #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rattrayalex
merged 3 commits into
lightscript:master
from
haltcase:remove-getter-setter-arrows
Jul 15, 2017
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-async/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
get method() -/> await a | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-async/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
get method() => 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
get method() -*> await a | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class X { | ||
method(x) -get> | ||
get method(x) -> | ||
x | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class X { | ||
method(x, y) -get> | ||
get method(x, y) -> | ||
x + y | ||
} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class X { | ||
method() -get> | ||
get method() -> | ||
a | ||
b | ||
} |
This file contains hidden or 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
3 changes: 0 additions & 3 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-async-get/actual.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
async method() -> await a | ||
} |
File renamed without changes.
3 changes: 0 additions & 3 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-get-arrow/actual.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-get-arrow/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-get-fat/actual.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/fixtures/lightscript/arrow-methods/class-malformed-get-fat/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-async/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
set method() -/> await a | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-async/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
set method() => 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class X { | ||
set method() -*> await a | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/options.json
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Can only use -> with getters & setters. (2:2)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class X { | ||
method() -set> | ||
set method() -> | ||
this.x = x | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/actual.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class X { | ||
method(x, y) -set> | ||
set method(x, y) -> | ||
this.x = x | ||
} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class X { | ||
method(x) -set> | ||
set method(x) -> | ||
this.x = x | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably now be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....which of course should not throw
Can't use async with lightscript arrows. (2:2)
anymore, but should throw something. Chrome doesn't parseasync get foo() {}
orget async foo() {}
.Maybe
Getters cannot be async
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be doable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the reason I made this a non-getter test is, like the fat arrow getter comment, you also can't do it in JS and so it seemed obvious. And there's a
class-malformed-async-fat-arrow
but no skinny until nowUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we still need to test that it throws though (this is checking correct behavior of the parser, not documenting the language)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm adding a new, separate test for that so we'll keep this one. Also to specify - a getter can return a Promise, it just can't be an actual
async
functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Womp, sorry, should have seen this before – we should remove (or at least rename) this test since it no longer tests what it says it does