-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2159 from masatake/js-ignore-bable-decorators
JavaScript: skip "TC39 Standards Track Decorators in Babel"
- Loading branch information
Showing
4 changed files
with
97 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sort=no |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Example input.js /^class Example {$/;" c | ||
doSomething input.js /^ doSomething() {$/;" m class:Example | ||
MyClass input.js /^class MyClass {$/;" c | ||
my_method input.js /^ my_method() {}$/;" m class:MyClass | ||
YourClass input.js /^class YourClass {$/;" c | ||
your_method input.js /^ @decorator @dec(arg1, arg2) @namespace.decorator @(complex ? dec1 : dec2) your_method() {}$/;" m class:YourClass |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Taken from https://www.sitepoint.com/javascript-decorators-what-they-are/ | ||
@log() | ||
@immutable() | ||
class Example { | ||
@time('demo') | ||
doSomething() { | ||
// | ||
} | ||
} | ||
|
||
// Taken from https://babeljs.io/blog/2018/09/17/decorators | ||
class MyClass { | ||
@decorator | ||
@dec(arg1, arg2) | ||
@namespace.decorator | ||
@(complex ? dec1 : dec2) | ||
my_method() {} | ||
} | ||
|
||
class YourClass { | ||
@decorator @dec(arg1, arg2) @namespace.decorator @(complex ? dec1 : dec2) your_method() {} | ||
} |
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