Skip to content
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

Add ES2017 keywords for JavaScript #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/coderay/scanners/java_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ class JavaScript < Scanner

# The actual JavaScript keywords.
KEYWORDS = %w[
break case catch continue default delete do else
finally for function if in instanceof new
async await break case catch class const continue
debugger default delete do else export extends
finally for function if import in instanceof let new
return switch throw try typeof var void while with
yield
] # :nodoc:
PREDEFINED_CONSTANTS = %w[
false null true undefined NaN Infinity
] # :nodoc:

MAGIC_VARIABLES = %w[ this arguments ] # :nodoc: arguments was introduced in JavaScript 1.4
MAGIC_VARIABLES = %w[ this arguments super ] # :nodoc:

KEYWORDS_EXPECTING_VALUE = WordList.new.add %w[
case delete in instanceof new return throw typeof with
await case delete in instanceof new return throw typeof with yield
] # :nodoc:

# Reserved for future use.
RESERVED_WORDS = %w[
abstract boolean byte char class debugger double enum export extends
final float goto implements import int interface long native package
private protected public short static super synchronized throws transient
volatile
abstract boolean byte char double enum final float
goto implements int interface long native package
private protected public short static synchronized
throws transient volatile
] # :nodoc:

IDENT_KIND = WordList.new(:ident).
Expand Down