Skip to content

Commit

Permalink
[JavaScript] Fixed a bug with constructor calls without parens
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Feb 24, 2016
1 parent c6cd372 commit f06d2a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions JavaScript/JavaScript.sublime-syntax
Expand Up @@ -390,8 +390,11 @@ contexts:
- include: literal-variable
- match: '\.'
scope: punctuation.accessor.js
- include: square-brackets
- match: '(?=\()'
set: constructor-params
- match: '(?=\S)'
pop: true
- match: '\('
scope: meta.brace.round.js
set:
Expand Down
8 changes: 8 additions & 0 deletions JavaScript/syntax_test_js.js
Expand Up @@ -432,3 +432,11 @@ new Date().getTime()
// ^^^^^^^ meta.instance.constructor
// ^^^^^^ meta.function-call.constructor
// ^^^^^^^^^^ - meta.instance.constructor

{
'test1': [],
'test2': new SomeOjbectHash["default"],
// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.constructor
// ^ meta.group.braces.square
'test3': "asdf"
}

0 comments on commit f06d2a5

Please sign in to comment.