diff --git a/Commands/Documentation for Word.plist b/Commands/Documentation for Word : Selection.tmCommand
similarity index 90%
rename from Commands/Documentation for Word.plist
rename to Commands/Documentation for Word : Selection.tmCommand
index 29d312a..7b14a37 100644
--- a/Commands/Documentation for Word.plist
+++ b/Commands/Documentation for Word : Selection.tmCommand
@@ -7,10 +7,9 @@
command
#!/usr/bin/env ruby18
-require "#{ENV['TM_BUNDLE_SUPPORT']}/jsmate"
+require "#{ENV['TM_BUNDLE_SUPPORT']}/documentation"
-JavaScript::documentationForWord
-
+Documentation::open_page_for(STDIN.read)
fallbackInput
word
input
diff --git a/Commands/Reformat Document : Selection.tmCommand b/Commands/Reformat Document : Selection.tmCommand
index 644f3ba..1c9c617 100644
--- a/Commands/Reformat Document : Selection.tmCommand
+++ b/Commands/Reformat Document : Selection.tmCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/usr/bin/env python
+ #!/usr/bin/env python3
import os
import sys
diff --git a/Commands/Run in Node.tmCommand b/Commands/Run in Node.tmCommand
new file mode 100644
index 0000000..0d8fc34
--- /dev/null
+++ b/Commands/Run in Node.tmCommand
@@ -0,0 +1,30 @@
+
+
+
+
+ beforeRunningCommand
+ saveModifiedFiles
+ command
+ #!/bin/bash
+
+[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
+
+"${TM_BUNDLE_SUPPORT}/run_script.sh"
+ input
+ document
+ keyEquivalent
+ @r
+ name
+ Run in Node
+ outputCaret
+ heuristic
+ outputFormat
+ html
+ outputLocation
+ newWindow
+ scope
+ source.js
+ uuid
+ F20780A9-CE3A-41D5-99B8-F5183AB54A98
+
+
diff --git a/Macros/Overwrite } in #{ .. }.tmMacro b/Macros/Overwrite '}' in ${ __ }.tmMacro
similarity index 100%
rename from Macros/Overwrite } in #{ .. }.tmMacro
rename to Macros/Overwrite '}' in ${ __ }.tmMacro
diff --git a/Preferences/Comments.tmPreferences b/Preferences/Comments.tmPreferences
index 2b7a183..3902212 100644
--- a/Preferences/Comments.tmPreferences
+++ b/Preferences/Comments.tmPreferences
@@ -1,5 +1,5 @@
-
+
name
diff --git a/Preferences/JavaScript Indent.tmPreferences b/Preferences/Indentation.tmPreferences
similarity index 100%
rename from Preferences/JavaScript Indent.tmPreferences
rename to Preferences/Indentation.tmPreferences
diff --git a/Preferences/Indentation: Disable Inside Template Strings.tmPreferences b/Preferences/Indentation: Disable Inside Template Strings.tmPreferences
new file mode 100644
index 0000000..67c7a40
--- /dev/null
+++ b/Preferences/Indentation: Disable Inside Template Strings.tmPreferences
@@ -0,0 +1,17 @@
+
+
+
+
+ name
+ Indentation: Disable Inside Template Strings
+ scope
+ source.js string.quoted.other.template
+ settings
+
+ disableIndentCorrections
+
+
+ uuid
+ A3DD3386-DDBA-4837-B80E-06FBC7A3FD68
+
+
diff --git a/Preferences/Symbol List: Functions.tmPreferences b/Preferences/Symbol List: Functions.tmPreferences
new file mode 100644
index 0000000..6fb797c
--- /dev/null
+++ b/Preferences/Symbol List: Functions.tmPreferences
@@ -0,0 +1,19 @@
+
+
+
+
+ name
+ Symbol List: Functions
+ scope
+ source.js entity.name.function
+ settings
+
+ showInSymbolList
+ 1
+ symbolTransformation
+ s/ / /
+
+ uuid
+ C58AC81C-F47B-4E0C-B9C0-9CBA7F02C46C
+
+
diff --git a/Preferences/Symbol List: Methods.tmPreferences b/Preferences/Symbol List: Methods.tmPreferences
new file mode 100644
index 0000000..1d9aff4
--- /dev/null
+++ b/Preferences/Symbol List: Methods.tmPreferences
@@ -0,0 +1,19 @@
+
+
+
+
+ name
+ Symbol List: Methods
+ scope
+ source.js meta.class-method.js entity.name.function.js
+ settings
+
+ showInSymbolList
+ 1
+ symbolTransformation
+ s/^/#/
+
+ uuid
+ C0ECB1FE-196C-4210-BB9F-207E59D9E429
+
+
diff --git a/Snippets/function (fun).plist b/Snippets/Anonymous Function.tmSnippet
similarity index 66%
rename from Snippets/function (fun).plist
rename to Snippets/Anonymous Function.tmSnippet
index 52c6f3f..6fe8d15 100644
--- a/Snippets/function (fun).plist
+++ b/Snippets/Anonymous Function.tmSnippet
@@ -3,16 +3,16 @@
content
- function ${1:functionName}($2) {
- $0
+ function ($1) {
+ ${0:$TM_SELECTED_TEXT}
}
name
- Function
+ Anonymous Function
scope
source.js
tabTrigger
- fun
+ f
uuid
- F0E4FB6A-4878-48C6-A777-62438DF1E14F
+ 4C6EDB43-3E2E-411B-A016-13C135C59833
diff --git "a/Snippets/Object key \342\200\224 key: \"value\".tmSnippet" "b/Snippets/Object key \342\200\224 key: \"value\".tmSnippet"
index 12bc4e1..470f728 100644
--- "a/Snippets/Object key \342\200\224 key: \"value\".tmSnippet"
+++ "b/Snippets/Object key \342\200\224 key: \"value\".tmSnippet"
@@ -1,5 +1,5 @@
-
+
content
diff --git a/Snippets/Prototype (proto).plist b/Snippets/Prototype.tmSnippet
similarity index 100%
rename from Snippets/Prototype (proto).plist
rename to Snippets/Prototype.tmSnippet
diff --git a/Snippets/debug.tmSnippet b/Snippets/debug.tmSnippet
new file mode 100644
index 0000000..afe0012
--- /dev/null
+++ b/Snippets/debug.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ console.debug(${1:$TM_SELECTED_TEXT});
+ name
+ debug
+ scope
+ source.js
+ tabTrigger
+ debug
+ uuid
+ B09E67F5-ED9E-4C22-BFA4-ED61F0E4D3B3
+
+
diff --git "a/Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet" "b/Snippets/for (\342\200\246) {\342\200\246} (Improved Native For-Loop).tmSnippet"
similarity index 100%
rename from "Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet"
rename to "Snippets/for (\342\200\246) {\342\200\246} (Improved Native For-Loop).tmSnippet"
diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet
index 6fe8d15..52c6f3f 100644
--- a/Snippets/function.tmSnippet
+++ b/Snippets/function.tmSnippet
@@ -3,16 +3,16 @@
content
- function ($1) {
- ${0:$TM_SELECTED_TEXT}
+ function ${1:functionName}($2) {
+ $0
}
name
- Anonymous Function
+ Function
scope
source.js
tabTrigger
- f
+ fun
uuid
- 4C6EDB43-3E2E-411B-A016-13C135C59833
+ F0E4FB6A-4878-48C6-A777-62438DF1E14F
diff --git a/Snippets/getAttribute.tmSnippet b/Snippets/getAttribute.tmSnippet
new file mode 100644
index 0000000..c8b7d27
--- /dev/null
+++ b/Snippets/getAttribute.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ getAttribute(${1:'${2:name}'})
+ name
+ getAttribute
+ scope
+ source.js
+ tabTrigger
+ get
+ uuid
+ 13A083C2-1F73-4CD6-9982-BFBCC5EB58B0
+
+
diff --git a/Snippets/if ... else.tmSnippet "b/Snippets/if \342\200\246 else.tmSnippet"
similarity index 100%
rename from Snippets/if ... else.tmSnippet
rename to "Snippets/if \342\200\246 else.tmSnippet"
diff --git a/Snippets/import.tmSnippet b/Snippets/import.tmSnippet
new file mode 100644
index 0000000..8d28cfd
--- /dev/null
+++ b/Snippets/import.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ import ${1:${2:library} from }${3:'${4:path}'};
+ name
+ import
+ scope
+ source.js
+ tabTrigger
+ imp
+ uuid
+ 8F536653-6212-4A3A-ABF5-F47AC1ADAF21
+
+
diff --git a/Snippets/new Promise.tmSnippet b/Snippets/new Promise.tmSnippet
new file mode 100644
index 0000000..240884f
--- /dev/null
+++ b/Snippets/new Promise.tmSnippet
@@ -0,0 +1,18 @@
+
+
+
+
+ content
+ new Promise((resolve, reject) => {
+ $0
+});
+ name
+ new Promise
+ scope
+ source.js
+ tabTrigger
+ pro
+ uuid
+ 89CEA10F-CB8E-45A2-A206-BD7EE8118791
+
+
diff --git a/Snippets/querySelector.tmSnippet b/Snippets/querySelector.tmSnippet
new file mode 100644
index 0000000..bde122b
--- /dev/null
+++ b/Snippets/querySelector.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ querySelector(${1:'${2:selector}'})
+ name
+ querySelector
+ scope
+ source.js
+ tabTrigger
+ qsa
+ uuid
+ 29B39100-632C-498F-829A-CF0F71DE0B25
+
+
diff --git a/Snippets/querySelectorAll.tmSnippet b/Snippets/querySelectorAll.tmSnippet
new file mode 100644
index 0000000..573e92b
--- /dev/null
+++ b/Snippets/querySelectorAll.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ querySelectorAll(${1:'${2:selector}'})
+ name
+ querySelectorAll
+ scope
+ source.js
+ tabTrigger
+ qsa
+ uuid
+ 29A152B6-8C5F-4BD3-82F2-EC7F21FA00A3
+
+
diff --git a/Snippets/require.tmSnippet b/Snippets/require.tmSnippet
new file mode 100644
index 0000000..37c21ec
--- /dev/null
+++ b/Snippets/require.tmSnippet
@@ -0,0 +1,16 @@
+
+
+
+
+ content
+ require(${1:'${2:library}'})
+ name
+ require
+ scope
+ source.js
+ tabTrigger
+ req
+ uuid
+ FC9298E3-8ED7-4868-8C91-E50755F37325
+
+
diff --git a/Snippets/then.tmSnippet b/Snippets/then.tmSnippet
new file mode 100644
index 0000000..afd4561
--- /dev/null
+++ b/Snippets/then.tmSnippet
@@ -0,0 +1,18 @@
+
+
+
+
+ content
+ then((${1:result}) => ${2:{
+ ${0}
+\}})
+ name
+ then
+ scope
+ source.js
+ tabTrigger
+ then
+ uuid
+ 086ACC46-8307-4C69-B862-69302BFBBD66
+
+
diff --git a/Support/documentation.rb b/Support/documentation.rb
new file mode 100644
index 0000000..56309ab
--- /dev/null
+++ b/Support/documentation.rb
@@ -0,0 +1,67 @@
+require 'yaml'
+require 'pp'
+
+require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
+require "#{ENV['TM_SUPPORT_PATH']}/lib/ui"
+
+module Documentation
+ HOST = "https://developer.mozilla.org/en-US/docs/Web"
+ YAML_PATH = "#{ENV['TM_BUNDLE_SUPPORT']}/index.yaml"
+
+ SEARCH_URL = 'https://developer.mozilla.org/en-US/search?topic=apps&topic=html&topic=css&topic=js&topic=api&topic=canvas&topic=svg&topic=webgl&topic=mobile&topic=webdev&topic=http&topic=webext&q='
+
+ class << self
+
+ def search_and_exit(token)
+ url = "#{SEARCH_URL}#{token}"
+ TextMate::exit_show_html(
+ ""
+ )
+ end
+
+ def show_url_and_exit(url)
+ url = "#{HOST}#{url}"
+ TextMate::exit_show_html(
+ ""
+ )
+ end
+
+ def reference(token)
+ @yaml ||= YAML::load( File.read(YAML_PATH) )
+ @yaml[token]
+ end
+
+ def open_page_for(token)
+ items = reference(token) || []
+
+ # If there are no matches, we just load a search results page for the
+ # token.
+ if items.size == 0
+ search_and_exit(token)
+ end
+
+ # Usually there will be only one option, so we can jump straight to it.
+ if items.size == 1
+ show_url_and_exit(items[0][:url])
+ end
+
+ # We have more than one possible match (e.g., `indexOf` or `slice`).
+ # Ask the user to pick one.
+ index = {}
+ choices = items.map do |item|
+ index[ item[:name] ] = item[:url]
+ item[:name]
+ end
+
+ choice = TextMate::UI.request_item(
+ :items => choices,
+ :title => 'Choose an Option'
+ )
+
+ # Did the user hit Cancel?
+ TextMate::exit_discard if choice.nil?
+
+ show_url_and_exit(index[choice])
+ end
+ end
+end
\ No newline at end of file
diff --git a/Support/index.yaml b/Support/index.yaml
new file mode 100644
index 0000000..23dc7a0
--- /dev/null
+++ b/Support/index.yaml
@@ -0,0 +1,2239 @@
+---
+decodeURI:
+- :name: decodeURI
+ :url: "/JavaScript/Reference/Global_Objects/decodeURI"
+decodeURIComponent:
+- :name: decodeURIComponent
+ :url: "/JavaScript/Reference/Global_Objects/decodeURIComponent"
+encodeURI:
+- :name: encodeURI
+ :url: "/JavaScript/Reference/Global_Objects/encodeURI"
+encodeURIComponent:
+- :name: encodeURIComponent
+ :url: "/JavaScript/Reference/Global_Objects/encodeURIComponent"
+eval:
+- :name: eval
+ :url: "/JavaScript/Reference/Global_Objects/eval"
+- :name: Object.prototype.eval()
+ :url: "/JavaScript/Reference/Global_Objects/Object/eval"
+isFinite:
+- :name: isFinite
+ :url: "/JavaScript/Reference/Global_Objects/isFinite"
+- :name: Number.isFinite()
+ :url: "/JavaScript/Reference/Global_Objects/Number/isFinite"
+isNaN:
+- :name: isNaN
+ :url: "/JavaScript/Reference/Global_Objects/isNaN"
+- :name: Number.isNaN()
+ :url: "/JavaScript/Reference/Global_Objects/Number/isNaN"
+parseFloat:
+- :name: parseFloat
+ :url: "/JavaScript/Reference/Global_Objects/parseFloat"
+- :name: Number.parseFloat()
+ :url: "/JavaScript/Reference/Global_Objects/Number/parseFloat"
+parseInt:
+- :name: parseInt
+ :url: "/JavaScript/Reference/Global_Objects/parseInt"
+- :name: Number.parseInt()
+ :url: "/JavaScript/Reference/Global_Objects/Number/parseInt"
+undefined:
+- :name: undefined
+ :url: "/JavaScript/Reference/Global_Objects/undefined"
+'null':
+- :name: 'null'
+ :url: "/JavaScript/Reference/Global_Objects/null"
+NaN:
+- :name: NaN
+ :url: "/JavaScript/Reference/Global_Objects/NaN"
+- :name: Number.NaN
+ :url: "/JavaScript/Reference/Global_Objects/Number/NaN"
+Infinity:
+- :name: Infinity
+ :url: "/JavaScript/Reference/Global_Objects/Infinity"
+await:
+- :name: await
+ :url: "/JavaScript/Reference/Operators/await"
+delete:
+- :name: delete
+ :url: "/JavaScript/Reference/Operators/delete"
+- :name: Map.prototype.delete(key)
+ :url: "/JavaScript/Reference/Global_Objects/Map/delete"
+- :name: Set.prototype.delete(value)
+ :url: "/JavaScript/Reference/Global_Objects/Set/delete"
+- :name: WeakMap.prototype.delete(key)
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/delete"
+- :name: WeakSet.prototype.delete(value)
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet/delete"
+get:
+- :name: get
+ :url: "/JavaScript/Reference/Operators/get"
+- :name: Map.prototype.get(key)
+ :url: "/JavaScript/Reference/Global_Objects/Map/get"
+- :name: handler.get()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/get"
+- :name: WeakMap.prototype.get(key)
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/get"
+in:
+- :name: for...in
+ :url: "/JavaScript/Reference/Operators/for...in"
+instanceof:
+- :name: instanceof
+ :url: "/JavaScript/Reference/Operators/instanceof"
+let:
+- :name: let
+ :url: "/JavaScript/Reference/Operators/let"
+- :name: let
+ :url: "/JavaScript/Reference/Statements/let"
+- :name: let
+ :url: "/JavaScript/Reference/Statements/let"
+new:
+- :name: new
+ :url: "/JavaScript/Reference/Operators/new"
+set:
+- :name: set
+ :url: "/JavaScript/Reference/Operators/set"
+- :name: Map.prototype.set(key, value)
+ :url: "/JavaScript/Reference/Global_Objects/Map/set"
+- :name: handler.set()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/set"
+- :name: WeakMap.prototype.set(key, value)
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/set"
+this:
+- :name: this
+ :url: "/JavaScript/Reference/Operators/this"
+typeof:
+- :name: typeof
+ :url: "/JavaScript/Reference/Operators/typeof"
+void:
+- :name: void
+ :url: "/JavaScript/Reference/Operators/void"
+yield*:
+- :name: yield*
+ :url: "/JavaScript/Reference/Operators/yield*"
+async function:
+- :name: async
+ :url: "/JavaScript/Reference/Statements/async function"
+break:
+- :name: break
+ :url: "/JavaScript/Reference/Statements/break"
+try...catch:
+- :name: catch
+ :url: "/JavaScript/Reference/Statements/try...catch"
+- :name: try
+ :url: "/JavaScript/Reference/Statements/try...catch"
+class:
+- :name: class
+ :url: "/JavaScript/Reference/Statements/class"
+const:
+- :name: const
+ :url: "/JavaScript/Reference/Statements/const"
+- :name: const
+ :url: "/JavaScript/Reference/Statements/const"
+continue:
+- :name: continue
+ :url: "/JavaScript/Reference/Statements/continue"
+debugger:
+- :name: debugger
+ :url: "/JavaScript/Reference/Statements/debugger"
+do...while:
+- :name: do
+ :url: "/JavaScript/Reference/Statements/do...while"
+if...else:
+- :name: else
+ :url: "/JavaScript/Reference/Statements/if...else"
+- :name: if
+ :url: "/JavaScript/Reference/Statements/if...else"
+export:
+- :name: export
+ :url: "/JavaScript/Reference/Statements/export"
+for:
+- :name: for
+ :url: "/JavaScript/Reference/Statements/for"
+- :name: Symbol.for(key)
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/for"
+function:
+- :name: function
+ :url: "/JavaScript/Reference/Statements/function"
+function*:
+- :name: function*
+ :url: "/JavaScript/Reference/Statements/function*"
+import:
+- :name: import
+ :url: "/JavaScript/Reference/Statements/import"
+for...in:
+- :name: in
+ :url: "/JavaScript/Reference/Statements/for...in"
+label:
+- :name: label
+ :url: "/JavaScript/Reference/Statements/label"
+for...of:
+- :name: of
+ :url: "/JavaScript/Reference/Statements/for...of"
+return:
+- :name: return
+ :url: "/JavaScript/Reference/Statements/return"
+switch:
+- :name: switch
+ :url: "/JavaScript/Reference/Statements/switch"
+throw:
+- :name: throw
+ :url: "/JavaScript/Reference/Statements/throw"
+var:
+- :name: var
+ :url: "/JavaScript/Reference/Statements/var"
+while:
+- :name: while
+ :url: "/JavaScript/Reference/Statements/while"
+with:
+- :name: with
+ :url: "/JavaScript/Reference/Statements/with"
+yield:
+- :name: yield
+ :url: "/JavaScript/Reference/Statements/yield"
+Image:
+- :name: Image
+ :url: "/API/HTMLImageElement/Image"
+- :name: Image
+ :url: "/API/Image"
+Array.prototype:
+- :name: Array.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Array/prototype"
+length:
+- :name: Array.prototype.length
+ :url: "/JavaScript/Reference/Global_Objects/Array/length"
+- :name: Window.length
+ :url: "/API/Window/length"
+- :name: Function.length
+ :url: "/JavaScript/Reference/Global_Objects/Function/length"
+- :name: String.prototype.length
+ :url: "/JavaScript/Reference/Global_Objects/String/length"
+prototype[@@unscopables]:
+- :name: Array.prototype[@@unscopables]
+ :url: "/JavaScript/Reference/Global_Objects/Array/@@unscopables"
+copyWithin:
+- :name: Array.prototype.copyWithin()
+ :url: "/JavaScript/Reference/Global_Objects/Array/copyWithin"
+fill:
+- :name: Array.prototype.fill()
+ :url: "/JavaScript/Reference/Global_Objects/Array/fill"
+pop:
+- :name: Array.prototype.pop()
+ :url: "/JavaScript/Reference/Global_Objects/Array/pop"
+push:
+- :name: Array.prototype.push()
+ :url: "/JavaScript/Reference/Global_Objects/Array/push"
+reverse:
+- :name: Array.prototype.reverse()
+ :url: "/JavaScript/Reference/Global_Objects/Array/reverse"
+shift:
+- :name: Array.prototype.shift()
+ :url: "/JavaScript/Reference/Global_Objects/Array/shift"
+sort:
+- :name: Array.prototype.sort()
+ :url: "/JavaScript/Reference/Global_Objects/Array/sort"
+splice:
+- :name: Array.prototype.splice()
+ :url: "/JavaScript/Reference/Global_Objects/Array/splice"
+unshift:
+- :name: Array.prototype.unshift()
+ :url: "/JavaScript/Reference/Global_Objects/Array/unshift"
+concat:
+- :name: Array.prototype.concat()
+ :url: "/JavaScript/Reference/Global_Objects/Array/concat"
+- :name: String.prototype.concat()
+ :url: "/JavaScript/Reference/Global_Objects/String/concat"
+includes:
+- :name: Array.prototype.includes()
+ :url: "/JavaScript/Reference/Global_Objects/Array/includes"
+- :name: String.prototype.includes()
+ :url: "/JavaScript/Reference/Global_Objects/String/includes"
+indexOf:
+- :name: Array.prototype.indexOf()
+ :url: "/JavaScript/Reference/Global_Objects/Array/indexOf"
+- :name: String.prototype.indexOf()
+ :url: "/JavaScript/Reference/Global_Objects/String/indexOf"
+join:
+- :name: Array.prototype.join()
+ :url: "/JavaScript/Reference/Global_Objects/Array/join"
+lastIndexOf:
+- :name: Array.prototype.lastIndexOf()
+ :url: "/JavaScript/Reference/Global_Objects/Array/lastIndexOf"
+- :name: String.prototype.lastIndexOf()
+ :url: "/JavaScript/Reference/Global_Objects/String/lastIndexOf"
+slice:
+- :name: Array.prototype.slice()
+ :url: "/JavaScript/Reference/Global_Objects/Array/slice"
+- :name: String.prototype.slice()
+ :url: "/JavaScript/Reference/Global_Objects/String/slice"
+toString:
+- :name: Array.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Array/toString"
+- :name: Date.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toString"
+- :name: Function.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Function/toString"
+- :name: Error.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Error/toString"
+- :name: Boolean.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Boolean/toString"
+- :name: Number.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toString"
+- :name: Object.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Object/toString"
+- :name: RegExp.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/toString"
+- :name: String.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/String/toString"
+- :name: Symbol.prototype.toString()
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/toString"
+toLocaleString:
+- :name: Array.prototype.toLocaleString()
+ :url: "/JavaScript/Reference/Global_Objects/Array/toLocaleString"
+- :name: Date.prototype.toLocaleString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toLocaleString"
+- :name: Number.prototype.toLocaleString()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toLocaleString"
+- :name: Object.prototype.toLocaleString()
+ :url: "/JavaScript/Reference/Global_Objects/Object/toLocaleString"
+entries:
+- :name: Array.prototype.entries()
+ :url: "/JavaScript/Reference/Global_Objects/Array/entries"
+- :name: Map.prototype.entries()
+ :url: "/JavaScript/Reference/Global_Objects/Map/entries"
+- :name: Object.entries()
+ :url: "/JavaScript/Reference/Global_Objects/Object/entries"
+- :name: Set.prototype.entries()
+ :url: "/JavaScript/Reference/Global_Objects/Set/entries"
+every:
+- :name: Array.prototype.every()
+ :url: "/JavaScript/Reference/Global_Objects/Array/every"
+filter:
+- :name: Array.prototype.filter()
+ :url: "/JavaScript/Reference/Global_Objects/Array/filter"
+find:
+- :name: Array.prototype.find()
+ :url: "/JavaScript/Reference/Global_Objects/Array/find"
+- :name: Window.find()
+ :url: "/API/Window/find"
+findIndex:
+- :name: Array.prototype.findIndex()
+ :url: "/JavaScript/Reference/Global_Objects/Array/findIndex"
+forEach:
+- :name: Array.prototype.forEach()
+ :url: "/JavaScript/Reference/Global_Objects/Array/forEach"
+- :name: Map.prototype.forEach(callbackFn[, thisArg])
+ :url: "/JavaScript/Reference/Global_Objects/Map/forEach"
+- :name: Set.prototype.forEach(callbackFn[, thisArg])
+ :url: "/JavaScript/Reference/Global_Objects/Set/forEach"
+keys:
+- :name: Array.prototype.keys()
+ :url: "/JavaScript/Reference/Global_Objects/Array/keys"
+- :name: Map.prototype.keys()
+ :url: "/JavaScript/Reference/Global_Objects/Map/keys"
+- :name: Object.keys()
+ :url: "/JavaScript/Reference/Global_Objects/Object/keys"
+- :name: Set.prototype.keys()
+ :url: "/JavaScript/Reference/Global_Objects/Set/keys"
+map:
+- :name: Array.prototype.map()
+ :url: "/JavaScript/Reference/Global_Objects/Array/map"
+reduce:
+- :name: Array.prototype.reduce()
+ :url: "/JavaScript/Reference/Global_Objects/Array/reduce"
+reduceRight:
+- :name: Array.prototype.reduceRight()
+ :url: "/JavaScript/Reference/Global_Objects/Array/reduceRight"
+some:
+- :name: Array.prototype.some()
+ :url: "/JavaScript/Reference/Global_Objects/Array/some"
+values:
+- :name: Array.prototype.values()
+ :url: "/JavaScript/Reference/Global_Objects/Array/values"
+- :name: Map.prototype.values()
+ :url: "/JavaScript/Reference/Global_Objects/Map/values"
+- :name: Object.values()
+ :url: "/JavaScript/Reference/Global_Objects/Object/values"
+- :name: Set.prototype.values()
+ :url: "/JavaScript/Reference/Global_Objects/Set/values"
+prototype[@@iterator]:
+- :name: Array.prototype[@@iterator]()
+ :url: "/JavaScript/Reference/Global_Objects/Array/@@iterator"
+- :name: Map.prototype[@@iterator]()
+ :url: "/JavaScript/Reference/Global_Objects/Map/@@iterator"
+- :name: Set.prototype[@@iterator]()
+ :url: "/JavaScript/Reference/Global_Objects/Set/@@iterator"
+- :name: String.prototype[@@iterator]()
+ :url: "/JavaScript/Reference/Global_Objects/String/@@iterator"
+HTMLElement:
+- :name: HTMLElement
+ :url: "/API/HTMLElement"
+accessKeyLabel:
+- :name: HTMLElement.accessKeyLabel
+ :url: "/API/HTMLElement/accessKeyLabel"
+contentEditable:
+- :name: HTMLElement.contentEditable
+ :url: "/API/HTMLElement/contentEditable"
+isContentEditable:
+- :name: HTMLElement.isContentEditable
+ :url: "/API/HTMLElement/isContentEditable"
+contextMenu:
+- :name: HTMLElement.contextMenu
+ :url: "/API/HTMLElement/contextMenu"
+dataset:
+- :name: HTMLElement.dataset
+ :url: "/API/HTMLElement/dataset"
+dir:
+- :name: HTMLElement.dir
+ :url: "/API/HTMLElement/dir"
+- :name: Document.dir
+ :url: "/API/Document/dir"
+hidden:
+- :name: HTMLElement.hidden
+ :url: "/API/HTMLElement/hidden"
+- :name: Document.hidden
+ :url: "/API/Document/hidden"
+lang:
+- :name: HTMLElement.lang
+ :url: "/API/HTMLElement/lang"
+offsetHeight:
+- :name: HTMLElement.offsetHeight
+ :url: "/API/HTMLElement/offsetHeight"
+offsetLeft:
+- :name: HTMLElement.offsetLeft
+ :url: "/API/HTMLElement/offsetLeft"
+offsetParent:
+- :name: HTMLElement.offsetParent
+ :url: "/API/HTMLElement/offsetParent"
+offsetTop:
+- :name: HTMLElement.offsetTop
+ :url: "/API/HTMLElement/offsetTop"
+offsetWidth:
+- :name: HTMLElement.offsetWidth
+ :url: "/API/HTMLElement/offsetWidth"
+style:
+- :name: HTMLElement.style
+ :url: "/API/HTMLElement/style"
+tabIndex:
+- :name: HTMLElement.tabIndex
+ :url: "/API/HTMLElement/tabIndex"
+title:
+- :name: HTMLElement.title
+ :url: "/API/HTMLElement/title"
+- :name: Document.title
+ :url: "/API/Document/title"
+blur:
+- :name: HTMLElement.blur()
+ :url: "/API/HTMLElement/blur"
+- :name: Window.blur()
+ :url: "/API/Window/blur"
+click:
+- :name: HTMLElement.click()
+ :url: "/API/HTMLElement/click"
+focus:
+- :name: HTMLElement.focus()
+ :url: "/API/HTMLElement/focus"
+- :name: Window.focus()
+ :url: "/API/Window/focus"
+forceSpellCheck:
+- :name: HTMLElement.forceSpellCheck()
+ :url: "/API/HTMLElement/forceSpellCheck"
+window:
+- :name: window
+ :url: "/API/window"
+- :name: Window.window
+ :url: "/API/Window/window"
+console:
+- :name: Window.console
+ :url: "/API/Window/console"
+crypto:
+- :name: Window.crypto
+ :url: "/API/Window/crypto"
+defaultStatus:
+- :name: Window.defaultStatus
+ :url: "/API/Window/defaultStatus"
+dialogArguments:
+- :name: Window.dialogArguments
+ :url: "/API/Window/dialogArguments"
+directories:
+- :name: Window.directories
+ :url: "/API/Window/directories"
+document:
+- :name: Window.document
+ :url: "/API/Window/document"
+- :name: document
+ :url: "/API/document"
+frameElement:
+- :name: Window.frameElement
+ :url: "/API/Window/frameElement"
+frames:
+- :name: Window.frames
+ :url: "/API/Window/frames"
+fullScreen:
+- :name: Window.fullScreen
+ :url: "/API/Window/fullScreen"
+history:
+- :name: Window.history
+ :url: "/API/Window/history"
+innerHeight:
+- :name: Window.innerHeight
+ :url: "/API/Window/innerHeight"
+innerWidth:
+- :name: Window.innerWidth
+ :url: "/API/Window/innerWidth"
+isSecureContext:
+- :name: Window.isSecureContext
+ :url: "/API/Window/isSecureContext"
+- :name: WindowOrWorkerGlobalScope.isSecureContext
+ :url: "/API/WindowOrWorkerGlobalScope/isSecureContext"
+location:
+- :name: Window.location
+ :url: "/API/Window/location"
+- :name: Document.location
+ :url: "/API/Document/location"
+locationbar:
+- :name: Window.locationbar
+ :url: "/API/Window/locationbar"
+localStorage:
+- :name: Window.localStorage
+ :url: "/API/Window/localStorage"
+menubar:
+- :name: Window.menubar
+ :url: "/API/Window/menubar"
+messageManager:
+- :name: Window.messageManager
+ :url: "/API/Window/messageManager"
+mozAnimationStartTime:
+- :name: Window.mozAnimationStartTime
+ :url: "/API/Window/mozAnimationStartTime"
+name:
+- :name: Window.name
+ :url: "/API/Window/name"
+- :name: Function.name
+ :url: "/JavaScript/Reference/Global_Objects/Function/name"
+- :name: Error.prototype.name
+ :url: "/JavaScript/Reference/Global_Objects/Error/name"
+- :name: RangeError.prototype.name
+ :url: "/JavaScript/Reference/Global_Objects/Error/name"
+- :name: ReferenceError.prototype.name
+ :url: "/JavaScript/Reference/Global_Objects/Error/name"
+- :name: SyntaxError.prototype.name
+ :url: "/JavaScript/Reference/Global_Objects/Error/name"
+- :name: TypeError.prototype.name
+ :url: "/JavaScript/Reference/Global_Objects/Error/name"
+navigator:
+- :name: Window.navigator
+ :url: "/API/Window/navigator"
+opener:
+- :name: Window.opener
+ :url: "/API/Window/opener"
+outerHeight:
+- :name: Window.outerHeight
+ :url: "/API/Window/outerHeight"
+outerWidth:
+- :name: Window.outerWidth
+ :url: "/API/Window/outerWidth"
+pageXOffset:
+- :name: Window.pageXOffset
+ :url: "/API/Window/scrollX"
+pageYOffset:
+- :name: Window.pageYOffset
+ :url: "/API/Window/scrollY"
+sessionStorage:
+- :name: Window.sessionStorage
+ :url: "/API/Window/sessionStorage"
+- :name: Window.sessionStorage
+ :url: "/API/Window/sessionStorage"
+parent:
+- :name: Window.parent
+ :url: "/API/Window/parent"
+performance:
+- :name: Window.performance
+ :url: "/API/Window/performance"
+personalbar:
+- :name: Window.personalbar
+ :url: "/API/Window/personalbar"
+pkcs11:
+- :name: Window.pkcs11
+ :url: "/API/Window/pkcs11"
+screen:
+- :name: Window.screen
+ :url: "/API/Window/screen"
+screenX:
+- :name: Window.screenX
+ :url: "/API/Window/screenX"
+screenY:
+- :name: Window.screenY
+ :url: "/API/Window/screenY"
+scrollbars:
+- :name: Window.scrollbars
+ :url: "/API/Window/scrollbars"
+scrollX:
+- :name: Window.scrollX
+ :url: "/API/Window/scrollX"
+scrollY:
+- :name: Window.scrollY
+ :url: "/API/Window/scrollY"
+self:
+- :name: Window.self
+ :url: "/API/Window/self"
+speechSynthesis:
+- :name: Window.speechSynthesis
+ :url: "/API/Window/speechSynthesis"
+status:
+- :name: Window.status
+ :url: "/API/Window/status"
+statusbar:
+- :name: Window.statusbar
+ :url: "/API/Window/statusbar"
+toolbar:
+- :name: Window.toolbar
+ :url: "/API/Window/toolbar"
+top:
+- :name: Window.top
+ :url: "/API/Window/top"
+visualViewport:
+- :name: Window.visualViewport
+ :url: "/API/Window/visualViewport"
+caches:
+- :name: WindowOrWorkerGlobalScope.caches
+ :url: "/API/WindowOrWorkerGlobalScope/caches"
+indexedDB:
+- :name: WindowOrWorkerGlobalScope.indexedDB
+ :url: "/API/WindowOrWorkerGlobalScope/indexedDB"
+origin:
+- :name: WindowOrWorkerGlobalScope.origin
+ :url: "/API/WindowOrWorkerGlobalScope/origin"
+alert:
+- :name: Window.alert()
+ :url: "/API/Window/alert"
+cancelAnimationFrame:
+- :name: Window.cancelAnimationFrame()
+ :url: "/API/Window/cancelAnimationFrame"
+cancelIdleCallback:
+- :name: Window.cancelIdleCallback()
+ :url: "/API/Window/cancelIdleCallback"
+captureEvents:
+- :name: Window.captureEvents()
+ :url: "/API/Window/captureEvents"
+clearImmediate:
+- :name: Window.clearImmediate()
+ :url: "/API/Window/clearImmediate"
+close:
+- :name: Window.close()
+ :url: "/API/Window/close"
+- :name: document.close()
+ :url: "/API/Document/close"
+confirm:
+- :name: Window.confirm()
+ :url: "/API/Window/confirm"
+getComputedStyle:
+- :name: Window.getComputedStyle()
+ :url: "/API/Window/getComputedStyle"
+getSelection:
+- :name: Window.getSelection()
+ :url: "/API/Window/getSelection"
+- :name: document.getSelection()
+ :url: "/API/Document/getSelection"
+matchMedia:
+- :name: Window.matchMedia()
+ :url: "/API/Window/matchMedia"
+minimize:
+- :name: Window.minimize()
+ :url: "/API/Window/minimize"
+moveBy:
+- :name: Window.moveBy()
+ :url: "/API/Window/moveBy"
+moveTo:
+- :name: Window.moveTo()
+ :url: "/API/Window/moveTo"
+open:
+- :name: Window.open()
+ :url: "/API/Window/open"
+- :name: document.open()
+ :url: "/API/Document/open"
+postMessage:
+- :name: Window.postMessage()
+ :url: "/API/Window/postMessage"
+print:
+- :name: Window.print()
+ :url: "/API/Window/print"
+prompt:
+- :name: Window.prompt()
+ :url: "/API/Window/prompt"
+requestAnimationFrame:
+- :name: Window.requestAnimationFrame()
+ :url: "/API/Window/requestAnimationFrame"
+requestIdleCallback:
+- :name: Window.requestIdleCallback()
+ :url: "/API/Window/requestIdleCallback"
+resizeBy:
+- :name: Window.resizeBy()
+ :url: "/API/Window/resizeBy"
+resizeTo:
+- :name: Window.resizeTo()
+ :url: "/API/Window/resizeTo"
+routeEvent:
+- :name: Window.routeEvent()
+ :url: "/API/Window/routeEvent"
+scroll:
+- :name: Window.scroll()
+ :url: "/API/Window/scroll"
+scrollBy:
+- :name: Window.scrollBy()
+ :url: "/API/Window/scrollBy"
+scrollTo:
+- :name: Window.scrollTo()
+ :url: "/API/Window/scrollTo"
+setImmediate:
+- :name: Window.setImmediate()
+ :url: "/API/Window/setImmediate"
+stop:
+- :name: Window.stop()
+ :url: "/API/Window/stop"
+addEventListener:
+- :name: EventTarget.addEventListener()
+ :url: "/API/EventTarget/addEventListener"
+atob:
+- :name: WindowOrWorkerGlobalScope.atob()
+ :url: "/API/WindowOrWorkerGlobalScope/atob"
+btoa:
+- :name: WindowOrWorkerGlobalScope.btoa()
+ :url: "/API/WindowOrWorkerGlobalScope/btoa"
+clearInterval:
+- :name: WindowOrWorkerGlobalScope.clearInterval()
+ :url: "/API/WindowOrWorkerGlobalScope/clearInterval"
+clearTimeout:
+- :name: WindowOrWorkerGlobalScope.clearTimeout()
+ :url: "/API/WindowOrWorkerGlobalScope/clearTimeout"
+createImageBitmap:
+- :name: WindowOrWorkerGlobalScope.createImageBitmap()
+ :url: "/API/WindowOrWorkerGlobalScope/createImageBitmap"
+fetch:
+- :name: WindowOrWorkerGlobalScope.fetch()
+ :url: "/API/WindowOrWorkerGlobalScope/fetch"
+removeEventListener:
+- :name: EventTarget.removeEventListener
+ :url: "/API/EventTarget/removeEventListener"
+setInterval:
+- :name: WindowOrWorkerGlobalScope.setInterval()
+ :url: "/API/WindowOrWorkerGlobalScope/setInterval"
+setTimeout:
+- :name: WindowOrWorkerGlobalScope.setTimeout()
+ :url: "/API/WindowOrWorkerGlobalScope/setTimeout"
+showModalDialog:
+- :name: Window.showModalDialog()
+ :url: "/API/Window/showModalDialog"
+onabort:
+- :name: GlobalEventHandlers.onabort
+ :url: "/API/GlobalEventHandlers/onabort"
+- :name: GlobalEventHandlers.onabort
+ :url: "/API/GlobalEventHandlers/onabort"
+onafterprint:
+- :name: WindowEventHandlers.onafterprint
+ :url: "/API/WindowEventHandlers/onafterprint"
+onbeforeprint:
+- :name: WindowEventHandlers.onbeforeprint
+ :url: "/API/WindowEventHandlers/onbeforeprint"
+onbeforeinstallprompt:
+- :name: Window.onbeforeinstallprompt
+ :url: "/API/Window/onbeforeinstallprompt"
+onbeforeunload:
+- :name: WindowEventHandlers.onbeforeunload
+ :url: "/API/WindowEventHandlers/onbeforeunload"
+onblur:
+- :name: GlobalEventHandlers.onblur
+ :url: "/API/GlobalEventHandlers/onblur"
+- :name: GlobalEventHandlers.onblur
+ :url: "/API/GlobalEventHandlers/onblur"
+onchange:
+- :name: GlobalEventHandlers.onchange
+ :url: "/API/GlobalEventHandlers/onchange"
+- :name: GlobalEventHandlers.onchange
+ :url: "/API/GlobalEventHandlers/onchange"
+onclick:
+- :name: GlobalEventHandlers.onclick
+ :url: "/API/GlobalEventHandlers/onclick"
+- :name: GlobalEventHandlers.onclick
+ :url: "/API/GlobalEventHandlers/onclick"
+ondblclick:
+- :name: GlobalEventHandlers.ondblclick
+ :url: "/API/GlobalEventHandlers/ondblclick"
+- :name: GlobalEventHandlers.ondblclick
+ :url: "/API/GlobalEventHandlers/ondblclick"
+onclose:
+- :name: GlobalEventHandlers.onclose
+ :url: "/API/GlobalEventHandlers/onclose"
+- :name: GlobalEventHandlers.onclose
+ :url: "/API/GlobalEventHandlers/onclose"
+oncontextmenu:
+- :name: GlobalEventHandlers.oncontextmenu
+ :url: "/API/GlobalEventHandlers/oncontextmenu"
+- :name: GlobalEventHandlers.oncontextmenu
+ :url: "/API/GlobalEventHandlers/oncontextmenu"
+ondevicelight:
+- :name: Window.ondevicelight
+ :url: "/API/Window/ondevicelight"
+ondevicemotion:
+- :name: Window.ondevicemotion
+ :url: "/API/Window/ondevicemotion"
+ondeviceorientation:
+- :name: Window.ondeviceorientation
+ :url: "/API/Window/ondeviceorientation"
+ondeviceproximity:
+- :name: Window.ondeviceproximity
+ :url: "/API/Window/ondeviceproximity"
+onerror:
+- :name: GlobalEventHandlers.onerror
+ :url: "/API/GlobalEventHandlers/onerror"
+- :name: GlobalEventHandlers.onerror
+ :url: "/API/GlobalEventHandlers/onerror"
+onfocus:
+- :name: GlobalEventHandlers.onfocus
+ :url: "/API/GlobalEventHandlers/onfocus"
+- :name: GlobalEventHandlers.onfocus
+ :url: "/API/GlobalEventHandlers/onfocus"
+onhashchange:
+- :name: WindowEventHandlers.onhashchange
+ :url: "/API/WindowEventHandlers/onhashchange"
+onappinstalled:
+- :name: Window.onappinstalled
+ :url: "/API/Window/onappinstalled"
+ongamepadconnected:
+- :name: Window.ongamepadconnected
+ :url: "/API/Window/ongamepadconnected"
+ongamepaddisconnected:
+- :name: Window.ongamepaddisconnected
+ :url: "/API/Window/ongamepaddisconnected"
+oninput:
+- :name: Window.oninput
+ :url: "/API/Window/oninput"
+- :name: GlobalEventHandlers.oninput
+ :url: "/API/GlobalEventHandlers/oninput"
+onkeydown:
+- :name: GlobalEventHandlers.onkeydown
+ :url: "/API/GlobalEventHandlers/onkeydown"
+- :name: GlobalEventHandlers.onkeydown
+ :url: "/API/GlobalEventHandlers/onkeydown"
+onkeypress:
+- :name: GlobalEventHandlers.onkeypress
+ :url: "/API/GlobalEventHandlers/onkeypress"
+- :name: GlobalEventHandlers.onkeypress
+ :url: "/API/GlobalEventHandlers/onkeypress"
+onkeyup:
+- :name: GlobalEventHandlers.onkeyup
+ :url: "/API/GlobalEventHandlers/onkeyup"
+- :name: GlobalEventHandlers.onkeyup
+ :url: "/API/GlobalEventHandlers/onkeyup"
+onlanguagechange:
+- :name: WindowEventHandlers.onlanguagechange
+ :url: "/API/WindowEventHandlers/onlanguagechange"
+onload:
+- :name: GlobalEventHandlers.onload
+ :url: "/API/GlobalEventHandlers/onload"
+- :name: GlobalEventHandlers.onload
+ :url: "/API/GlobalEventHandlers/onload"
+onmessage:
+- :name: WindowEventHandlers.onmessage
+ :url: "/API/WindowEventHandlers/onmessage"
+onmousedown:
+- :name: GlobalEventHandlers.onmousedown
+ :url: "/API/GlobalEventHandlers/onmousedown"
+- :name: GlobalEventHandlers.onmousedown
+ :url: "/API/GlobalEventHandlers/onmousedown"
+onmousemove:
+- :name: GlobalEventHandlers.onmousemove
+ :url: "/API/GlobalEventHandlers/onmousemove"
+- :name: GlobalEventHandlers.onmousemove
+ :url: "/API/GlobalEventHandlers/onmousemove"
+onmouseout:
+- :name: GlobalEventHandlers.onmouseout
+ :url: "/API/GlobalEventHandlers/onmouseout"
+- :name: GlobalEventHandlers.onmouseout
+ :url: "/API/GlobalEventHandlers/onmouseout"
+onmouseover:
+- :name: GlobalEventHandlers.onmouseover
+ :url: "/API/GlobalEventHandlers/onmouseover"
+- :name: GlobalEventHandlers.onmouseover
+ :url: "/API/GlobalEventHandlers/onmouseover"
+onmouseup:
+- :name: GlobalEventHandlers.onmouseup
+ :url: "/API/GlobalEventHandlers/onmouseup"
+- :name: GlobalEventHandlers.onmouseup
+ :url: "/API/GlobalEventHandlers/onmouseup"
+onmozbeforepaint:
+- :name: Window.onmozbeforepaint
+ :url: "/API/Window/onmozbeforepaint"
+onpaint:
+- :name: Window.onpaint
+ :url: "/API/Window/onpaint"
+onpopstate:
+- :name: WindowEventHandlers.onpopstate
+ :url: "/API/WindowEventHandlers/onpopstate"
+onrejectionhandled:
+- :name: Window.onrejectionhandled
+ :url: "/API/Window/onrejectionhandled"
+onreset:
+- :name: GlobalEventHandlers.onreset
+ :url: "/API/GlobalEventHandlers/onreset"
+- :name: GlobalEventHandlers.onreset
+ :url: "/API/GlobalEventHandlers/onreset"
+onresize:
+- :name: GlobalEventHandlers.onresize
+ :url: "/API/GlobalEventHandlers/onresize"
+onscroll:
+- :name: GlobalEventHandlers.onscroll
+ :url: "/API/GlobalEventHandlers/onscroll"
+- :name: GlobalEventHandlers.onscroll
+ :url: "/API/GlobalEventHandlers/onscroll"
+onwheel:
+- :name: GlobalEventHandlers.onwheel
+ :url: "/API/GlobalEventHandlers/onwheel"
+- :name: GlobalEventHandlers.onwheel
+ :url: "/API/GlobalEventHandlers/onwheel"
+onselect:
+- :name: GlobalEventHandlers.onselect
+ :url: "/API/GlobalEventHandlers/onselect"
+- :name: GlobalEventHandlers.onselect
+ :url: "/API/GlobalEventHandlers/onselect"
+onselectionchange:
+- :name: GlobalEventHandlers.onselectionchange
+ :url: "/API/GlobalEventHandlers/onselectionchange"
+- :name: Document.onselectionchange
+ :url: "/API/Document/onselectionchange"
+- :name: GlobalEventHandlers.onselectionchange
+ :url: "/API/GlobalEventHandlers/onselectionchange"
+onstorage:
+- :name: WindowEventHandlers.onstorage
+ :url: "/API/WindowEventHandlers/onstorage"
+onsubmit:
+- :name: GlobalEventHandlers.onsubmit
+ :url: "/API/GlobalEventHandlers/onsubmit"
+- :name: GlobalEventHandlers.onsubmit
+ :url: "/API/GlobalEventHandlers/onsubmit"
+onunhandledrejection:
+- :name: WindowEventHandlers.onunhandledrejection
+ :url: "/API/WindowEventHandlers/onunhandledrejection"
+onunload:
+- :name: WindowEventHandlers.onunload
+ :url: "/API/WindowEventHandlers/onunload"
+onuserproximity:
+- :name: Window.onuserproximity
+ :url: "/API/Window/onuserproximity"
+onvrdisplayconnect:
+- :name: Window.onvrdisplayconnect
+ :url: "/API/Window/onvrdisplayconnect"
+onvrdisplaydisconnect:
+- :name: Window.onvrdisplaydisconnect
+ :url: "/API/Window/onvrdisplaydisconnect"
+onvrdisplayactivate:
+- :name: Window.onvrdisplayactivate
+ :url: "/API/Window/onvrdisplayactivate"
+onvrdisplaydeactivate:
+- :name: Window.onvrdisplaydeactivate
+ :url: "/API/Window/onvrdisplaydeactivate"
+onvrdisplayblur:
+- :name: Window.onvrdisplayblur
+ :url: "/API/Window/onvrdisplayblur"
+onvrdisplayfocus:
+- :name: Window.onvrdisplayfocus
+ :url: "/API/Window/onvrdisplayfocus"
+onvrdisplaypresentchange:
+- :name: Window.onvrdisplaypresentchange
+ :url: "/API/Window/onvrdisplaypresentchange"
+DOMParser:
+- :name: DOMParser
+ :url: "/API/DOMParser"
+Option:
+- :name: Option
+ :url: "/API/Option"
+Worker:
+- :name: Worker
+ :url: "/API/Worker"
+async:
+- :name: Document.async
+ :url: "/API/Document/async"
+characterSet:
+- :name: Document.characterSet
+ :url: "/API/Document/characterSet"
+charset:
+- :name: Document.charset
+ :url: "/API/Document/charset"
+compatMode:
+- :name: Document.compatMode
+ :url: "/API/Document/compatMode"
+contentType:
+- :name: Document.contentType
+ :url: "/API/Document/contentType"
+doctype:
+- :name: Document.doctype
+ :url: "/API/Document/doctype"
+documentElement:
+- :name: Document.documentElement
+ :url: "/API/Document/documentElement"
+documentURI:
+- :name: Document.documentURI
+ :url: "/API/Document/documentURI"
+domConfig:
+- :name: Document.domConfig
+ :url: "/API/Document/domConfig"
+fullscreen:
+- :name: Document.fullscreen
+ :url: "/API/Document/fullscreen"
+implementation:
+- :name: Document.implementation
+ :url: "/API/Document/implementation"
+inputEncoding:
+- :name: Document.inputEncoding
+ :url: "/API/Document/inputEncoding"
+lastStyleSheetSet:
+- :name: Document.lastStyleSheetSet
+ :url: "/API/Document/lastStyleSheetSet"
+pointerLockElement:
+- :name: Document.pointerLockElement
+ :url: "/API/Document/pointerLockElement"
+preferredStyleSheetSet:
+- :name: Document.preferredStyleSheetSet
+ :url: "/API/Document/preferredStyleSheetSet"
+scrollingElement:
+- :name: Document.scrollingElement
+ :url: "/API/Document/scrollingElement"
+selectedStyleSheetSet:
+- :name: Document.selectedStyleSheetSet
+ :url: "/API/Document/selectedStyleSheetSet"
+styleSheets:
+- :name: Document.styleSheets
+ :url: "/API/Document/styleSheets"
+styleSheetSets:
+- :name: Document.styleSheetSets
+ :url: "/API/Document/styleSheetSets"
+timeline:
+- :name: Document.timeline
+ :url: "/API/Document/timeline"
+visibilityState:
+- :name: Document.visibilityState
+ :url: "/API/Document/visibilityState"
+xmlEncoding:
+- :name: Document.xmlEncoding
+ :url: "/API/Document/xmlEncoding"
+xmlVersion:
+- :name: Document.xmlVersion
+ :url: "/API/Document/xmlVersion"
+children:
+- :name: ParentNode.children
+ :url: "/API/ParentNode/children"
+firstElementChild:
+- :name: ParentNode.firstElementChild
+ :url: "/API/ParentNode/firstElementChild"
+lastElementChild:
+- :name: ParentNode.lastElementChild
+ :url: "/API/ParentNode/lastElementChild"
+childElementCount:
+- :name: ParentNode.childElementCount
+ :url: "/API/ParentNode/childElementCount"
+activeElement:
+- :name: Document.activeElement
+ :url: "/API/Document/activeElement"
+alinkColor:
+- :name: Document.alinkColor
+ :url: "/API/Document/alinkColor"
+anchors:
+- :name: Document.anchors
+ :url: "/API/Document/anchors"
+applets:
+- :name: Document.applets
+ :url: "/API/Document/applets"
+bgColor:
+- :name: Document.bgColor
+ :url: "/API/Document/bgColor"
+body:
+- :name: Document.body
+ :url: "/API/Document/body"
+cookie:
+- :name: Document.cookie
+ :url: "/API/Document/cookie"
+defaultView:
+- :name: Document.defaultView
+ :url: "/API/Document/defaultView"
+designMode:
+- :name: Document.designMode
+ :url: "/API/Document/designMode"
+domain:
+- :name: Document.domain
+ :url: "/API/Document/domain"
+embeds:
+- :name: Document.embeds
+ :url: "/API/Document/embeds"
+fgColor:
+- :name: document.fgColor
+ :url: "/API/Document/fgColor"
+forms:
+- :name: Document.forms
+ :url: "/API/Document/forms"
+head:
+- :name: Document.head
+ :url: "/API/Document/head"
+images:
+- :name: Document.images
+ :url: "/API/Document/images"
+lastModified:
+- :name: Document.lastModified
+ :url: "/API/Document/lastModified"
+linkColor:
+- :name: Document.linkColor
+ :url: "/API/Document/linkColor"
+links:
+- :name: Document.links
+ :url: "/API/Document/links"
+plugins:
+- :name: Document.plugins
+ :url: "/API/Document/plugins"
+readyState:
+- :name: Document.readyState
+ :url: "/API/Document/readyState"
+referrer:
+- :name: Document.referrer
+ :url: "/API/Document/referrer"
+scripts:
+- :name: Document.scripts
+ :url: "/API/Document/scripts"
+URL:
+- :name: Document.URL
+ :url: "/API/Document/URL"
+vlinkColor:
+- :name: Document.vlinkColor
+ :url: "/API/Document/vlinkColor"
+onfullscreenchange:
+- :name: Document.onfullscreenchange
+ :url: "/API/Document/onfullscreenchange"
+onfullscreenerror:
+- :name: Document.onfullscreenerror
+ :url: "/API/Document/onfullscreenerror"
+onvisibilitychange:
+- :name: Document.onvisibilitychange
+ :url: "/API/Document/onvisibilitychange"
+ondrag:
+- :name: GlobalEventHandlers.ondrag
+ :url: "/API/GlobalEventHandlers/ondrag"
+ondragend:
+- :name: GlobalEventHandlers.ondragend
+ :url: "/API/GlobalEventHandlers/ondragend"
+ondragenter:
+- :name: GlobalEventHandlers.ondragenter
+ :url: "/API/GlobalEventHandlers/ondragenter"
+ondragexit:
+- :name: GlobalEventHandlers.ondragexit
+ :url: "/API/GlobalEventHandlers/ondragexit"
+ondragleave:
+- :name: GlobalEventHandlers.ondragleave
+ :url: "/API/GlobalEventHandlers/ondragleave"
+ondragover:
+- :name: GlobalEventHandlers.ondragover
+ :url: "/API/GlobalEventHandlers/ondragover"
+ondragstart:
+- :name: GlobalEventHandlers.ondragstart
+ :url: "/API/GlobalEventHandlers/ondragstart"
+ondrop:
+- :name: GlobalEventHandlers.ondrop
+ :url: "/API/GlobalEventHandlers/ondrop"
+ongotpointercapture:
+- :name: GlobalEventHandlers.ongotpointercapture
+ :url: "/API/GlobalEventHandlers/ongotpointercapture"
+onloadend:
+- :name: GlobalEventHandlers.onloadend
+ :url: "/API/GlobalEventHandlers/onloadend"
+onloadstart:
+- :name: GlobalEventHandlers.onloadstart
+ :url: "/API/GlobalEventHandlers/onloadstart"
+onlostpointercapture:
+- :name: GlobalEventHandlers.onlostpointercapture
+ :url: "/API/GlobalEventHandlers/onlostpointercapture"
+onpointerdown:
+- :name: GlobalEventHandlers.onpointerdown
+ :url: "/API/GlobalEventHandlers/onpointerdown"
+onpointermove:
+- :name: GlobalEventHandlers.onpointermove
+ :url: "/API/GlobalEventHandlers/onpointermove"
+onpointerup:
+- :name: GlobalEventHandlers.onpointerup
+ :url: "/API/GlobalEventHandlers/onpointerup"
+onpointercancel:
+- :name: GlobalEventHandlers.onpointercancel
+ :url: "/API/GlobalEventHandlers/onpointercancel"
+onpointerover:
+- :name: GlobalEventHandlers.onpointerover
+ :url: "/API/GlobalEventHandlers/onpointerover"
+onpointerout:
+- :name: GlobalEventHandlers.onpointerout
+ :url: "/API/GlobalEventHandlers/onpointerout"
+onpointerenter:
+- :name: GlobalEventHandlers.onpointerenter
+ :url: "/API/GlobalEventHandlers/onpointerenter"
+onpointerleave:
+- :name: GlobalEventHandlers.onpointerleave
+ :url: "/API/GlobalEventHandlers/onpointerleave"
+onselectstart:
+- :name: GlobalEventHandlers.onselectstart
+ :url: "/API/GlobalEventHandlers/onselectstart"
+ontouchcancel:
+- :name: GlobalEventHandlers.ontouchcancel
+ :url: "/API/GlobalEventHandlers/ontouchcancel"
+ontouchend:
+- :name: GlobalEventHandlers.ontouchend
+ :url: "/API/GlobalEventHandlers/ontouchend"
+ontouchmove:
+- :name: GlobalEventHandlers.ontouchmove
+ :url: "/API/GlobalEventHandlers/ontouchmove"
+ontouchstart:
+- :name: GlobalEventHandlers.ontouchstart
+ :url: "/API/GlobalEventHandlers/ontouchstart"
+ontransitioncancel:
+- :name: GlobalEventHandlers.ontransitioncancel
+ :url: "/API/GlobalEventHandlers/ontransitioncancel"
+ontransitionend:
+- :name: GlobalEventHandlers.ontransitionend
+ :url: "/API/GlobalEventHandlers/ontransitionend"
+adoptNode:
+- :name: Document.adoptNode()
+ :url: "/API/Document/adoptNode"
+caretPositionFromPoint:
+- :name: Document.caretPositionFromPoint()
+ :url: "/API/Document/caretPositionFromPoint"
+createAttribute:
+- :name: Document.createAttribute()
+ :url: "/API/Document/createAttribute"
+createCDATASection:
+- :name: Document.createCDATASection()
+ :url: "/API/Document/createCDATASection"
+createComment:
+- :name: Document.createComment()
+ :url: "/API/Document/createComment"
+createDocumentFragment:
+- :name: Document.createDocumentFragment()
+ :url: "/API/Document/createDocumentFragment"
+createElement:
+- :name: Document.createElement()
+ :url: "/API/Document/createElement"
+createElementNS:
+- :name: Document.createElementNS()
+ :url: "/API/Document/createElementNS"
+createEntityReference:
+- :name: Document.createEntityReference()
+ :url: "/API/Document/createEntityReference"
+createEvent:
+- :name: Document.createEvent()
+ :url: "/API/Document/createEvent"
+createNodeIterator:
+- :name: Document.createNodeIterator()
+ :url: "/API/Document/createNodeIterator"
+createProcessingInstruction:
+- :name: Document.createProcessingInstruction()
+ :url: "/API/Document/createProcessingInstruction"
+createRange:
+- :name: Document.createRange()
+ :url: "/API/Document/createRange"
+createTextNode:
+- :name: Document.createTextNode()
+ :url: "/API/Document/createTextNode"
+createTouch:
+- :name: Document.createTouch()
+ :url: "/API/Document/createTouch"
+createTouchList:
+- :name: Document.createTouchList()
+ :url: "/API/Document/createTouchList"
+createTreeWalker:
+- :name: Document.createTreeWalker()
+ :url: "/API/Document/createTreeWalker"
+elementFromPoint:
+- :name: Document.elementFromPoint()
+ :url: "/API/Document/elementFromPoint"
+elementsFromPoint:
+- :name: Document.elementsFromPoint()
+ :url: "/API/Document/elementsFromPoint"
+enableStyleSheetsForSet:
+- :name: Document.enableStyleSheetsForSet()
+ :url: "/API/Document/enableStyleSheetsForSet"
+exitPointerLock:
+- :name: Document.exitPointerLock()
+ :url: "/API/Document/exitPointerLock"
+getAnimations:
+- :name: Document.getAnimations()
+ :url: "/API/Document/getAnimations"
+getElementsByClassName:
+- :name: Document.getElementsByClassName()
+ :url: "/API/Document/getElementsByClassName"
+getElementsByTagName:
+- :name: Document.getElementsByTagName()
+ :url: "/API/Document/getElementsByTagName"
+getElementsByTagNameNS:
+- :name: Document.getElementsByTagNameNS()
+ :url: "/API/Document/getElementsByTagNameNS"
+importNode:
+- :name: Document.importNode()
+ :url: "/API/Document/importNode"
+registerElement:
+- :name: Document.registerElement()
+ :url: "/API/Document/registerElement"
+getElementById:
+- :name: document.getElementById(String id)
+ :url: "/API/Document/getElementById"
+querySelector:
+- :name: document.querySelector(String selector)
+ :url: "/API/Document/querySelector"
+querySelectorAll:
+- :name: document.querySelectorAll(String selector)
+ :url: "/API/Document/querySelectorAll"
+createExpression:
+- :name: document.createExpression(String expression, XPathNSResolver resolver)
+ :url: "/API/Document/createExpression"
+createNSResolver:
+- :name: document.createNSResolver(Node resolver)
+ :url: "/API/Document/createNSResolver"
+evaluate:
+- :name: document.evaluate(String expression, Node contextNode, XPathNSResolver resolver,
+ Number type, Object result)
+ :url: "/API/Document/evaluate"
+execCommand:
+- :name: document.execCommand(String command[, Boolean showUI[, String value]])
+ :url: "/API/Document/execCommand"
+getElementsByName:
+- :name: document.getElementsByName(String name)
+ :url: "/API/Document/getElementsByName"
+hasFocus:
+- :name: document.hasFocus()
+ :url: "/API/Document/hasFocus"
+queryCommandEnabled:
+- :name: document.queryCommandEnabled(String command)
+ :url: "/API/Document/queryCommandEnabled"
+queryCommandState:
+- :name: document.queryCommandState(String command)
+ :url: "/API/Document/queryCommandState"
+queryCommandSupported:
+- :name: document.queryCommandSupported(String command)
+ :url: "/API/Document/queryCommandSupported"
+write:
+- :name: document.write(String text)
+ :url: "/API/Document/write"
+writeln:
+- :name: document.writeln(String text)
+ :url: "/API/Document/writeln"
+documentURIObject:
+- :name: document.documentURIObject
+ :url: "/API/Document/documentURIObject"
+popupNode:
+- :name: document.popupNode
+ :url: "/API/Document/popupNode"
+tooltipNode:
+- :name: document.tooltipNode
+ :url: "/API/Document/tooltipNode"
+getBoxObjectFor:
+- :name: document.getBoxObjectFor
+ :url: "/API/Document/getBoxObjectFor"
+loadOverlay:
+- :name: document.loadOverlay
+ :url: "/API/Document/loadOverlay"
+Node:
+- :name: Node
+ :url: "/API/Node"
+baseURI:
+- :name: Node.baseURI
+ :url: "/API/Node/baseURI"
+childNodes:
+- :name: Node.childNodes
+ :url: "/API/Node/childNodes"
+firstChild:
+- :name: Node.firstChild
+ :url: "/API/Node/firstChild"
+lastChild:
+- :name: Node.lastChild
+ :url: "/API/Node/lastChild"
+nextSibling:
+- :name: Node.nextSibling
+ :url: "/API/Node/nextSibling"
+nodeName:
+- :name: Node.nodeName
+ :url: "/API/Node/nodeName"
+nodeType:
+- :name: Node.nodeType
+ :url: "/API/Node/nodeType"
+nodeValue:
+- :name: Node.nodeValue
+ :url: "/API/Node/nodeValue"
+ownerDocument:
+- :name: Node.ownerDocument
+ :url: "/API/Node/ownerDocument"
+parentNode:
+- :name: Node.parentNode
+ :url: "/API/Node/parentNode"
+parentElement:
+- :name: Node.parentElement
+ :url: "/API/Node/parentElement"
+previousSibling:
+- :name: Node.previousSibling
+ :url: "/API/Node/previousSibling"
+textContent:
+- :name: Node.textContent
+ :url: "/API/Node/textContent"
+rootNode:
+- :name: Node.rootNode
+ :url: "/API/Node/rootNode"
+localName:
+- :name: Node.localName
+ :url: "/API/Node/localName"
+namespaceURI:
+- :name: Node.namespaceURI
+ :url: "/API/Node/namespaceURI"
+prefix:
+- :name: Node.prefix
+ :url: "/API/Node/prefix"
+appendChild:
+- :name: Node.appendChild()
+ :url: "/API/Node/appendChild"
+cloneNode:
+- :name: Node.cloneNode()
+ :url: "/API/Node/cloneNode"
+compareDocumentPosition:
+- :name: Node.compareDocumentPosition()
+ :url: "/API/Node/compareDocumentPosition"
+contains:
+- :name: Node.contains()
+ :url: "/API/Node/contains"
+getRootNode:
+- :name: Node.getRootNode()
+ :url: "/API/Node/getRootNode"
+hasChildNodes:
+- :name: Node.hasChildNodes()
+ :url: "/API/Node/hasChildNodes"
+insertBefore:
+- :name: Node.insertBefore()
+ :url: "/API/Node/insertBefore"
+isDefaultNamespace:
+- :name: Node.isDefaultNamespace()
+ :url: "/API/Node/isDefaultNamespace"
+isEqualNode:
+- :name: Node.isEqualNode()
+ :url: "/API/Node/isEqualNode"
+isSameNode:
+- :name: Node.isSameNode()
+ :url: "/API/Node/isSameNode"
+lookupPrefix:
+- :name: Node.lookupPrefix()
+ :url: "/API/Node/lookupPrefix"
+lookupNamespaceURI:
+- :name: Node.lookupNamespaceURI()
+ :url: "/API/Node/lookupNamespaceURI"
+normalize:
+- :name: Node.normalize()
+ :url: "/API/Node/normalize"
+- :name: String.prototype.normalize()
+ :url: "/JavaScript/Reference/Global_Objects/String/normalize"
+removeChild:
+- :name: Node.removeChild()
+ :url: "/API/Node/removeChild"
+replaceChild:
+- :name: Node.replaceChild()
+ :url: "/API/Node/replaceChild"
+getUserData:
+- :name: Node.getUserData()
+ :url: "/API/Node/getUserData"
+isSupported:
+- :name: Node.isSupported()
+ :url: "/API/Node/isSupported"
+setUserData:
+- :name: Node.setUserData()
+ :url: "/API/Node/setUserData"
+Event:
+- :name: Event
+ :url: "/API/Event"
+- :name: Event()
+ :url: "/API/Event/Event"
+bubbles:
+- :name: Event.bubbles
+ :url: "/API/Event/bubbles"
+cancelBubble:
+- :name: Event.cancelBubble
+ :url: "/API/Event/cancelBubble"
+cancelable:
+- :name: Event.cancelable
+ :url: "/API/Event/cancelable"
+composed:
+- :name: Event.composed
+ :url: "/API/Event/composed"
+currentTarget:
+- :name: Event.currentTarget
+ :url: "/API/Event/currentTarget"
+defaultPrevented:
+- :name: Event.defaultPrevented
+ :url: "/API/Event/defaultPrevented"
+eventPhase:
+- :name: Event.eventPhase
+ :url: "/API/Event/eventPhase"
+scoped:
+- :name: Event.scoped
+ :url: "/API/Event/scoped"
+target:
+- :name: Event.target
+ :url: "/API/Event/target"
+timeStamp:
+- :name: Event.timeStamp
+ :url: "/API/Event/timeStamp"
+type:
+- :name: Event.type
+ :url: "/API/Event/type"
+isTrusted:
+- :name: Event.isTrusted
+ :url: "/API/Event/isTrusted"
+initEvent:
+- :name: Event.initEvent()
+ :url: "/API/Event/initEvent"
+preventDefault:
+- :name: Event.preventDefault()
+ :url: "/API/Event/preventDefault"
+stopImmediatePropagation:
+- :name: Event.stopImmediatePropagation()
+ :url: "/API/Event/stopImmediatePropagation"
+stopPropagation:
+- :name: Event.stopPropagation()
+ :url: "/API/Event/stopPropagation"
+HTMLCollection:
+- :name: HTMLCollection
+ :url: "/API/HTMLCollection"
+item:
+- :name: HTMLCollection.item()
+ :url: "/API/HTMLCollection/item"
+Array:
+- :name: Array
+ :url: "/JavaScript/Reference/Global_Objects/Array"
+get Array[@@species]:
+- :name: get Array[@@species]
+ :url: "/JavaScript/Reference/Global_Objects/Array/@@species"
+prototype:
+- :name: Array.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Array/prototype"
+- :name: Date.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Date/prototype"
+- :name: Error.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Error/prototype"
+- :name: Boolean.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Boolean/prototype"
+- :name: Map.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Map/prototype"
+- :name: Number.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Number/prototype"
+- :name: Object.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Object/prototype"
+- :name: Promise.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Promise/prototype"
+- :name: RangeError.prototype
+ :url: "/JavaScript/Reference/Global_Objects/RangeError/prototype"
+- :name: ReferenceError.prototype
+ :url: "/JavaScript/Reference/Global_Objects/ReferenceError/prototype"
+- :name: RegExp.prototype
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/prototype"
+- :name: Set.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Set/prototype"
+- :name: String.prototype
+ :url: "/JavaScript/Reference/Global_Objects/String/prototype"
+- :name: Symbol.prototype
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/prototype"
+- :name: SyntaxError.prototype
+ :url: "/JavaScript/Reference/Global_Objects/SyntaxError/prototype"
+- :name: TypeError.prototype
+ :url: "/JavaScript/Reference/Global_Objects/TypeError/prototype"
+- :name: WeakMap.prototype
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/prototype"
+- :name: WeakSet.prototype
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet/prototype"
+from:
+- :name: Array.from()
+ :url: "/JavaScript/Reference/Global_Objects/Array/from"
+isArray:
+- :name: Array.isArray()
+ :url: "/JavaScript/Reference/Global_Objects/Array/isArray"
+of:
+- :name: Array.of()
+ :url: "/JavaScript/Reference/Global_Objects/Array/of"
+Date:
+- :name: Date
+ :url: "/JavaScript/Reference/Global_Objects/Date"
+now:
+- :name: Date.now()
+ :url: "/JavaScript/Reference/Global_Objects/Date/now"
+parse:
+- :name: Date.parse()
+ :url: "/JavaScript/Reference/Global_Objects/Date/parse"
+- :name: JSON.parse()
+ :url: "/JavaScript/Reference/Global_Objects/JSON/parse"
+UTC:
+- :name: Date.UTC()
+ :url: "/JavaScript/Reference/Global_Objects/Date/UTC"
+getDate:
+- :name: Date.prototype.getDate()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getDate"
+getDay:
+- :name: Date.prototype.getDay()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getDay"
+getFullYear:
+- :name: Date.prototype.getFullYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getFullYear"
+getHours:
+- :name: Date.prototype.getHours()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getHours"
+getMilliseconds:
+- :name: Date.prototype.getMilliseconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getMilliseconds"
+getMinutes:
+- :name: Date.prototype.getMinutes()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getMinutes"
+getMonth:
+- :name: Date.prototype.getMonth()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getMonth"
+getSeconds:
+- :name: Date.prototype.getSeconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getSeconds"
+getTime:
+- :name: Date.prototype.getTime()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getTime"
+getTimezoneOffset:
+- :name: Date.prototype.getTimezoneOffset()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset"
+getUTCDate:
+- :name: Date.prototype.getUTCDate()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCDate"
+getUTCDay:
+- :name: Date.prototype.getUTCDay()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCDay"
+getUTCFullYear:
+- :name: Date.prototype.getUTCFullYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCFullYear"
+getUTCHours:
+- :name: Date.prototype.getUTCHours()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCHours"
+getUTCMilliseconds:
+- :name: Date.prototype.getUTCMilliseconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds"
+getUTCMinutes:
+- :name: Date.prototype.getUTCMinutes()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCMinutes"
+getUTCMonth:
+- :name: Date.prototype.getUTCMonth()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCMonth"
+getUTCSeconds:
+- :name: Date.prototype.getUTCSeconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getUTCSeconds"
+getYear:
+- :name: Date.prototype.getYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/getYear"
+setDate:
+- :name: Date.prototype.setDate()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setDate"
+setFullYear:
+- :name: Date.prototype.setFullYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setFullYear"
+setHours:
+- :name: Date.prototype.setHours()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setHours"
+setMilliseconds:
+- :name: Date.prototype.setMilliseconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setMilliseconds"
+setMinutes:
+- :name: Date.prototype.setMinutes()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setMinutes"
+setMonth:
+- :name: Date.prototype.setMonth()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setMonth"
+setSeconds:
+- :name: Date.prototype.setSeconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setSeconds"
+setTime:
+- :name: Date.prototype.setTime()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setTime"
+setUTCDate:
+- :name: Date.prototype.setUTCDate()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCDate"
+setUTCFullYear:
+- :name: Date.prototype.setUTCFullYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCFullYear"
+setUTCHours:
+- :name: Date.prototype.setUTCHours()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCHours"
+setUTCMilliseconds:
+- :name: Date.prototype.setUTCMilliseconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds"
+setUTCMinutes:
+- :name: Date.prototype.setUTCMinutes()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCMinutes"
+setUTCMonth:
+- :name: Date.prototype.setUTCMonth()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCMonth"
+setUTCSeconds:
+- :name: Date.prototype.setUTCSeconds()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setUTCSeconds"
+setYear:
+- :name: Date.prototype.setYear()
+ :url: "/JavaScript/Reference/Global_Objects/Date/setYear"
+toDateString:
+- :name: Date.prototype.toDateString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toDateString"
+toISOString:
+- :name: Date.prototype.toISOString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toISOString"
+toJSON:
+- :name: Date.prototype.toJSON()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toJSON"
+toGMTString:
+- :name: Date.prototype.toGMTString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toGMTString"
+toLocaleDateString:
+- :name: Date.prototype.toLocaleDateString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toLocaleDateString"
+toLocaleTimeString:
+- :name: Date.prototype.toLocaleTimeString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString"
+toTimeString:
+- :name: Date.prototype.toTimeString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toTimeString"
+toUTCString:
+- :name: Date.prototype.toUTCString()
+ :url: "/JavaScript/Reference/Global_Objects/Date/toUTCString"
+valueOf:
+- :name: Date.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/Date/valueOf"
+- :name: Boolean.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/Boolean/valueOf"
+- :name: Number.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/Number/valueOf"
+- :name: Object.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/Object/valueOf"
+- :name: String.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/String/valueOf"
+- :name: Symbol.prototype.valueOf()
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/valueOf"
+Function:
+- :name: Function
+ :url: "/JavaScript/Reference/Global_Objects/Function"
+arguments:
+- :name: Function.arguments
+ :url: "/JavaScript/Reference/Global_Objects/Function/arguments"
+arity:
+- :name: Function.arity
+ :url: "/JavaScript/Reference/Global_Objects/Function/arity"
+apply:
+- :name: Function.prototype.apply()
+ :url: "/JavaScript/Reference/Global_Objects/Function/apply"
+- :name: handler.apply()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/apply"
+bind:
+- :name: Function.prototype.bind()
+ :url: "/JavaScript/Reference/Global_Objects/Function/bind"
+call:
+- :name: Function.prototype.call()
+ :url: "/JavaScript/Reference/Global_Objects/Function/call"
+Error:
+- :name: Error
+ :url: "/JavaScript/Reference/Global_Objects/Error"
+EvalError:
+- :name: EvalError
+ :url: "/JavaScript/Reference/Global_Objects/EvalError"
+RangeError:
+- :name: RangeError
+ :url: "/JavaScript/Reference/Global_Objects/RangeError"
+- :name: RangeError
+ :url: "/JavaScript/Reference/Global_Objects/RangeError"
+ReferenceError:
+- :name: ReferenceError
+ :url: "/JavaScript/Reference/Global_Objects/ReferenceError"
+- :name: ReferenceError
+ :url: "/JavaScript/Reference/Global_Objects/ReferenceError"
+SyntaxError:
+- :name: SyntaxError
+ :url: "/JavaScript/Reference/Global_Objects/SyntaxError"
+- :name: SyntaxError
+ :url: "/JavaScript/Reference/Global_Objects/SyntaxError"
+TypeError:
+- :name: TypeError
+ :url: "/JavaScript/Reference/Global_Objects/TypeError"
+- :name: TypeError
+ :url: "/JavaScript/Reference/Global_Objects/TypeError"
+URIError:
+- :name: URIError
+ :url: "/JavaScript/Reference/Global_Objects/URIError"
+message:
+- :name: Error.prototype.message
+ :url: "/JavaScript/Reference/Global_Objects/Error/message"
+- :name: RangeError.prototype.message
+ :url: "/JavaScript/Reference/Global_Objects/Error/message"
+- :name: ReferenceError.prototype.message
+ :url: "/JavaScript/Reference/Global_Objects/Error/message"
+- :name: SyntaxError.prototype.message
+ :url: "/JavaScript/Reference/Global_Objects/Error/message"
+- :name: TypeError.prototype.message
+ :url: "/JavaScript/Reference/Global_Objects/Error/message"
+fileName:
+- :name: Error.prototype.fileName
+ :url: "/JavaScript/Reference/Global_Objects/Error/fileName"
+- :name: RangeError.prototype.fileName
+ :url: "/JavaScript/Reference/Global_Objects/Error/fileName"
+- :name: ReferenceError.prototype.fileName
+ :url: "/JavaScript/Reference/Global_Objects/Error/fileName"
+- :name: SyntaxError.prototype.fileName
+ :url: "/JavaScript/Reference/Global_Objects/Error/fileName"
+- :name: TypeError.prototype.fileName
+ :url: "/JavaScript/Reference/Global_Objects/Error/fileName"
+lineNumber:
+- :name: Error.prototype.lineNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/lineNumber"
+- :name: RangeError.prototype.lineNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/lineNumber"
+- :name: ReferenceError.prototype.lineNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/lineNumber"
+- :name: SyntaxError.prototype.lineNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/lineNumber"
+- :name: TypeError.prototype.lineNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/lineNumber"
+columnNumber:
+- :name: Error.prototype.columnNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/columnNumber"
+- :name: RangeError.prototype.columnNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/columnNumber"
+- :name: ReferenceError.prototype.columnNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/columnNumber"
+- :name: SyntaxError.prototype.columnNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/columnNumber"
+- :name: TypeError.prototype.columnNumber
+ :url: "/JavaScript/Reference/Global_Objects/Error/columnNumber"
+stack:
+- :name: Error.prototype.stack
+ :url: "/JavaScript/Reference/Global_Objects/Error/stack"
+- :name: RangeError.prototype.stack
+ :url: "/JavaScript/Reference/Global_Objects/Error/stack"
+- :name: ReferenceError.prototype.stack
+ :url: "/JavaScript/Reference/Global_Objects/Error/stack"
+- :name: SyntaxError.prototype.stack
+ :url: "/JavaScript/Reference/Global_Objects/Error/stack"
+- :name: TypeError.prototype.stack
+ :url: "/JavaScript/Reference/Global_Objects/Error/stack"
+Boolean:
+- :name: Boolean
+ :url: "/JavaScript/Reference/Global_Objects/Boolean"
+JSON:
+- :name: JSON
+ :url: "/JavaScript/Reference/Global_Objects/JSON"
+stringify:
+- :name: JSON.stringify()
+ :url: "/JavaScript/Reference/Global_Objects/JSON/stringify"
+Map:
+- :name: Map
+ :url: "/JavaScript/Reference/Global_Objects/Map"
+get Map[@@species]:
+- :name: get Map[@@species]
+ :url: "/JavaScript/Reference/Global_Objects/Map/@@species"
+size:
+- :name: Map.prototype.size
+ :url: "/JavaScript/Reference/Global_Objects/Map/size"
+- :name: Set.prototype.size
+ :url: "/JavaScript/Reference/Global_Objects/Set/size"
+clear:
+- :name: Map.prototype.clear()
+ :url: "/JavaScript/Reference/Global_Objects/Map/clear"
+- :name: Set.prototype.clear()
+ :url: "/JavaScript/Reference/Global_Objects/Set/clear"
+- :name: WeakMap.prototype.clear()
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/clear"
+- :name: WeakSet.prototype.clear()
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet/clear"
+has:
+- :name: Map.prototype.has(key)
+ :url: "/JavaScript/Reference/Global_Objects/Map/has"
+- :name: handler.has()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/has"
+- :name: Set.prototype.has(value)
+ :url: "/JavaScript/Reference/Global_Objects/Set/has"
+- :name: WeakMap.prototype.has(key)
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap/has"
+- :name: WeakSet.prototype.has(value)
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet/has"
+Number:
+- :name: Number
+ :url: "/JavaScript/Reference/Global_Objects/Number"
+EPSILON:
+- :name: Number.EPSILON
+ :url: "/JavaScript/Reference/Global_Objects/Number/EPSILON"
+MAX_SAFE_INTEGER:
+- :name: Number.MAX_SAFE_INTEGER
+ :url: "/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER"
+MAX_VALUE:
+- :name: Number.MAX_VALUE
+ :url: "/JavaScript/Reference/Global_Objects/Number/MAX_VALUE"
+MIN_SAFE_INTEGER:
+- :name: Number.MIN_SAFE_INTEGER
+ :url: "/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER"
+MIN_VALUE:
+- :name: Number.MIN_VALUE
+ :url: "/JavaScript/Reference/Global_Objects/Number/MIN_VALUE"
+NEGATIVE_INFINITY:
+- :name: Number.NEGATIVE_INFINITY
+ :url: "/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY"
+POSITIVE_INFINITY:
+- :name: Number.POSITIVE_INFINITY
+ :url: "/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY"
+isInteger:
+- :name: Number.isInteger()
+ :url: "/JavaScript/Reference/Global_Objects/Number/isInteger"
+isSafeInteger:
+- :name: Number.isSafeInteger()
+ :url: "/JavaScript/Reference/Global_Objects/Number/isSafeInteger"
+toInteger:
+- :name: Number.toInteger()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toInteger"
+toExponential:
+- :name: Number.prototype.toExponential()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toExponential"
+toFixed:
+- :name: Number.prototype.toFixed()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toFixed"
+toPrecision:
+- :name: Number.prototype.toPrecision()
+ :url: "/JavaScript/Reference/Global_Objects/Number/toPrecision"
+Object:
+- :name: Object
+ :url: "/JavaScript/Reference/Global_Objects/Object"
+assign:
+- :name: Object.assign()
+ :url: "/JavaScript/Reference/Global_Objects/Object/assign"
+create:
+- :name: Object.create()
+ :url: "/JavaScript/Reference/Global_Objects/Object/create"
+defineProperty:
+- :name: Object.defineProperty()
+ :url: "/JavaScript/Reference/Global_Objects/Object/defineProperty"
+- :name: handler.defineProperty()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty"
+defineProperties:
+- :name: Object.defineProperties()
+ :url: "/JavaScript/Reference/Global_Objects/Object/defineProperties"
+freeze:
+- :name: Object.freeze()
+ :url: "/JavaScript/Reference/Global_Objects/Object/freeze"
+getOwnPropertyDescriptor:
+- :name: Object.getOwnPropertyDescriptor()
+ :url: "/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor"
+- :name: handler.getOwnPropertyDescriptor()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor"
+getOwnPropertyDescriptors:
+- :name: Object.getOwnPropertyDescriptors()
+ :url: "/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors"
+getOwnPropertyNames:
+- :name: Object.getOwnPropertyNames()
+ :url: "/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames"
+getOwnPropertySymbols:
+- :name: Object.getOwnPropertySymbols()
+ :url: "/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols"
+getPrototypeOf:
+- :name: Object.getPrototypeOf()
+ :url: "/JavaScript/Reference/Global_Objects/Object/getPrototypeOf"
+- :name: handler.getPrototypeOf()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf"
+is:
+- :name: Object.is()
+ :url: "/JavaScript/Reference/Global_Objects/Object/is"
+isExtensible:
+- :name: Object.isExtensible()
+ :url: "/JavaScript/Reference/Global_Objects/Object/isExtensible"
+- :name: handler.isExtensible()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible"
+isFrozen:
+- :name: Object.isFrozen()
+ :url: "/JavaScript/Reference/Global_Objects/Object/isFrozen"
+isSealed:
+- :name: Object.isSealed()
+ :url: "/JavaScript/Reference/Global_Objects/Object/isSealed"
+preventExtensions:
+- :name: Object.preventExtensions()
+ :url: "/JavaScript/Reference/Global_Objects/Object/preventExtensions"
+- :name: handler.preventExtensions()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions"
+seal:
+- :name: Object.seal()
+ :url: "/JavaScript/Reference/Global_Objects/Object/seal"
+setPrototypeOf:
+- :name: Object.setPrototypeOf()
+ :url: "/JavaScript/Reference/Global_Objects/Object/setPrototypeOf"
+- :name: handler.setPrototypeOf()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf"
+constructor:
+- :name: Object.prototype.constructor
+ :url: "/JavaScript/Reference/Global_Objects/Object/constructor"
+__count__:
+- :name: Object.prototype.__count__
+ :url: "/JavaScript/Reference/Global_Objects/Object/count"
+__parent__:
+- :name: Object.prototype.__parent__
+ :url: "/JavaScript/Reference/Global_Objects/Object/parent"
+hasOwnProperty:
+- :name: Object.prototype.hasOwnProperty()
+ :url: "/JavaScript/Reference/Global_Objects/Object/hasOwnProperty"
+isPrototypeOf:
+- :name: Object.prototype.isPrototypeOf()
+ :url: "/JavaScript/Reference/Global_Objects/Object/isPrototypeOf"
+propertyIsEnumerable:
+- :name: Object.prototype.propertyIsEnumerable()
+ :url: "/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable"
+Promise:
+- :name: Promise
+ :url: "/JavaScript/Reference/Global_Objects/Promise"
+all:
+- :name: Promise.all(iterable)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/all"
+race:
+- :name: Promise.race(iterable)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/race"
+reject:
+- :name: Promise.reject(reason)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/reject"
+resolve:
+- :name: Promise.resolve(value)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/resolve"
+catch:
+- :name: Promise.prototype.catch(onRejected)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/catch"
+then:
+- :name: Promise.prototype.then(onFulfilled, onRejected)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/then"
+finally:
+- :name: Promise.prototype.finally(onFinally)
+ :url: "/JavaScript/Reference/Global_Objects/Promise/finally"
+Proxy:
+- :name: Proxy
+ :url: "/JavaScript/Reference/Global_Objects/Proxy"
+revocable:
+- :name: Proxy.revocable()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/revocable"
+deleteProperty:
+- :name: handler.deleteProperty()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty"
+ownKeys:
+- :name: handler.ownKeys()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys"
+construct:
+- :name: handler.construct()
+ :url: "/JavaScript/Reference/Global_Objects/Proxy/handler/construct"
+RegExp:
+- :name: RegExp
+ :url: "/JavaScript/Reference/Global_Objects/RegExp"
+get RegExp[@@species]:
+- :name: get RegExp[@@species]
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/@@species"
+lastIndex:
+- :name: RegExp.lastIndex
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/lastIndex"
+flags:
+- :name: RegExp.prototype.flags
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/flags"
+global:
+- :name: RegExp.prototype.global
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/global"
+ignoreCase:
+- :name: RegExp.prototype.ignoreCase
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/ignoreCase"
+multiline:
+- :name: RegExp.prototype.multiline
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/multiline"
+source:
+- :name: RegExp.prototype.source
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/source"
+sticky:
+- :name: RegExp.prototype.sticky
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/sticky"
+unicode:
+- :name: RegExp.prototype.unicode
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/unicode"
+compile:
+- :name: RegExp.prototype.compile()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/compile"
+exec:
+- :name: RegExp.prototype.exec()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/exec"
+test:
+- :name: RegExp.prototype.test()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/test"
+prototype[@@match]:
+- :name: RegExp.prototype[@@match]()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/@@match"
+prototype[@@replace]:
+- :name: RegExp.prototype[@@replace]()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/@@replace"
+prototype[@@search]:
+- :name: RegExp.prototype[@@search]()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/@@search"
+prototype[@@split]:
+- :name: RegExp.prototype[@@split]()
+ :url: "/JavaScript/Reference/Global_Objects/RegExp/@@split"
+Set:
+- :name: Set
+ :url: "/JavaScript/Reference/Global_Objects/Set"
+get Set[@@species]:
+- :name: get Set[@@species]
+ :url: "/JavaScript/Reference/Global_Objects/Set/@@species"
+add:
+- :name: Set.prototype.add(value)
+ :url: "/JavaScript/Reference/Global_Objects/Set/add"
+- :name: WeakSet.prototype.add(value)
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet/add"
+String:
+- :name: String
+ :url: "/JavaScript/Reference/Global_Objects/String"
+fromCharCode:
+- :name: String.fromCharCode()
+ :url: "/JavaScript/Reference/Global_Objects/String/fromCharCode"
+fromCodePoint:
+- :name: String.fromCodePoint()
+ :url: "/JavaScript/Reference/Global_Objects/String/fromCodePoint"
+raw:
+- :name: String.raw()
+ :url: "/JavaScript/Reference/Global_Objects/String/raw"
+charAt:
+- :name: String.prototype.charAt()
+ :url: "/JavaScript/Reference/Global_Objects/String/charAt"
+charCodeAt:
+- :name: String.prototype.charCodeAt()
+ :url: "/JavaScript/Reference/Global_Objects/String/charCodeAt"
+codePointAt:
+- :name: String.prototype.codePointAt()
+ :url: "/JavaScript/Reference/Global_Objects/String/codePointAt"
+endsWith:
+- :name: String.prototype.endsWith()
+ :url: "/JavaScript/Reference/Global_Objects/String/endsWith"
+localeCompare:
+- :name: String.prototype.localeCompare()
+ :url: "/JavaScript/Reference/Global_Objects/String/localeCompare"
+match:
+- :name: String.prototype.match()
+ :url: "/JavaScript/Reference/Global_Objects/String/match"
+- :name: Symbol.match
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/match"
+padEnd:
+- :name: String.prototype.padEnd()
+ :url: "/JavaScript/Reference/Global_Objects/String/padEnd"
+padStart:
+- :name: String.prototype.padStart()
+ :url: "/JavaScript/Reference/Global_Objects/String/padStart"
+quote:
+- :name: String.prototype.quote()
+ :url: "/JavaScript/Reference/Global_Objects/String/quote"
+repeat:
+- :name: String.prototype.repeat()
+ :url: "/JavaScript/Reference/Global_Objects/String/repeat"
+replace:
+- :name: String.prototype.replace()
+ :url: "/JavaScript/Reference/Global_Objects/String/replace"
+- :name: Symbol.replace
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/replace"
+search:
+- :name: String.prototype.search()
+ :url: "/JavaScript/Reference/Global_Objects/String/search"
+- :name: Symbol.search
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/search"
+split:
+- :name: String.prototype.split()
+ :url: "/JavaScript/Reference/Global_Objects/String/split"
+- :name: Symbol.split
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/split"
+startsWith:
+- :name: String.prototype.startsWith()
+ :url: "/JavaScript/Reference/Global_Objects/String/startsWith"
+substr:
+- :name: String.prototype.substr()
+ :url: "/JavaScript/Reference/Global_Objects/String/substr"
+substring:
+- :name: String.prototype.substring()
+ :url: "/JavaScript/Reference/Global_Objects/String/substring"
+toLocaleLowerCase:
+- :name: String.prototype.toLocaleLowerCase()
+ :url: "/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase"
+toLocaleUpperCase:
+- :name: String.prototype.toLocaleUpperCase()
+ :url: "/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase"
+toLowerCase:
+- :name: String.prototype.toLowerCase()
+ :url: "/JavaScript/Reference/Global_Objects/String/toLowerCase"
+toUpperCase:
+- :name: String.prototype.toUpperCase()
+ :url: "/JavaScript/Reference/Global_Objects/String/toUpperCase"
+trim:
+- :name: String.prototype.trim()
+ :url: "/JavaScript/Reference/Global_Objects/String/trim"
+anchor:
+- :name: String.prototype.anchor()
+ :url: "/JavaScript/Reference/Global_Objects/String/anchor"
+big:
+- :name: String.prototype.big()
+ :url: "/JavaScript/Reference/Global_Objects/String/big"
+blink:
+- :name: String.prototype.blink()
+ :url: "/JavaScript/Reference/Global_Objects/String/blink"
+bold:
+- :name: String.prototype.bold()
+ :url: "/JavaScript/Reference/Global_Objects/String/bold"
+fixed:
+- :name: String.prototype.fixed()
+ :url: "/JavaScript/Reference/Global_Objects/String/fixed"
+fontcolor:
+- :name: String.prototype.fontcolor()
+ :url: "/JavaScript/Reference/Global_Objects/String/fontcolor"
+fontsize:
+- :name: String.prototype.fontsize()
+ :url: "/JavaScript/Reference/Global_Objects/String/fontsize"
+italics:
+- :name: String.prototype.italics()
+ :url: "/JavaScript/Reference/Global_Objects/String/italics"
+link:
+- :name: String.prototype.link()
+ :url: "/JavaScript/Reference/Global_Objects/String/link"
+small:
+- :name: String.prototype.small()
+ :url: "/JavaScript/Reference/Global_Objects/String/small"
+strike:
+- :name: String.prototype.strike()
+ :url: "/JavaScript/Reference/Global_Objects/String/strike"
+sub:
+- :name: String.prototype.sub()
+ :url: "/JavaScript/Reference/Global_Objects/String/sub"
+sup:
+- :name: String.prototype.sup()
+ :url: "/JavaScript/Reference/Global_Objects/String/sup"
+Symbol:
+- :name: Symbol
+ :url: "/JavaScript/Reference/Global_Objects/Symbol"
+iterator:
+- :name: Symbol.iterator
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/iterator"
+hasInstance:
+- :name: Symbol.hasInstance
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/hasInstance"
+isConcatSpreadable:
+- :name: Symbol.isConcatSpreadable
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable"
+unscopables:
+- :name: Symbol.unscopables
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/unscopables"
+species:
+- :name: Symbol.species
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/species"
+toPrimitive:
+- :name: Symbol.toPrimitive
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/toPrimitive"
+toStringTag:
+- :name: Symbol.toStringTag
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/toStringTag"
+keyFor:
+- :name: Symbol.keyFor(sym)
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/keyFor"
+prototype[@@toPrimitive]:
+- :name: Symbol.prototype[@@toPrimitive]
+ :url: "/JavaScript/Reference/Global_Objects/Symbol/@@toPrimitive"
+WeakMap:
+- :name: WeakMap
+ :url: "/JavaScript/Reference/Global_Objects/WeakMap"
+WeakSet:
+- :name: WeakSet
+ :url: "/JavaScript/Reference/Global_Objects/WeakSet"
diff --git a/Support/jsmate.rb b/Support/jsmate.rb
deleted file mode 100755
index 80d7776..0000000
--- a/Support/jsmate.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env ruby18
-
-require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
-require "#{ENV['TM_SUPPORT_PATH']}/lib/ui"
-
-module JavaScript
-
- # All arrays populated below were from Mozilla's JavaScript Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
- #
- # None of the non-standard stuff is supported below but a case could be made to do so
-
- # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/$term
- GLOBAL_CONSTRUCTORS = [
- 'Array',
- 'Boolean',
- 'Date',
- 'Error',
- 'EvalError',
- 'Function',
- 'Iterator',
- 'Number',
- 'Object',
- 'RangeError',
- 'ReferenceError',
- 'RegExp',
- 'String',
- 'SyntaxError',
- 'TypeError',
- 'URIError'
- ]
-
- # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/$term
- GLOBAL_FUNCTIONS = [
- 'decodeURI',
- 'decodeURIComponent',
- 'encodeURI',
- 'encodeURIComponent',
- 'eval',
- 'isFinite',
- 'isNaN',
- 'parseFloat',
- 'parseInt'
- ]
-
- # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/$term
- GLOBAL_OBJECTS = [
- 'Infinity',
- 'Intl',
- 'JSON',
- 'Math',
- 'NaN',
- 'undefined',
- 'null'
- ]
-
- # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/$term
- OPERATORS = [
- 'delete',
- # 'function', # Handled below as a statement (The page has links to the Function constructor and the function operator)
- 'get',
- 'in',
- 'instanceof',
- 'let',
- 'new',
- 'set',
- 'this',
- 'typeof',
- 'void'
- # 'yield', # Handled below as a statement
- ]
-
- # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/$term
- STATEMENTS = [
- 'break',
- 'catch', # try...catch
- 'const',
- 'continue',
- 'debugger',
- 'do', # do...while
- 'else', # if...else
- 'for',
- 'function',
- 'if', # if...else
- 'label',
- 'let',
- 'return',
- 'switch',
- 'throw',
- 'try', # try...catch
- 'var',
- 'while',
- 'with',
- 'yield'
- ]
-
- def JavaScript::documentationForWord
- rawTerm = STDIN.read.strip
- term, *subTerm = rawTerm.split(/\./)
- url = nil
-
- if GLOBAL_CONSTRUCTORS.include?(term) or GLOBAL_FUNCTIONS.include?(term) or GLOBAL_OBJECTS.include?(term)
- url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/'
- term += '/' + subTerm.join('/') unless subTerm.empty?
- elsif OPERATORS.include?(term)
- url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/'
- elsif STATEMENTS.include?(term)
- url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/'
-
- case term
- when 'try', 'catch' then term = 'try...catch'
- when 'do', 'while' then term = 'do...while'
- when 'if', 'else' then term = 'if...else'
- end
- end
-
- unless url.nil?
- url += term
-
- TextMate.exit_show_html("")
- else
- TextMate.exit_show_tool_tip("Unable to find documentation for term: #{rawTerm}")
- end
- end
-end
\ No newline at end of file
diff --git a/Support/lib/js-beautify.js b/Support/lib/js-beautify.js
new file mode 100755
index 0000000..2b71507
--- /dev/null
+++ b/Support/lib/js-beautify.js
@@ -0,0 +1,2820 @@
+/*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
+/* AUTO-GENERATED. DO NOT MODIFY. */
+/* see js/src/javascript/index.js */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+ JS Beautifier
+---------------
+
+
+ Written by Einar Lielmanis,
+ http://jsbeautifier.org/
+
+ Originally converted to javascript by Vital,
+ "End braces on own line" added by Chris J. Shull,
+ Parsing improvements for brace-less statements by Liam Newman
+
+
+ Usage:
+ js_beautify(js_source_text);
+ js_beautify(js_source_text, options);
+
+ The options are:
+ indent_size (default 4) - indentation size,
+ indent_char (default space) - character to indent with,
+ preserve_newlines (default true) - whether existing line breaks should be preserved,
+ max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,
+
+ jslint_happy (default false) - if true, then jslint-stricter mode is enforced.
+
+ jslint_happy !jslint_happy
+ ---------------------------------
+ function () function()
+
+ switch () { switch() {
+ case 1: case 1:
+ break; break;
+ } }
+
+ space_after_anon_function (default false) - should the space before an anonymous function's parens be added, "function()" vs "function ()",
+ NOTE: This option is overriden by jslint_happy (i.e. if jslint_happy is true, space_after_anon_function is true by design)
+
+ brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" | any of the former + ",preserve-inline"
+ put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
+ preserve-inline will try to preserve inline blocks of curly braces
+
+ space_before_conditional (default true) - should the space before conditional statement be added, "if(true)" vs "if (true)",
+
+ unescape_strings (default false) - should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
+
+ wrap_line_length (default unlimited) - lines should wrap at next opportunity after this number of characters.
+ NOTE: This is not a hard limit. Lines will continue until a point where a newline would
+ be preserved if it were present.
+
+ end_with_newline (default false) - end output with a newline
+
+
+ e.g
+
+ js_beautify(js_source_text, {
+ 'indent_size': 1,
+ 'indent_char': '\t'
+ });
+
+*/
+
+(function() {
+var legacy_beautify_js =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // identity function for calling harmony imports with the correct context
+/******/ __webpack_require__.i = function(value) { return value; };
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 6);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports) {
+
+/* jshint curly: false */
+// This section of code is taken from acorn.
+//
+// Acorn was written by Marijn Haverbeke and released under an MIT
+// license. The Unicode regexps (for identifiers and whitespace) were
+// taken from [Esprima](http://esprima.org) by Ariya Hidayat.
+//
+// Git repositories for Acorn are available at
+//
+// http://marijnhaverbeke.nl/git/acorn
+// https://github.com/marijnh/acorn.git
+
+// ## Character categories
+
+// Big ugly regular expressions that match characters in the
+// whitespace, identifier, and identifier-start categories. These
+// are only applied when a character is found to actually have a
+// code point above 128.
+
+var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // jshint ignore:line
+var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+var nonASCIIidentifierChars = "\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+
+// Whether a single character denotes a newline.
+
+exports.newline = /[\n\r\u2028\u2029]/;
+
+// Matches a whole line break (where CRLF is considered a single
+// line break). Used to count lines.
+
+// in javascript, these two differ
+// in python they are the same, different methods are called on them
+exports.lineBreak = new RegExp('\r\n|' + exports.newline.source);
+exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
+
+
+// Test whether a given character code starts an identifier.
+
+exports.isIdentifierStart = function(code) {
+ // permit $ (36) and @ (64). @ is used in ES7 decorators.
+ if (code < 65) return code === 36 || code === 64;
+ // 65 through 91 are uppercase letters.
+ if (code < 91) return true;
+ // permit _ (95).
+ if (code < 97) return code === 95;
+ // 97 through 123 are lowercase letters.
+ if (code < 123) return true;
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+};
+
+// Test whether a given character is part of an identifier.
+
+exports.isIdentifierChar = function(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code < 91) return true;
+ if (code < 97) return code === 95;
+ if (code < 123) return true;
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+};
+
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+var mergeOpts = __webpack_require__(3).mergeOpts;
+var acorn = __webpack_require__(0);
+var Output = __webpack_require__(4).Output;
+var Tokenizer = __webpack_require__(7).Tokenizer;
+
+function remove_redundant_indentation(output, frame) {
+ // This implementation is effective but has some issues:
+ // - can cause line wrap to happen too soon due to indent removal
+ // after wrap points are calculated
+ // These issues are minor compared to ugly indentation.
+
+ if (frame.multiline_frame ||
+ frame.mode === MODE.ForInitializer ||
+ frame.mode === MODE.Conditional) {
+ return;
+ }
+
+ // remove one indent from each line inside this section
+ var start_index = frame.start_line_index;
+
+ output.remove_indent(start_index);
+}
+
+function in_array(what, arr) {
+ for (var i = 0; i < arr.length; i += 1) {
+ if (arr[i] === what) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function trim(s) {
+ return s.replace(/^\s+|\s+$/g, '');
+}
+
+function ltrim(s) {
+ return s.replace(/^\s+/g, '');
+}
+
+// function rtrim(s) {
+// return s.replace(/\s+$/g, '');
+// }
+
+
+function generateMapFromStrings(list) {
+ var result = {};
+ for (var x = 0; x < list.length; x++) {
+ // make the mapped names underscored instead of dash
+ result[list[x].replace(/-/g, '_')] = list[x];
+ }
+ return result;
+}
+
+function sanitizeOperatorPosition(opPosition) {
+ opPosition = opPosition || OPERATOR_POSITION.before_newline;
+
+ if (!in_array(opPosition, validPositionValues)) {
+ throw new Error("Invalid Option Value: The option 'operator_position' must be one of the following values\n" +
+ validPositionValues +
+ "\nYou passed in: '" + opPosition + "'");
+ }
+
+ return opPosition;
+}
+
+var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
+
+// Generate map from array
+var OPERATOR_POSITION = generateMapFromStrings(validPositionValues);
+
+var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];
+
+var MODE = {
+ BlockStatement: 'BlockStatement', // 'BLOCK'
+ Statement: 'Statement', // 'STATEMENT'
+ ObjectLiteral: 'ObjectLiteral', // 'OBJECT',
+ ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',
+ ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',
+ Conditional: 'Conditional', //'(COND-EXPRESSION)',
+ Expression: 'Expression' //'(EXPRESSION)'
+};
+
+function Beautifier(js_source_text, options) {
+ "use strict";
+ var output;
+ var tokens = [],
+ token_pos;
+ var tokenizer;
+ var current_token;
+ var last_type, last_last_text, indent_string;
+ var flags, previous_flags, flag_store;
+ var prefix;
+
+ var handlers, opt;
+ var baseIndentString = '';
+
+ handlers = {
+ 'TK_START_EXPR': handle_start_expr,
+ 'TK_END_EXPR': handle_end_expr,
+ 'TK_START_BLOCK': handle_start_block,
+ 'TK_END_BLOCK': handle_end_block,
+ 'TK_WORD': handle_word,
+ 'TK_RESERVED': handle_word,
+ 'TK_SEMICOLON': handle_semicolon,
+ 'TK_STRING': handle_string,
+ 'TK_EQUALS': handle_equals,
+ 'TK_OPERATOR': handle_operator,
+ 'TK_COMMA': handle_comma,
+ 'TK_BLOCK_COMMENT': handle_block_comment,
+ 'TK_COMMENT': handle_comment,
+ 'TK_DOT': handle_dot,
+ 'TK_UNKNOWN': handle_unknown,
+ 'TK_EOF': handle_eof
+ };
+
+ function create_flags(flags_base, mode) {
+ var next_indent_level = 0;
+ if (flags_base) {
+ next_indent_level = flags_base.indentation_level;
+ if (!output.just_added_newline() &&
+ flags_base.line_indent_level > next_indent_level) {
+ next_indent_level = flags_base.line_indent_level;
+ }
+ }
+
+ var next_flags = {
+ mode: mode,
+ parent: flags_base,
+ last_text: flags_base ? flags_base.last_text : '', // last token text
+ last_word: flags_base ? flags_base.last_word : '', // last 'TK_WORD' passed
+ declaration_statement: false,
+ declaration_assignment: false,
+ multiline_frame: false,
+ inline_frame: false,
+ if_block: false,
+ else_block: false,
+ do_block: false,
+ do_while: false,
+ import_block: false,
+ in_case_statement: false, // switch(..){ INSIDE HERE }
+ in_case: false, // we're on the exact line with "case 0:"
+ case_body: false, // the indented case-action block
+ indentation_level: next_indent_level,
+ line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,
+ start_line_index: output.get_line_number(),
+ ternary_depth: 0
+ };
+ return next_flags;
+ }
+
+ // Some interpreters have unexpected results with foo = baz || bar;
+ options = options ? options : {};
+
+ // Allow the setting of language/file-type specific options
+ // with inheritance of overall settings
+ options = mergeOpts(options, 'js');
+
+ opt = {};
+
+ // compatibility, re
+ if (options.brace_style === "expand-strict") { //graceful handling of deprecated option
+ options.brace_style = "expand";
+ } else if (options.brace_style === "collapse-preserve-inline") { //graceful handling of deprecated option
+ options.brace_style = "collapse,preserve-inline";
+ } else if (options.braces_on_own_line !== undefined) { //graceful handling of deprecated option
+ options.brace_style = options.braces_on_own_line ? "expand" : "collapse";
+ } else if (!options.brace_style) //Nothing exists to set it
+ {
+ options.brace_style = "collapse";
+ }
+
+
+ var brace_style_split = options.brace_style.split(/[^a-zA-Z0-9_\-]+/);
+ opt.brace_style = brace_style_split[0];
+ opt.brace_preserve_inline = brace_style_split[1] ? brace_style_split[1] : false;
+
+ opt.indent_size = options.indent_size ? parseInt(options.indent_size, 10) : 4;
+ opt.indent_char = options.indent_char ? options.indent_char : ' ';
+ opt.eol = options.eol ? options.eol : 'auto';
+ opt.preserve_newlines = (options.preserve_newlines === undefined) ? true : options.preserve_newlines;
+ opt.unindent_chained_methods = (options.unindent_chained_methods === undefined) ? false : options.unindent_chained_methods;
+ opt.break_chained_methods = (options.break_chained_methods === undefined) ? false : options.break_chained_methods;
+ opt.max_preserve_newlines = (options.max_preserve_newlines === undefined) ? 0 : parseInt(options.max_preserve_newlines, 10);
+ opt.space_in_paren = (options.space_in_paren === undefined) ? false : options.space_in_paren;
+ opt.space_in_empty_paren = (options.space_in_empty_paren === undefined) ? false : options.space_in_empty_paren;
+ opt.jslint_happy = (options.jslint_happy === undefined) ? false : options.jslint_happy;
+ opt.space_after_anon_function = (options.space_after_anon_function === undefined) ? false : options.space_after_anon_function;
+ opt.keep_array_indentation = (options.keep_array_indentation === undefined) ? false : options.keep_array_indentation;
+ opt.space_before_conditional = (options.space_before_conditional === undefined) ? true : options.space_before_conditional;
+ opt.unescape_strings = (options.unescape_strings === undefined) ? false : options.unescape_strings;
+ opt.wrap_line_length = (options.wrap_line_length === undefined) ? 0 : parseInt(options.wrap_line_length, 10);
+ opt.e4x = (options.e4x === undefined) ? false : options.e4x;
+ opt.end_with_newline = (options.end_with_newline === undefined) ? false : options.end_with_newline;
+ opt.comma_first = (options.comma_first === undefined) ? false : options.comma_first;
+ opt.operator_position = sanitizeOperatorPosition(options.operator_position);
+
+ // For testing of beautify ignore:start directive
+ opt.test_output_raw = (options.test_output_raw === undefined) ? false : options.test_output_raw;
+
+ // force opt.space_after_anon_function to true if opt.jslint_happy
+ if (opt.jslint_happy) {
+ opt.space_after_anon_function = true;
+ }
+
+ if (options.indent_with_tabs) {
+ opt.indent_char = '\t';
+ opt.indent_size = 1;
+ }
+
+ if (opt.eol === 'auto') {
+ opt.eol = '\n';
+ if (js_source_text && acorn.lineBreak.test(js_source_text || '')) {
+ opt.eol = js_source_text.match(acorn.lineBreak)[0];
+ }
+ }
+
+ opt.eol = opt.eol.replace(/\\r/, '\r').replace(/\\n/, '\n');
+
+ //----------------------------------
+ indent_string = '';
+ while (opt.indent_size > 0) {
+ indent_string += opt.indent_char;
+ opt.indent_size -= 1;
+ }
+
+ var preindent_index = 0;
+ if (js_source_text && js_source_text.length) {
+ while ((js_source_text.charAt(preindent_index) === ' ' ||
+ js_source_text.charAt(preindent_index) === '\t')) {
+ preindent_index += 1;
+ }
+ baseIndentString = js_source_text.substring(0, preindent_index);
+ js_source_text = js_source_text.substring(preindent_index);
+ }
+
+ last_type = 'TK_START_BLOCK'; // last token type
+ last_last_text = ''; // pre-last token text
+ output = new Output(indent_string, baseIndentString);
+
+ // If testing the ignore directive, start with output disable set to true
+ output.raw = opt.test_output_raw;
+
+
+ // Stack of parsing/formatting states, including MODE.
+ // We tokenize, parse, and output in an almost purely a forward-only stream of token input
+ // and formatted output. This makes the beautifier less accurate than full parsers
+ // but also far more tolerant of syntax errors.
+ //
+ // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type
+ // MODE.BlockStatement on the the stack, even though it could be object literal. If we later
+ // encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";",
+ // most full parsers would die, but the beautifier gracefully falls back to
+ // MODE.BlockStatement and continues on.
+ flag_store = [];
+ set_mode(MODE.BlockStatement);
+
+ this.beautify = function() {
+
+ /*jshint onevar:true */
+ var sweet_code;
+ tokenizer = new Tokenizer(js_source_text, opt, indent_string);
+ tokens = tokenizer.tokenize();
+ token_pos = 0;
+
+ current_token = get_token();
+ while (current_token) {
+ handlers[current_token.type]();
+
+ last_last_text = flags.last_text;
+ last_type = current_token.type;
+ flags.last_text = current_token.text;
+
+ token_pos += 1;
+ current_token = get_token();
+ }
+
+ sweet_code = output.get_code(opt.end_with_newline, opt.eol);
+
+ return sweet_code;
+ };
+
+ function handle_whitespace_and_comments(local_token, preserve_statement_flags) {
+ var newlines = local_token.newlines;
+ var keep_whitespace = opt.keep_array_indentation && is_array(flags.mode);
+ var temp_token = current_token;
+
+ for (var h = 0; h < local_token.comments_before.length; h++) {
+ // The cleanest handling of inline comments is to treat them as though they aren't there.
+ // Just continue formatting and the behavior should be logical.
+ // Also ignore unknown tokens. Again, this should result in better behavior.
+ current_token = local_token.comments_before[h];
+ handle_whitespace_and_comments(current_token, preserve_statement_flags);
+ handlers[current_token.type](preserve_statement_flags);
+ }
+ current_token = temp_token;
+
+ if (keep_whitespace) {
+ for (var i = 0; i < newlines; i += 1) {
+ print_newline(i > 0, preserve_statement_flags);
+ }
+ } else {
+ if (opt.max_preserve_newlines && newlines > opt.max_preserve_newlines) {
+ newlines = opt.max_preserve_newlines;
+ }
+
+ if (opt.preserve_newlines) {
+ if (local_token.newlines > 1) {
+ print_newline(false, preserve_statement_flags);
+ for (var j = 1; j < newlines; j += 1) {
+ print_newline(true, preserve_statement_flags);
+ }
+ }
+ }
+ }
+
+ }
+
+ // we could use just string.split, but
+ // IE doesn't like returning empty strings
+ function split_linebreaks(s) {
+ //return s.split(/\x0d\x0a|\x0a/);
+
+ s = s.replace(acorn.allLineBreaks, '\n');
+ var out = [],
+ idx = s.indexOf("\n");
+ while (idx !== -1) {
+ out.push(s.substring(0, idx));
+ s = s.substring(idx + 1);
+ idx = s.indexOf("\n");
+ }
+ if (s.length) {
+ out.push(s);
+ }
+ return out;
+ }
+
+ var newline_restricted_tokens = ['break', 'continue', 'return', 'throw', 'yield'];
+
+ function allow_wrap_or_preserved_newline(force_linewrap) {
+ force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;
+
+ // Never wrap the first token on a line
+ if (output.just_added_newline()) {
+ return;
+ }
+
+ var shouldPreserveOrForce = (opt.preserve_newlines && current_token.wanted_newline) || force_linewrap;
+ var operatorLogicApplies = in_array(flags.last_text, tokenizer.positionable_operators) || in_array(current_token.text, tokenizer.positionable_operators);
+
+ if (operatorLogicApplies) {
+ var shouldPrintOperatorNewline = (
+ in_array(flags.last_text, tokenizer.positionable_operators) &&
+ in_array(opt.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)
+ ) ||
+ in_array(current_token.text, tokenizer.positionable_operators);
+ shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;
+ }
+
+ if (shouldPreserveOrForce) {
+ print_newline(false, true);
+ } else if (opt.wrap_line_length) {
+ if (last_type === 'TK_RESERVED' && in_array(flags.last_text, newline_restricted_tokens)) {
+ // These tokens should never have a newline inserted
+ // between them and the following expression.
+ return;
+ }
+ var proposed_line_length = output.current_line.get_character_count() + current_token.text.length +
+ (output.space_before_token ? 1 : 0);
+ if (proposed_line_length >= opt.wrap_line_length) {
+ print_newline(false, true);
+ }
+ }
+ }
+
+ function print_newline(force_newline, preserve_statement_flags) {
+ if (!preserve_statement_flags) {
+ if (flags.last_text !== ';' && flags.last_text !== ',' && flags.last_text !== '=' && last_type !== 'TK_OPERATOR') {
+ var next_token = get_token(1);
+ while (flags.mode === MODE.Statement &&
+ !(flags.if_block && next_token && next_token.type === 'TK_RESERVED' && next_token.text === 'else') &&
+ !flags.do_block) {
+ restore_mode();
+ }
+ }
+ }
+
+ if (output.add_new_line(force_newline)) {
+ flags.multiline_frame = true;
+ }
+ }
+
+ function print_token_line_indentation() {
+ if (output.just_added_newline()) {
+ if (opt.keep_array_indentation && is_array(flags.mode) && current_token.wanted_newline) {
+ output.current_line.push(current_token.whitespace_before);
+ output.space_before_token = false;
+ } else if (output.set_indent(flags.indentation_level)) {
+ flags.line_indent_level = flags.indentation_level;
+ }
+ }
+ }
+
+ function print_token(printable_token) {
+ if (output.raw) {
+ output.add_raw_token(current_token);
+ return;
+ }
+
+ if (opt.comma_first && last_type === 'TK_COMMA' &&
+ output.just_added_newline()) {
+ if (output.previous_line.last() === ',') {
+ var popped = output.previous_line.pop();
+ // if the comma was already at the start of the line,
+ // pull back onto that line and reprint the indentation
+ if (output.previous_line.is_empty()) {
+ output.previous_line.push(popped);
+ output.trim(true);
+ output.current_line.pop();
+ output.trim();
+ }
+
+ // add the comma in front of the next token
+ print_token_line_indentation();
+ output.add_token(',');
+ output.space_before_token = true;
+ }
+ }
+
+ printable_token = printable_token || current_token.text;
+ print_token_line_indentation();
+ output.add_token(printable_token);
+ }
+
+ function indent() {
+ flags.indentation_level += 1;
+ }
+
+ function deindent() {
+ if (flags.indentation_level > 0 &&
+ ((!flags.parent) || flags.indentation_level > flags.parent.indentation_level)) {
+ flags.indentation_level -= 1;
+
+ }
+ }
+
+ function set_mode(mode) {
+ if (flags) {
+ flag_store.push(flags);
+ previous_flags = flags;
+ } else {
+ previous_flags = create_flags(null, mode);
+ }
+
+ flags = create_flags(previous_flags, mode);
+ }
+
+ function is_array(mode) {
+ return mode === MODE.ArrayLiteral;
+ }
+
+ function is_expression(mode) {
+ return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);
+ }
+
+ function restore_mode() {
+ if (flag_store.length > 0) {
+ previous_flags = flags;
+ flags = flag_store.pop();
+ if (previous_flags.mode === MODE.Statement && !opt.unindent_chained_methods) {
+ remove_redundant_indentation(output, previous_flags);
+ }
+ }
+ }
+
+ function start_of_object_property() {
+ return flags.parent.mode === MODE.ObjectLiteral && flags.mode === MODE.Statement && (
+ (flags.last_text === ':' && flags.ternary_depth === 0) || (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['get', 'set'])));
+ }
+
+ function start_of_statement() {
+ if (
+ (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['var', 'let', 'const']) && current_token.type === 'TK_WORD') ||
+ (last_type === 'TK_RESERVED' && flags.last_text === 'do') ||
+ (last_type === 'TK_RESERVED' && in_array(flags.last_text, newline_restricted_tokens) && !current_token.wanted_newline) ||
+ (last_type === 'TK_RESERVED' && flags.last_text === 'else' &&
+ !(current_token.type === 'TK_RESERVED' && current_token.text === 'if' && !current_token.comments_before.length)) ||
+ (last_type === 'TK_END_EXPR' && (previous_flags.mode === MODE.ForInitializer || previous_flags.mode === MODE.Conditional)) ||
+ (last_type === 'TK_WORD' && flags.mode === MODE.BlockStatement &&
+ !flags.in_case &&
+ !(current_token.text === '--' || current_token.text === '++') &&
+ last_last_text !== 'function' &&
+ current_token.type !== 'TK_WORD' && current_token.type !== 'TK_RESERVED') ||
+ (flags.mode === MODE.ObjectLiteral && (
+ (flags.last_text === ':' && flags.ternary_depth === 0) || (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['get', 'set']))))
+ ) {
+
+ set_mode(MODE.Statement);
+ if (!opt.unindent_chained_methods) {
+ indent();
+ }
+
+ handle_whitespace_and_comments(current_token, true);
+
+ // Issue #276:
+ // If starting a new statement with [if, for, while, do], push to a new line.
+ // if (a) if (b) if(c) d(); else e(); else f();
+ if (!start_of_object_property()) {
+ allow_wrap_or_preserved_newline(
+ current_token.type === 'TK_RESERVED' && in_array(current_token.text, ['do', 'for', 'if', 'while']));
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ function all_lines_start_with(lines, c) {
+ for (var i = 0; i < lines.length; i++) {
+ var line = trim(lines[i]);
+ if (line.charAt(0) !== c) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function each_line_matches_indent(lines, indent) {
+ var i = 0,
+ len = lines.length,
+ line;
+ for (; i < len; i++) {
+ line = lines[i];
+ // allow empty lines to pass through
+ if (line && line.indexOf(indent) !== 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function is_special_word(word) {
+ return in_array(word, ['case', 'return', 'do', 'if', 'throw', 'else']);
+ }
+
+ function get_token(offset) {
+ var index = token_pos + (offset || 0);
+ return (index < 0 || index >= tokens.length) ? null : tokens[index];
+ }
+
+ function handle_start_expr() {
+ // The conditional starts the statement if appropriate.
+ if (!start_of_statement()) {
+ handle_whitespace_and_comments(current_token);
+ }
+
+ var next_mode = MODE.Expression;
+ if (current_token.text === '[') {
+
+ if (last_type === 'TK_WORD' || flags.last_text === ')') {
+ // this is array index specifier, break immediately
+ // a[x], fn()[x]
+ if (last_type === 'TK_RESERVED' && in_array(flags.last_text, tokenizer.line_starters)) {
+ output.space_before_token = true;
+ }
+ set_mode(next_mode);
+ print_token();
+ indent();
+ if (opt.space_in_paren) {
+ output.space_before_token = true;
+ }
+ return;
+ }
+
+ next_mode = MODE.ArrayLiteral;
+ if (is_array(flags.mode)) {
+ if (flags.last_text === '[' ||
+ (flags.last_text === ',' && (last_last_text === ']' || last_last_text === '}'))) {
+ // ], [ goes to new line
+ // }, [ goes to new line
+ if (!opt.keep_array_indentation) {
+ print_newline();
+ }
+ }
+ }
+
+ } else {
+ if (last_type === 'TK_RESERVED' && flags.last_text === 'for') {
+ next_mode = MODE.ForInitializer;
+ } else if (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['if', 'while'])) {
+ next_mode = MODE.Conditional;
+ } else {
+ // next_mode = MODE.Expression;
+ }
+ }
+
+ if (flags.last_text === ';' || last_type === 'TK_START_BLOCK') {
+ print_newline();
+ } else if (last_type === 'TK_END_EXPR' || last_type === 'TK_START_EXPR' || last_type === 'TK_END_BLOCK' || flags.last_text === '.') {
+ // TODO: Consider whether forcing this is required. Review failing tests when removed.
+ allow_wrap_or_preserved_newline(current_token.wanted_newline);
+ // do nothing on (( and )( and ][ and ]( and .(
+ } else if (!(last_type === 'TK_RESERVED' && current_token.text === '(') && last_type !== 'TK_WORD' && last_type !== 'TK_OPERATOR') {
+ output.space_before_token = true;
+ } else if ((last_type === 'TK_RESERVED' && (flags.last_word === 'function' || flags.last_word === 'typeof')) ||
+ (flags.last_text === '*' &&
+ (in_array(last_last_text, ['function', 'yield']) ||
+ (flags.mode === MODE.ObjectLiteral && in_array(last_last_text, ['{', ',']))))) {
+ // function() vs function ()
+ // yield*() vs yield* ()
+ // function*() vs function* ()
+ if (opt.space_after_anon_function) {
+ output.space_before_token = true;
+ }
+ } else if (last_type === 'TK_RESERVED' && (in_array(flags.last_text, tokenizer.line_starters) || flags.last_text === 'catch')) {
+ if (opt.space_before_conditional) {
+ output.space_before_token = true;
+ }
+ }
+
+ // Should be a space between await and an IIFE, or async and an arrow function
+ if (current_token.text === '(' && last_type === 'TK_RESERVED' && in_array(flags.last_word, ['await', 'async'])) {
+ output.space_before_token = true;
+ }
+
+ // Support of this kind of newline preservation.
+ // a = (b &&
+ // (c || d));
+ if (current_token.text === '(') {
+ if (last_type === 'TK_EQUALS' || last_type === 'TK_OPERATOR') {
+ if (!start_of_object_property()) {
+ allow_wrap_or_preserved_newline();
+ }
+ }
+ }
+
+ // Support preserving wrapped arrow function expressions
+ // a.b('c',
+ // () => d.e
+ // )
+ if (current_token.text === '(' && last_type !== 'TK_WORD' && last_type !== 'TK_RESERVED') {
+ allow_wrap_or_preserved_newline();
+ }
+
+ set_mode(next_mode);
+ print_token();
+ if (opt.space_in_paren) {
+ output.space_before_token = true;
+ }
+
+ // In all cases, if we newline while inside an expression it should be indented.
+ indent();
+ }
+
+ function handle_end_expr() {
+ // statements inside expressions are not valid syntax, but...
+ // statements must all be closed when their container closes
+ while (flags.mode === MODE.Statement) {
+ restore_mode();
+ }
+
+ handle_whitespace_and_comments(current_token);
+
+ if (flags.multiline_frame) {
+ allow_wrap_or_preserved_newline(current_token.text === ']' && is_array(flags.mode) && !opt.keep_array_indentation);
+ }
+
+ if (opt.space_in_paren) {
+ if (last_type === 'TK_START_EXPR' && !opt.space_in_empty_paren) {
+ // () [] no inner space in empty parens like these, ever, ref #320
+ output.trim();
+ output.space_before_token = false;
+ } else {
+ output.space_before_token = true;
+ }
+ }
+ if (current_token.text === ']' && opt.keep_array_indentation) {
+ print_token();
+ restore_mode();
+ } else {
+ restore_mode();
+ print_token();
+ }
+ remove_redundant_indentation(output, previous_flags);
+
+ // do {} while () // no statement required after
+ if (flags.do_while && previous_flags.mode === MODE.Conditional) {
+ previous_flags.mode = MODE.Expression;
+ flags.do_block = false;
+ flags.do_while = false;
+
+ }
+ }
+
+ function handle_start_block() {
+ handle_whitespace_and_comments(current_token);
+
+ // Check if this is should be treated as a ObjectLiteral
+ var next_token = get_token(1);
+ var second_token = get_token(2);
+ if (second_token && (
+ (in_array(second_token.text, [':', ',']) && in_array(next_token.type, ['TK_STRING', 'TK_WORD', 'TK_RESERVED'])) ||
+ (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, ['TK_WORD', 'TK_RESERVED']))
+ )) {
+ // We don't support TypeScript,but we didn't break it for a very long time.
+ // We'll try to keep not breaking it.
+ if (!in_array(last_last_text, ['class', 'interface'])) {
+ set_mode(MODE.ObjectLiteral);
+ } else {
+ set_mode(MODE.BlockStatement);
+ }
+ } else if (last_type === 'TK_OPERATOR' && flags.last_text === '=>') {
+ // arrow function: (param1, paramN) => { statements }
+ set_mode(MODE.BlockStatement);
+ } else if (in_array(last_type, ['TK_EQUALS', 'TK_START_EXPR', 'TK_COMMA', 'TK_OPERATOR']) ||
+ (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['return', 'throw', 'import', 'default']))
+ ) {
+ // Detecting shorthand function syntax is difficult by scanning forward,
+ // so check the surrounding context.
+ // If the block is being returned, imported, export default, passed as arg,
+ // assigned with = or assigned in a nested object, treat as an ObjectLiteral.
+ set_mode(MODE.ObjectLiteral);
+ } else {
+ set_mode(MODE.BlockStatement);
+ }
+
+ var empty_braces = !next_token.comments_before.length && next_token.text === '}';
+ var empty_anonymous_function = empty_braces && flags.last_word === 'function' &&
+ last_type === 'TK_END_EXPR';
+
+ if (opt.brace_preserve_inline) // check for inline, set inline_frame if so
+ {
+ // search forward for a newline wanted inside this block
+ var index = 0;
+ var check_token = null;
+ flags.inline_frame = true;
+ do {
+ index += 1;
+ check_token = get_token(index);
+ if (check_token.wanted_newline) {
+ flags.inline_frame = false;
+ break;
+ }
+ } while (check_token.type !== 'TK_EOF' &&
+ !(check_token.type === 'TK_END_BLOCK' && check_token.opened === current_token));
+ }
+
+ if ((opt.brace_style === "expand" ||
+ (opt.brace_style === "none" && current_token.wanted_newline)) &&
+ !flags.inline_frame) {
+ if (last_type !== 'TK_OPERATOR' &&
+ (empty_anonymous_function ||
+ last_type === 'TK_EQUALS' ||
+ (last_type === 'TK_RESERVED' && is_special_word(flags.last_text) && flags.last_text !== 'else'))) {
+ output.space_before_token = true;
+ } else {
+ print_newline(false, true);
+ }
+ } else { // collapse || inline_frame
+ if (is_array(previous_flags.mode) && (last_type === 'TK_START_EXPR' || last_type === 'TK_COMMA')) {
+ if (last_type === 'TK_COMMA' || opt.space_in_paren) {
+ output.space_before_token = true;
+ }
+
+ if (last_type === 'TK_COMMA' || (last_type === 'TK_START_EXPR' && flags.inline_frame)) {
+ allow_wrap_or_preserved_newline();
+ previous_flags.multiline_frame = previous_flags.multiline_frame || flags.multiline_frame;
+ flags.multiline_frame = false;
+ }
+ }
+ if (last_type !== 'TK_OPERATOR' && last_type !== 'TK_START_EXPR') {
+ if (last_type === 'TK_START_BLOCK' && !flags.inline_frame) {
+ print_newline();
+ } else {
+ output.space_before_token = true;
+ }
+ }
+ }
+ print_token();
+ indent();
+ }
+
+ function handle_end_block() {
+ // statements must all be closed when their container closes
+ handle_whitespace_and_comments(current_token);
+
+ while (flags.mode === MODE.Statement) {
+ restore_mode();
+ }
+
+ var empty_braces = last_type === 'TK_START_BLOCK';
+
+ if (flags.inline_frame && !empty_braces) { // try inline_frame (only set if opt.braces-preserve-inline) first
+ output.space_before_token = true;
+ } else if (opt.brace_style === "expand") {
+ if (!empty_braces) {
+ print_newline();
+ }
+ } else {
+ // skip {}
+ if (!empty_braces) {
+ if (is_array(flags.mode) && opt.keep_array_indentation) {
+ // we REALLY need a newline here, but newliner would skip that
+ opt.keep_array_indentation = false;
+ print_newline();
+ opt.keep_array_indentation = true;
+
+ } else {
+ print_newline();
+ }
+ }
+ }
+ restore_mode();
+ print_token();
+ }
+
+ function handle_word() {
+ if (current_token.type === 'TK_RESERVED') {
+ if (in_array(current_token.text, ['set', 'get']) && flags.mode !== MODE.ObjectLiteral) {
+ current_token.type = 'TK_WORD';
+ } else if (in_array(current_token.text, ['as', 'from']) && !flags.import_block) {
+ current_token.type = 'TK_WORD';
+ } else if (flags.mode === MODE.ObjectLiteral) {
+ var next_token = get_token(1);
+ if (next_token.text === ':') {
+ current_token.type = 'TK_WORD';
+ }
+ }
+ }
+
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ if (last_type === 'TK_RESERVED' && in_array(flags.last_text, ['var', 'let', 'const']) && current_token.type === 'TK_WORD') {
+ flags.declaration_statement = true;
+ }
+ } else if (current_token.wanted_newline && !is_expression(flags.mode) &&
+ (last_type !== 'TK_OPERATOR' || (flags.last_text === '--' || flags.last_text === '++')) &&
+ last_type !== 'TK_EQUALS' &&
+ (opt.preserve_newlines || !(last_type === 'TK_RESERVED' && in_array(flags.last_text, ['var', 'let', 'const', 'set', 'get'])))) {
+ handle_whitespace_and_comments(current_token);
+ print_newline();
+ } else {
+ handle_whitespace_and_comments(current_token);
+ }
+
+ if (flags.do_block && !flags.do_while) {
+ if (current_token.type === 'TK_RESERVED' && current_token.text === 'while') {
+ // do {} ## while ()
+ output.space_before_token = true;
+ print_token();
+ output.space_before_token = true;
+ flags.do_while = true;
+ return;
+ } else {
+ // do {} should always have while as the next word.
+ // if we don't see the expected while, recover
+ print_newline();
+ flags.do_block = false;
+ }
+ }
+
+ // if may be followed by else, or not
+ // Bare/inline ifs are tricky
+ // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();
+ if (flags.if_block) {
+ if (!flags.else_block && (current_token.type === 'TK_RESERVED' && current_token.text === 'else')) {
+ flags.else_block = true;
+ } else {
+ while (flags.mode === MODE.Statement) {
+ restore_mode();
+ }
+ flags.if_block = false;
+ flags.else_block = false;
+ }
+ }
+
+ if (current_token.type === 'TK_RESERVED' && (current_token.text === 'case' || (current_token.text === 'default' && flags.in_case_statement))) {
+ print_newline();
+ if (flags.case_body || opt.jslint_happy) {
+ // switch cases following one another
+ deindent();
+ flags.case_body = false;
+ }
+ print_token();
+ flags.in_case = true;
+ flags.in_case_statement = true;
+ return;
+ }
+
+ if (last_type === 'TK_COMMA' || last_type === 'TK_START_EXPR' || last_type === 'TK_EQUALS' || last_type === 'TK_OPERATOR') {
+ if (!start_of_object_property()) {
+ allow_wrap_or_preserved_newline();
+ }
+ }
+
+ if (current_token.type === 'TK_RESERVED' && current_token.text === 'function') {
+ if (in_array(flags.last_text, ['}', ';']) ||
+ (output.just_added_newline() && !(in_array(flags.last_text, ['(', '[', '{', ':', '=', ',']) || last_type === 'TK_OPERATOR'))) {
+ // make sure there is a nice clean space of at least one blank line
+ // before a new function definition
+ if (!output.just_added_blankline() && !current_token.comments_before.length) {
+ print_newline();
+ print_newline(true);
+ }
+ }
+ if (last_type === 'TK_RESERVED' || last_type === 'TK_WORD') {
+ if (last_type === 'TK_RESERVED' && (
+ in_array(flags.last_text, ['get', 'set', 'new', 'export', 'async']) ||
+ in_array(flags.last_text, newline_restricted_tokens))) {
+ output.space_before_token = true;
+ } else if (last_type === 'TK_RESERVED' && flags.last_text === 'default' && last_last_text === 'export') {
+ output.space_before_token = true;
+ } else {
+ print_newline();
+ }
+ } else if (last_type === 'TK_OPERATOR' || flags.last_text === '=') {
+ // foo = function
+ output.space_before_token = true;
+ } else if (!flags.multiline_frame && (is_expression(flags.mode) || is_array(flags.mode))) {
+ // (function
+ } else {
+ print_newline();
+ }
+
+ print_token();
+ flags.last_word = current_token.text;
+ return;
+ }
+
+ prefix = 'NONE';
+
+ if (last_type === 'TK_END_BLOCK') {
+
+ if (previous_flags.inline_frame) {
+ prefix = 'SPACE';
+ } else if (!(current_token.type === 'TK_RESERVED' && in_array(current_token.text, ['else', 'catch', 'finally', 'from']))) {
+ prefix = 'NEWLINE';
+ } else {
+ if (opt.brace_style === "expand" ||
+ opt.brace_style === "end-expand" ||
+ (opt.brace_style === "none" && current_token.wanted_newline)) {
+ prefix = 'NEWLINE';
+ } else {
+ prefix = 'SPACE';
+ output.space_before_token = true;
+ }
+ }
+ } else if (last_type === 'TK_SEMICOLON' && flags.mode === MODE.BlockStatement) {
+ // TODO: Should this be for STATEMENT as well?
+ prefix = 'NEWLINE';
+ } else if (last_type === 'TK_SEMICOLON' && is_expression(flags.mode)) {
+ prefix = 'SPACE';
+ } else if (last_type === 'TK_STRING') {
+ prefix = 'NEWLINE';
+ } else if (last_type === 'TK_RESERVED' || last_type === 'TK_WORD' ||
+ (flags.last_text === '*' &&
+ (in_array(last_last_text, ['function', 'yield']) ||
+ (flags.mode === MODE.ObjectLiteral && in_array(last_last_text, ['{', ',']))))) {
+ prefix = 'SPACE';
+ } else if (last_type === 'TK_START_BLOCK') {
+ if (flags.inline_frame) {
+ prefix = 'SPACE';
+ } else {
+ prefix = 'NEWLINE';
+ }
+ } else if (last_type === 'TK_END_EXPR') {
+ output.space_before_token = true;
+ prefix = 'NEWLINE';
+ }
+
+ if (current_token.type === 'TK_RESERVED' && in_array(current_token.text, tokenizer.line_starters) && flags.last_text !== ')') {
+ if (flags.inline_frame || flags.last_text === 'else' || flags.last_text === 'export') {
+ prefix = 'SPACE';
+ } else {
+ prefix = 'NEWLINE';
+ }
+
+ }
+
+ if (current_token.type === 'TK_RESERVED' && in_array(current_token.text, ['else', 'catch', 'finally'])) {
+ if ((!(last_type === 'TK_END_BLOCK' && previous_flags.mode === MODE.BlockStatement) ||
+ opt.brace_style === "expand" ||
+ opt.brace_style === "end-expand" ||
+ (opt.brace_style === "none" && current_token.wanted_newline)) &&
+ !flags.inline_frame) {
+ print_newline();
+ } else {
+ output.trim(true);
+ var line = output.current_line;
+ // If we trimmed and there's something other than a close block before us
+ // put a newline back in. Handles '} // comment' scenario.
+ if (line.last() !== '}') {
+ print_newline();
+ }
+ output.space_before_token = true;
+ }
+ } else if (prefix === 'NEWLINE') {
+ if (last_type === 'TK_RESERVED' && is_special_word(flags.last_text)) {
+ // no newline between 'return nnn'
+ output.space_before_token = true;
+ } else if (last_type !== 'TK_END_EXPR') {
+ if ((last_type !== 'TK_START_EXPR' || !(current_token.type === 'TK_RESERVED' && in_array(current_token.text, ['var', 'let', 'const']))) && flags.last_text !== ':') {
+ // no need to force newline on 'var': for (var x = 0...)
+ if (current_token.type === 'TK_RESERVED' && current_token.text === 'if' && flags.last_text === 'else') {
+ // no newline for } else if {
+ output.space_before_token = true;
+ } else {
+ print_newline();
+ }
+ }
+ } else if (current_token.type === 'TK_RESERVED' && in_array(current_token.text, tokenizer.line_starters) && flags.last_text !== ')') {
+ print_newline();
+ }
+ } else if (flags.multiline_frame && is_array(flags.mode) && flags.last_text === ',' && last_last_text === '}') {
+ print_newline(); // }, in lists get a newline treatment
+ } else if (prefix === 'SPACE') {
+ output.space_before_token = true;
+ }
+ print_token();
+ flags.last_word = current_token.text;
+
+ if (current_token.type === 'TK_RESERVED') {
+ if (current_token.text === 'do') {
+ flags.do_block = true;
+ } else if (current_token.text === 'if') {
+ flags.if_block = true;
+ } else if (current_token.text === 'import') {
+ flags.import_block = true;
+ } else if (flags.import_block && current_token.type === 'TK_RESERVED' && current_token.text === 'from') {
+ flags.import_block = false;
+ }
+ }
+ }
+
+ function handle_semicolon() {
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ // Semicolon can be the start (and end) of a statement
+ output.space_before_token = false;
+ } else {
+ handle_whitespace_and_comments(current_token);
+ }
+
+ var next_token = get_token(1);
+ while (flags.mode === MODE.Statement &&
+ !(flags.if_block && next_token && next_token.type === 'TK_RESERVED' && next_token.text === 'else') &&
+ !flags.do_block) {
+ restore_mode();
+ }
+
+ // hacky but effective for the moment
+ if (flags.import_block) {
+ flags.import_block = false;
+ }
+ print_token();
+ }
+
+ function handle_string() {
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ // One difference - strings want at least a space before
+ output.space_before_token = true;
+ } else {
+ handle_whitespace_and_comments(current_token);
+ if (last_type === 'TK_RESERVED' || last_type === 'TK_WORD' || flags.inline_frame) {
+ output.space_before_token = true;
+ } else if (last_type === 'TK_COMMA' || last_type === 'TK_START_EXPR' || last_type === 'TK_EQUALS' || last_type === 'TK_OPERATOR') {
+ if (!start_of_object_property()) {
+ allow_wrap_or_preserved_newline();
+ }
+ } else {
+ print_newline();
+ }
+ }
+ print_token();
+ }
+
+ function handle_equals() {
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ } else {
+ handle_whitespace_and_comments(current_token);
+ }
+
+ if (flags.declaration_statement) {
+ // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done
+ flags.declaration_assignment = true;
+ }
+ output.space_before_token = true;
+ print_token();
+ output.space_before_token = true;
+ }
+
+ function handle_comma() {
+ handle_whitespace_and_comments(current_token, true);
+
+ print_token();
+ output.space_before_token = true;
+ if (flags.declaration_statement) {
+ if (is_expression(flags.parent.mode)) {
+ // do not break on comma, for(var a = 1, b = 2)
+ flags.declaration_assignment = false;
+ }
+
+ if (flags.declaration_assignment) {
+ flags.declaration_assignment = false;
+ print_newline(false, true);
+ } else if (opt.comma_first) {
+ // for comma-first, we want to allow a newline before the comma
+ // to turn into a newline after the comma, which we will fixup later
+ allow_wrap_or_preserved_newline();
+ }
+ } else if (flags.mode === MODE.ObjectLiteral ||
+ (flags.mode === MODE.Statement && flags.parent.mode === MODE.ObjectLiteral)) {
+ if (flags.mode === MODE.Statement) {
+ restore_mode();
+ }
+
+ if (!flags.inline_frame) {
+ print_newline();
+ }
+ } else if (opt.comma_first) {
+ // EXPR or DO_BLOCK
+ // for comma-first, we want to allow a newline before the comma
+ // to turn into a newline after the comma, which we will fixup later
+ allow_wrap_or_preserved_newline();
+ }
+ }
+
+ function handle_operator() {
+ var isGeneratorAsterisk = current_token.text === '*' &&
+ ((last_type === 'TK_RESERVED' && in_array(flags.last_text, ['function', 'yield'])) ||
+ (in_array(last_type, ['TK_START_BLOCK', 'TK_COMMA', 'TK_END_BLOCK', 'TK_SEMICOLON']))
+ );
+ var isUnary = in_array(current_token.text, ['-', '+']) && (
+ in_array(last_type, ['TK_START_BLOCK', 'TK_START_EXPR', 'TK_EQUALS', 'TK_OPERATOR']) ||
+ in_array(flags.last_text, tokenizer.line_starters) ||
+ flags.last_text === ','
+ );
+
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ } else {
+ var preserve_statement_flags = !isGeneratorAsterisk;
+ handle_whitespace_and_comments(current_token, preserve_statement_flags);
+ }
+
+ if (last_type === 'TK_RESERVED' && is_special_word(flags.last_text)) {
+ // "return" had a special handling in TK_WORD. Now we need to return the favor
+ output.space_before_token = true;
+ print_token();
+ return;
+ }
+
+ // hack for actionscript's import .*;
+ if (current_token.text === '*' && last_type === 'TK_DOT') {
+ print_token();
+ return;
+ }
+
+ if (current_token.text === '::') {
+ // no spaces around exotic namespacing syntax operator
+ print_token();
+ return;
+ }
+
+ // Allow line wrapping between operators when operator_position is
+ // set to before or preserve
+ if (last_type === 'TK_OPERATOR' && in_array(opt.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {
+ allow_wrap_or_preserved_newline();
+ }
+
+ if (current_token.text === ':' && flags.in_case) {
+ flags.case_body = true;
+ indent();
+ print_token();
+ print_newline();
+ flags.in_case = false;
+ return;
+ }
+
+ var space_before = true;
+ var space_after = true;
+ var in_ternary = false;
+ if (current_token.text === ':') {
+ if (flags.ternary_depth === 0) {
+ // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.
+ space_before = false;
+ } else {
+ flags.ternary_depth -= 1;
+ in_ternary = true;
+ }
+ } else if (current_token.text === '?') {
+ flags.ternary_depth += 1;
+ }
+
+ // let's handle the operator_position option prior to any conflicting logic
+ if (!isUnary && !isGeneratorAsterisk && opt.preserve_newlines && in_array(current_token.text, tokenizer.positionable_operators)) {
+ var isColon = current_token.text === ':';
+ var isTernaryColon = (isColon && in_ternary);
+ var isOtherColon = (isColon && !in_ternary);
+
+ switch (opt.operator_position) {
+ case OPERATOR_POSITION.before_newline:
+ // if the current token is : and it's not a ternary statement then we set space_before to false
+ output.space_before_token = !isOtherColon;
+
+ print_token();
+
+ if (!isColon || isTernaryColon) {
+ allow_wrap_or_preserved_newline();
+ }
+
+ output.space_before_token = true;
+ return;
+
+ case OPERATOR_POSITION.after_newline:
+ // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,
+ // then print a newline.
+
+ output.space_before_token = true;
+
+ if (!isColon || isTernaryColon) {
+ if (get_token(1).wanted_newline) {
+ print_newline(false, true);
+ } else {
+ allow_wrap_or_preserved_newline();
+ }
+ } else {
+ output.space_before_token = false;
+ }
+
+ print_token();
+
+ output.space_before_token = true;
+ return;
+
+ case OPERATOR_POSITION.preserve_newline:
+ if (!isOtherColon) {
+ allow_wrap_or_preserved_newline();
+ }
+
+ // if we just added a newline, or the current token is : and it's not a ternary statement,
+ // then we set space_before to false
+ space_before = !(output.just_added_newline() || isOtherColon);
+
+ output.space_before_token = space_before;
+ print_token();
+ output.space_before_token = true;
+ return;
+ }
+ }
+
+ if (isGeneratorAsterisk) {
+ allow_wrap_or_preserved_newline();
+ space_before = false;
+ var next_token = get_token(1);
+ space_after = next_token && in_array(next_token.type, ['TK_WORD', 'TK_RESERVED']);
+ } else if (current_token.text === '...') {
+ allow_wrap_or_preserved_newline();
+ space_before = last_type === 'TK_START_BLOCK';
+ space_after = false;
+ } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {
+ // unary operators (and binary +/- pretending to be unary) special cases
+
+ space_before = false;
+ space_after = false;
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1
+ // if there is a newline between -- or ++ and anything else we should preserve it.
+ if (current_token.wanted_newline && (current_token.text === '--' || current_token.text === '++')) {
+ print_newline(false, true);
+ }
+
+ if (flags.last_text === ';' && is_expression(flags.mode)) {
+ // for (;; ++i)
+ // ^^^
+ space_before = true;
+ }
+
+ if (last_type === 'TK_RESERVED') {
+ space_before = true;
+ } else if (last_type === 'TK_END_EXPR') {
+ space_before = !(flags.last_text === ']' && (current_token.text === '--' || current_token.text === '++'));
+ } else if (last_type === 'TK_OPERATOR') {
+ // a++ + ++b;
+ // a - -b
+ space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(flags.last_text, ['--', '-', '++', '+']);
+ // + and - are not unary when preceeded by -- or ++ operator
+ // a-- + b
+ // a * +b
+ // a - -b
+ if (in_array(current_token.text, ['+', '-']) && in_array(flags.last_text, ['--', '++'])) {
+ space_after = true;
+ }
+ }
+
+
+ if (((flags.mode === MODE.BlockStatement && !flags.inline_frame) || flags.mode === MODE.Statement) &&
+ (flags.last_text === '{' || flags.last_text === ';')) {
+ // { foo; --i }
+ // foo(); --bar;
+ print_newline();
+ }
+ }
+
+ output.space_before_token = output.space_before_token || space_before;
+ print_token();
+ output.space_before_token = space_after;
+ }
+
+ function handle_block_comment(preserve_statement_flags) {
+ if (output.raw) {
+ output.add_raw_token(current_token);
+ if (current_token.directives && current_token.directives.preserve === 'end') {
+ // If we're testing the raw output behavior, do not allow a directive to turn it off.
+ output.raw = opt.test_output_raw;
+ }
+ return;
+ }
+
+ if (current_token.directives) {
+ print_newline(false, preserve_statement_flags);
+ print_token();
+ if (current_token.directives.preserve === 'start') {
+ output.raw = true;
+ }
+ print_newline(false, true);
+ return;
+ }
+
+ // inline block
+ if (!acorn.newline.test(current_token.text) && !current_token.wanted_newline) {
+ output.space_before_token = true;
+ print_token();
+ output.space_before_token = true;
+ return;
+ }
+
+ var lines = split_linebreaks(current_token.text);
+ var j; // iterator for this case
+ var javadoc = false;
+ var starless = false;
+ var lastIndent = current_token.whitespace_before;
+ var lastIndentLength = lastIndent.length;
+
+ // block comment starts with a new line
+ print_newline(false, preserve_statement_flags);
+ if (lines.length > 1) {
+ javadoc = all_lines_start_with(lines.slice(1), '*');
+ starless = each_line_matches_indent(lines.slice(1), lastIndent);
+ }
+
+ // first line always indented
+ print_token(lines[0]);
+ for (j = 1; j < lines.length; j++) {
+ print_newline(false, true);
+ if (javadoc) {
+ // javadoc: reformat and re-indent
+ print_token(' ' + ltrim(lines[j]));
+ } else if (starless && lines[j].length > lastIndentLength) {
+ // starless: re-indent non-empty content, avoiding trim
+ print_token(lines[j].substring(lastIndentLength));
+ } else {
+ // normal comments output raw
+ output.add_token(lines[j]);
+ }
+ }
+
+ // for comments of more than one line, make sure there's a new line after
+ print_newline(false, preserve_statement_flags);
+ }
+
+ function handle_comment(preserve_statement_flags) {
+ if (current_token.wanted_newline) {
+ print_newline(false, preserve_statement_flags);
+ } else {
+ output.trim(true);
+ }
+
+ output.space_before_token = true;
+ print_token();
+ print_newline(false, preserve_statement_flags);
+ }
+
+ function handle_dot() {
+ if (start_of_statement()) {
+ // The conditional starts the statement if appropriate.
+ } else {
+ handle_whitespace_and_comments(current_token, true);
+ }
+
+ if (last_type === 'TK_RESERVED' && is_special_word(flags.last_text)) {
+ output.space_before_token = true;
+ } else {
+ // allow preserved newlines before dots in general
+ // force newlines on dots after close paren when break_chained - for bar().baz()
+ allow_wrap_or_preserved_newline(flags.last_text === ')' && opt.break_chained_methods);
+ }
+
+ print_token();
+ }
+
+ function handle_unknown(preserve_statement_flags) {
+ print_token();
+
+ if (current_token.text[current_token.text.length - 1] === '\n') {
+ print_newline(false, preserve_statement_flags);
+ }
+ }
+
+ function handle_eof() {
+ // Unwind any open statements
+ while (flags.mode === MODE.Statement) {
+ restore_mode();
+ }
+ handle_whitespace_and_comments(current_token);
+ }
+}
+
+module.exports.Beautifier = Beautifier;
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+function InputScanner(input) {
+ var _input = input;
+ var _input_length = _input.length;
+ var _position = 0;
+
+ this.back = function() {
+ _position -= 1;
+ };
+
+ this.hasNext = function() {
+ return _position < _input_length;
+ };
+
+ this.next = function() {
+ var val = null;
+ if (this.hasNext()) {
+ val = _input.charAt(_position);
+ _position += 1;
+ }
+ return val;
+ };
+
+ this.peek = function(index) {
+ var val = null;
+ index = index || 0;
+ index += _position;
+ if (index >= 0 && index < _input_length) {
+ val = _input.charAt(index);
+ }
+ return val;
+ };
+
+ this.peekCharCode = function(index) {
+ var val = 0;
+ index = index || 0;
+ index += _position;
+ if (index >= 0 && index < _input_length) {
+ val = _input.charCodeAt(index);
+ }
+ return val;
+ };
+
+ this.test = function(pattern, index) {
+ index = index || 0;
+ pattern.lastIndex = _position + index;
+ return pattern.test(_input);
+ };
+
+ this.testChar = function(pattern, index) {
+ var val = this.peek(index);
+ return val !== null && pattern.test(val);
+ };
+
+ this.match = function(pattern) {
+ pattern.lastIndex = _position;
+ var pattern_match = pattern.exec(_input);
+ if (pattern_match && pattern_match.index === _position) {
+ _position += pattern_match[0].length;
+ } else {
+ pattern_match = null;
+ }
+ return pattern_match;
+ };
+}
+
+
+module.exports.InputScanner = InputScanner;
+
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+function mergeOpts(allOptions, targetType) {
+ var finalOpts = {};
+ var name;
+
+ for (name in allOptions) {
+ if (name !== targetType) {
+ finalOpts[name] = allOptions[name];
+ }
+ }
+
+ //merge in the per type settings for the targetType
+ if (targetType in allOptions) {
+ for (name in allOptions[targetType]) {
+ finalOpts[name] = allOptions[targetType][name];
+ }
+ }
+ return finalOpts;
+}
+
+module.exports.mergeOpts = mergeOpts;
+
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+function OutputLine(parent) {
+ var _character_count = 0;
+ // use indent_count as a marker for lines that have preserved indentation
+ var _indent_count = -1;
+
+ var _items = [];
+ var _empty = true;
+
+ this.set_indent = function(level) {
+ _character_count = parent.baseIndentLength + level * parent.indent_length;
+ _indent_count = level;
+ };
+
+ this.get_character_count = function() {
+ return _character_count;
+ };
+
+ this.is_empty = function() {
+ return _empty;
+ };
+
+ this.last = function() {
+ if (!this._empty) {
+ return _items[_items.length - 1];
+ } else {
+ return null;
+ }
+ };
+
+ this.push = function(input) {
+ _items.push(input);
+ _character_count += input.length;
+ _empty = false;
+ };
+
+ this.pop = function() {
+ var item = null;
+ if (!_empty) {
+ item = _items.pop();
+ _character_count -= item.length;
+ _empty = _items.length === 0;
+ }
+ return item;
+ };
+
+ this.remove_indent = function() {
+ if (_indent_count > 0) {
+ _indent_count -= 1;
+ _character_count -= parent.indent_length;
+ }
+ };
+
+ this.trim = function() {
+ while (this.last() === ' ') {
+ _items.pop();
+ _character_count -= 1;
+ }
+ _empty = _items.length === 0;
+ };
+
+ this.toString = function() {
+ var result = '';
+ if (!this._empty) {
+ if (_indent_count >= 0) {
+ result = parent.indent_cache[_indent_count];
+ }
+ result += _items.join('');
+ }
+ return result;
+ };
+}
+
+function Output(indent_string, baseIndentString) {
+ baseIndentString = baseIndentString || '';
+ this.indent_cache = [baseIndentString];
+ this.baseIndentLength = baseIndentString.length;
+ this.indent_length = indent_string.length;
+ this.raw = false;
+
+ var lines = [];
+ this.baseIndentString = baseIndentString;
+ this.indent_string = indent_string;
+ this.previous_line = null;
+ this.current_line = null;
+ this.space_before_token = false;
+
+ this.add_outputline = function() {
+ this.previous_line = this.current_line;
+ this.current_line = new OutputLine(this);
+ lines.push(this.current_line);
+ };
+
+ // initialize
+ this.add_outputline();
+
+
+ this.get_line_number = function() {
+ return lines.length;
+ };
+
+ // Using object instead of string to allow for later expansion of info about each line
+ this.add_new_line = function(force_newline) {
+ if (this.get_line_number() === 1 && this.just_added_newline()) {
+ return false; // no newline on start of file
+ }
+
+ if (force_newline || !this.just_added_newline()) {
+ if (!this.raw) {
+ this.add_outputline();
+ }
+ return true;
+ }
+
+ return false;
+ };
+
+ this.get_code = function(end_with_newline, eol) {
+ var sweet_code = lines.join('\n').replace(/[\r\n\t ]+$/, '');
+
+ if (end_with_newline) {
+ sweet_code += '\n';
+ }
+
+ if (eol !== '\n') {
+ sweet_code = sweet_code.replace(/[\n]/g, eol);
+ }
+
+ return sweet_code;
+ };
+
+ this.set_indent = function(level) {
+ // Never indent your first output indent at the start of the file
+ if (lines.length > 1) {
+ while (level >= this.indent_cache.length) {
+ this.indent_cache.push(this.indent_cache[this.indent_cache.length - 1] + this.indent_string);
+ }
+
+ this.current_line.set_indent(level);
+ return true;
+ }
+ this.current_line.set_indent(0);
+ return false;
+ };
+
+ this.add_raw_token = function(token) {
+ for (var x = 0; x < token.newlines; x++) {
+ this.add_outputline();
+ }
+ this.current_line.push(token.whitespace_before);
+ this.current_line.push(token.text);
+ this.space_before_token = false;
+ };
+
+ this.add_token = function(printable_token) {
+ this.add_space_before_token();
+ this.current_line.push(printable_token);
+ };
+
+ this.add_space_before_token = function() {
+ if (this.space_before_token && !this.just_added_newline()) {
+ this.current_line.push(' ');
+ }
+ this.space_before_token = false;
+ };
+
+ this.remove_indent = function(index) {
+ var output_length = lines.length;
+ while (index < output_length) {
+ lines[index].remove_indent();
+ index++;
+ }
+ };
+
+ this.trim = function(eat_newlines) {
+ eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
+
+ this.current_line.trim(indent_string, baseIndentString);
+
+ while (eat_newlines && lines.length > 1 &&
+ this.current_line.is_empty()) {
+ lines.pop();
+ this.current_line = lines[lines.length - 1];
+ this.current_line.trim();
+ }
+
+ this.previous_line = lines.length > 1 ? lines[lines.length - 2] : null;
+ };
+
+ this.just_added_newline = function() {
+ return this.current_line.is_empty();
+ };
+
+ this.just_added_blankline = function() {
+ if (this.just_added_newline()) {
+ if (lines.length === 1) {
+ return true; // start of the file and newline = blank
+ }
+
+ var line = lines[lines.length - 2];
+ return line.is_empty();
+ }
+ return false;
+ };
+}
+
+module.exports.Output = Output;
+
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+function Token(type, text, newlines, whitespace_before, parent) {
+ this.type = type;
+ this.text = text;
+
+ // comments_before are
+ // comments that have a new line before them
+ // and may or may not have a newline after
+ // this is a set of comments before
+ this.comments_before = /* inline comment*/ [];
+
+
+ this.comments_after = []; // no new line before and newline after
+ this.newlines = newlines || 0;
+ this.wanted_newline = newlines > 0;
+ this.whitespace_before = whitespace_before || '';
+ this.parent = parent || null;
+ this.opened = null;
+ this.directives = null;
+}
+
+module.exports.Token = Token;
+
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+var Beautifier = __webpack_require__(1).Beautifier;
+
+function js_beautify(js_source_text, options) {
+ var beautifier = new Beautifier(js_source_text, options);
+ return beautifier.beautify();
+}
+
+module.exports = js_beautify;
+
+/***/ }),
+/* 7 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
+/*
+
+ The MIT License (MIT)
+
+ Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+var InputScanner = __webpack_require__(2).InputScanner;
+var Token = __webpack_require__(5).Token;
+var acorn = __webpack_require__(0);
+
+function trim(s) {
+ return s.replace(/^\s+|\s+$/g, '');
+}
+
+function in_array(what, arr) {
+ for (var i = 0; i < arr.length; i += 1) {
+ if (arr[i] === what) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function Tokenizer(input_string, opts) {
+
+ var whitespace = "\n\r\t ".split('');
+ var digit = /[0-9]/;
+ var digit_bin = /[01]/;
+ var digit_oct = /[01234567]/;
+ var digit_hex = /[0123456789abcdefABCDEF]/;
+
+ this.positionable_operators = '!= !== % & && * ** + - / : < << <= == === > >= >> >>> ? ^ | ||'.split(' ');
+ var punct = this.positionable_operators.concat(
+ // non-positionable operators - these do not follow operator position settings
+ '! %= &= *= **= ++ += , -- -= /= :: <<= = => >>= >>>= ^= |= ~ ...'.split(' '));
+
+ // words which should always start on new line.
+ this.line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');
+ var reserved_words = this.line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']);
+
+ // /* ... */ comment ends with nearest */ or end of file
+ var block_comment_pattern = /([\s\S]*?)((?:\*\/)|$)/g;
+
+ // comment ends just before nearest linefeed or end of file
+ var comment_pattern = /([^\n\r\u2028\u2029]*)/g;
+
+ var directives_block_pattern = /\/\* beautify( \w+[:]\w+)+ \*\//g;
+ var directive_pattern = / (\w+)[:](\w+)/g;
+ var directives_end_ignore_pattern = /([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g;
+
+ var template_pattern = /((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;
+
+ var n_newlines, whitespace_before_token, in_html_comment, tokens;
+ var input;
+
+ this.tokenize = function() {
+ input = new InputScanner(input_string);
+ in_html_comment = false;
+ tokens = [];
+
+ var next, last;
+ var token_values;
+ var open = null;
+ var open_stack = [];
+ var comments = [];
+
+ while (!(last && last.type === 'TK_EOF')) {
+ token_values = tokenize_next();
+ next = new Token(token_values[1], token_values[0], n_newlines, whitespace_before_token);
+ while (next.type === 'TK_COMMENT' || next.type === 'TK_BLOCK_COMMENT' || next.type === 'TK_UNKNOWN') {
+ if (next.type === 'TK_BLOCK_COMMENT') {
+ next.directives = token_values[2];
+ }
+ comments.push(next);
+ token_values = tokenize_next();
+ next = new Token(token_values[1], token_values[0], n_newlines, whitespace_before_token);
+ }
+
+ if (comments.length) {
+ next.comments_before = comments;
+ comments = [];
+ }
+
+ if (next.type === 'TK_START_BLOCK' || next.type === 'TK_START_EXPR') {
+ next.parent = last;
+ open_stack.push(open);
+ open = next;
+ } else if ((next.type === 'TK_END_BLOCK' || next.type === 'TK_END_EXPR') &&
+ (open && (
+ (next.text === ']' && open.text === '[') ||
+ (next.text === ')' && open.text === '(') ||
+ (next.text === '}' && open.text === '{')))) {
+ next.parent = open.parent;
+ next.opened = open;
+
+ open = open_stack.pop();
+ }
+
+ tokens.push(next);
+ last = next;
+ }
+
+ return tokens;
+ };
+
+ function get_directives(text) {
+ if (!text.match(directives_block_pattern)) {
+ return null;
+ }
+
+ var directives = {};
+ directive_pattern.lastIndex = 0;
+ var directive_match = directive_pattern.exec(text);
+
+ while (directive_match) {
+ directives[directive_match[1]] = directive_match[2];
+ directive_match = directive_pattern.exec(text);
+ }
+
+ return directives;
+ }
+
+ function tokenize_next() {
+ var resulting_string;
+ var whitespace_on_this_line = [];
+
+ n_newlines = 0;
+ whitespace_before_token = '';
+
+ var c = input.next();
+
+ if (c === null) {
+ return ['', 'TK_EOF'];
+ }
+
+ var last_token;
+ if (tokens.length) {
+ last_token = tokens[tokens.length - 1];
+ } else {
+ // For the sake of tokenizing we can pretend that there was on open brace to start
+ last_token = new Token('TK_START_BLOCK', '{');
+ }
+
+ while (in_array(c, whitespace)) {
+
+ if (acorn.newline.test(c)) {
+ if (!(c === '\n' && input.peek(-2) === '\r')) {
+ n_newlines += 1;
+ whitespace_on_this_line = [];
+ }
+ } else {
+ whitespace_on_this_line.push(c);
+ }
+
+ c = input.next();
+
+ if (c === null) {
+ return ['', 'TK_EOF'];
+ }
+ }
+
+ if (whitespace_on_this_line.length) {
+ whitespace_before_token = whitespace_on_this_line.join('');
+ }
+
+ if (digit.test(c) || (c === '.' && input.testChar(digit))) {
+ var allow_decimal = true;
+ var allow_e = true;
+ var local_digit = digit;
+
+ if (c === '0' && input.testChar(/[XxOoBb]/)) {
+ // switch to hex/oct/bin number, no decimal or e, just hex/oct/bin digits
+ allow_decimal = false;
+ allow_e = false;
+ if (input.testChar(/[Bb]/)) {
+ local_digit = digit_bin;
+ } else if (input.testChar(/[Oo]/)) {
+ local_digit = digit_oct;
+ } else {
+ local_digit = digit_hex;
+ }
+ c += input.next();
+ } else if (c === '.') {
+ // Already have a decimal for this literal, don't allow another
+ allow_decimal = false;
+ } else {
+ // we know this first loop will run. It keeps the logic simpler.
+ c = '';
+ input.back();
+ }
+
+ // Add the digits
+ while (input.testChar(local_digit)) {
+ c += input.next();
+
+ if (allow_decimal && input.peek() === '.') {
+ c += input.next();
+ allow_decimal = false;
+ }
+
+ // a = 1.e-7 is valid, so we test for . then e in one loop
+ if (allow_e && input.testChar(/[Ee]/)) {
+ c += input.next();
+
+ if (input.testChar(/[+-]/)) {
+ c += input.next();
+ }
+
+ allow_e = false;
+ allow_decimal = false;
+ }
+ }
+
+ return [c, 'TK_WORD'];
+ }
+
+ if (acorn.isIdentifierStart(input.peekCharCode(-1))) {
+ if (input.hasNext()) {
+ while (acorn.isIdentifierChar(input.peekCharCode())) {
+ c += input.next();
+ if (!input.hasNext()) {
+ break;
+ }
+ }
+ }
+
+ if (!(last_token.type === 'TK_DOT' ||
+ (last_token.type === 'TK_RESERVED' && in_array(last_token.text, ['set', 'get']))) &&
+ in_array(c, reserved_words)) {
+ if (c === 'in' || c === 'of') { // hack for 'in' and 'of' operators
+ return [c, 'TK_OPERATOR'];
+ }
+ return [c, 'TK_RESERVED'];
+ }
+
+ return [c, 'TK_WORD'];
+ }
+
+ if (c === '(' || c === '[') {
+ return [c, 'TK_START_EXPR'];
+ }
+
+ if (c === ')' || c === ']') {
+ return [c, 'TK_END_EXPR'];
+ }
+
+ if (c === '{') {
+ return [c, 'TK_START_BLOCK'];
+ }
+
+ if (c === '}') {
+ return [c, 'TK_END_BLOCK'];
+ }
+
+ if (c === ';') {
+ return [c, 'TK_SEMICOLON'];
+ }
+
+ if (c === '/') {
+ var comment = '';
+ var comment_match;
+ // peek for comment /* ... */
+ if (input.peek() === '*') {
+ input.next();
+ comment_match = input.match(block_comment_pattern);
+ comment = '/*' + comment_match[0];
+ var directives = get_directives(comment);
+ if (directives && directives.ignore === 'start') {
+ comment_match = input.match(directives_end_ignore_pattern);
+ comment += comment_match[0];
+ }
+ comment = comment.replace(acorn.allLineBreaks, '\n');
+ return [comment, 'TK_BLOCK_COMMENT', directives];
+ }
+ // peek for comment // ...
+ if (input.peek() === '/') {
+ input.next();
+ comment_match = input.match(comment_pattern);
+ comment = '//' + comment_match[0];
+ return [comment, 'TK_COMMENT'];
+ }
+
+ }
+
+ var startXmlRegExp = /<()([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g;
+
+ if (c === '`' || c === "'" || c === '"' || // string
+ (
+ (c === '/') || // regexp
+ (opts.e4x && c === "<" && input.test(startXmlRegExp, -1)) // xml
+ ) && ( // regex and xml can only appear in specific locations during parsing
+ (last_token.type === 'TK_RESERVED' && in_array(last_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||
+ (last_token.type === 'TK_END_EXPR' && last_token.text === ')' &&
+ last_token.parent && last_token.parent.type === 'TK_RESERVED' && in_array(last_token.parent.text, ['if', 'while', 'for'])) ||
+ (in_array(last_token.type, ['TK_COMMENT', 'TK_START_EXPR', 'TK_START_BLOCK',
+ 'TK_END_BLOCK', 'TK_OPERATOR', 'TK_EQUALS', 'TK_EOF', 'TK_SEMICOLON', 'TK_COMMA'
+ ]))
+ )) {
+
+ var sep = c,
+ esc = false,
+ has_char_escapes = false;
+
+ resulting_string = c;
+
+ if (sep === '/') {
+ //
+ // handle regexp
+ //
+ var in_char_class = false;
+ while (input.hasNext() &&
+ ((esc || in_char_class || input.peek() !== sep) &&
+ !input.testChar(acorn.newline))) {
+ resulting_string += input.peek();
+ if (!esc) {
+ esc = input.peek() === '\\';
+ if (input.peek() === '[') {
+ in_char_class = true;
+ } else if (input.peek() === ']') {
+ in_char_class = false;
+ }
+ } else {
+ esc = false;
+ }
+ input.next();
+ }
+ } else if (opts.e4x && sep === '<') {
+ //
+ // handle e4x xml literals
+ //
+
+ var xmlRegExp = /[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g;
+ input.back();
+ var xmlStr = '';
+ var match = input.match(startXmlRegExp);
+ if (match) {
+ // Trim root tag to attempt to
+ var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}');
+ var isCurlyRoot = rootTag.indexOf('{') === 0;
+ var depth = 0;
+ while (match) {
+ var isEndTag = !!match[1];
+ var tagName = match[2];
+ var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA[");
+ if (!isSingletonTag &&
+ (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) {
+ if (isEndTag) {
+ --depth;
+ } else {
+ ++depth;
+ }
+ }
+ xmlStr += match[0];
+ if (depth <= 0) {
+ break;
+ }
+ match = input.match(xmlRegExp);
+ }
+ // if we didn't close correctly, keep unformatted.
+ if (!match) {
+ xmlStr += input.match(/[\s\S]*/g)[0];
+ }
+ xmlStr = xmlStr.replace(acorn.allLineBreaks, '\n');
+ return [xmlStr, "TK_STRING"];
+ }
+ } else {
+ //
+ // handle string
+ //
+ var parse_string = function(delimiter, allow_unescaped_newlines, start_sub) {
+ // Template strings can travers lines without escape characters.
+ // Other strings cannot
+ var current_char;
+ while (input.hasNext()) {
+ current_char = input.peek();
+ if (!(esc || (current_char !== delimiter &&
+ (allow_unescaped_newlines || !acorn.newline.test(current_char))))) {
+ break;
+ }
+
+ // Handle \r\n linebreaks after escapes or in template strings
+ if ((esc || allow_unescaped_newlines) && acorn.newline.test(current_char)) {
+ if (current_char === '\r' && input.peek(1) === '\n') {
+ input.next();
+ current_char = input.peek();
+ }
+ resulting_string += '\n';
+ } else {
+ resulting_string += current_char;
+ }
+
+ if (esc) {
+ if (current_char === 'x' || current_char === 'u') {
+ has_char_escapes = true;
+ }
+ esc = false;
+ } else {
+ esc = current_char === '\\';
+ }
+
+ input.next();
+
+ if (start_sub && resulting_string.indexOf(start_sub, resulting_string.length - start_sub.length) !== -1) {
+ if (delimiter === '`') {
+ parse_string('}', allow_unescaped_newlines, '`');
+ } else {
+ parse_string('`', allow_unescaped_newlines, '${');
+ }
+
+ if (input.hasNext()) {
+ resulting_string += input.next();
+ }
+ }
+ }
+ };
+
+ if (sep === '`') {
+ parse_string('`', true, '${');
+ } else {
+ parse_string(sep);
+ }
+ }
+
+ if (has_char_escapes && opts.unescape_strings) {
+ resulting_string = unescape_string(resulting_string);
+ }
+
+ if (input.peek() === sep) {
+ resulting_string += sep;
+ input.next();
+
+ if (sep === '/') {
+ // regexps may have modifiers /regexp/MOD , so fetch those, too
+ // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.
+ while (input.hasNext() && acorn.isIdentifierStart(input.peekCharCode())) {
+ resulting_string += input.next();
+ }
+ }
+ }
+ return [resulting_string, 'TK_STRING'];
+ }
+
+ if (c === '#') {
+
+ if (tokens.length === 0 && input.peek() === '!') {
+ // shebang
+ resulting_string = c;
+ while (input.hasNext() && c !== '\n') {
+ c = input.next();
+ resulting_string += c;
+ }
+ return [trim(resulting_string) + '\n', 'TK_UNKNOWN'];
+ }
+
+
+
+ // Spidermonkey-specific sharp variables for circular references
+ // https://developer.mozilla.org/En/Sharp_variables_in_JavaScript
+ // http://mxr.mozilla.org/mozilla-central/source/js/src/jsscan.cpp around line 1935
+ var sharp = '#';
+ if (input.hasNext() && input.testChar(digit)) {
+ do {
+ c = input.next();
+ sharp += c;
+ } while (input.hasNext() && c !== '#' && c !== '=');
+ if (c === '#') {
+ //
+ } else if (input.peek() === '[' && input.peek(1) === ']') {
+ sharp += '[]';
+ input.next();
+ input.next();
+ } else if (input.peek() === '{' && input.peek(1) === '}') {
+ sharp += '{}';
+ input.next();
+ input.next();
+ }
+ return [sharp, 'TK_WORD'];
+ }
+ }
+
+ if (c === '<' && (input.peek() === '?' || input.peek() === '%')) {
+ input.back();
+ var template_match = input.match(template_pattern);
+ if (template_match) {
+ c = template_match[0];
+ c = c.replace(acorn.allLineBreaks, '\n');
+ return [c, 'TK_STRING'];
+ }
+ }
+
+ if (c === '<' && input.match(/\!--/g)) {
+ c = '', 'TK_COMMENT'];
+ }
+
+ if (c === '.') {
+ if (input.peek() === '.' && input.peek(1) === '.') {
+ c += input.next() + input.next();
+ return [c, 'TK_OPERATOR'];
+ }
+ return [c, 'TK_DOT'];
+ }
+
+ if (in_array(c, punct)) {
+ while (input.hasNext() && in_array(c + input.peek(), punct)) {
+ c += input.next();
+ if (!input.hasNext()) {
+ break;
+ }
+ }
+
+ if (c === ',') {
+ return [c, 'TK_COMMA'];
+ } else if (c === '=') {
+ return [c, 'TK_EQUALS'];
+ } else {
+ return [c, 'TK_OPERATOR'];
+ }
+ }
+
+ return [c, 'TK_UNKNOWN'];
+ }
+
+
+ function unescape_string(s) {
+ // You think that a regex would work for this
+ // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) {
+ // return String.fromCharCode(parseInt(val, 16));
+ // })
+ // However, dealing with '\xff', '\\xff', '\\\xff' makes this more fun.
+ var out = '',
+ escaped = 0;
+
+ var input_scan = new InputScanner(s);
+ var matched = null;
+
+ while (input_scan.hasNext()) {
+ // Keep any whitespace, non-slash characters
+ // also keep slash pairs.
+ matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g);
+
+ if (matched) {
+ out += matched[0];
+ }
+
+ if (input_scan.peek() === '\\') {
+ input_scan.next();
+ if (input_scan.peek() === 'x') {
+ matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);
+ } else if (input_scan.peek() === 'u') {
+ matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);
+ } else {
+ out += '\\';
+ if (input_scan.hasNext()) {
+ out += input_scan.next();
+ }
+ continue;
+ }
+
+ // If there's some error decoding, return the original string
+ if (!matched) {
+ return s;
+ }
+
+ escaped = parseInt(matched[1], 16);
+
+ if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {
+ // we bail out on \x7f..\xff,
+ // leaving whole string escaped,
+ // as it's probably completely binary
+ return s;
+ } else if (escaped >= 0x00 && escaped < 0x20) {
+ // leave 0x00...0x1f escaped
+ out += '\\' + matched[0];
+ continue;
+ } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {
+ // single-quote, apostrophe, backslash - escape these
+ out += '\\' + String.fromCharCode(escaped);
+ } else {
+ out += String.fromCharCode(escaped);
+ }
+ }
+ }
+
+ return out;
+ }
+}
+
+module.exports.Tokenizer = Tokenizer;
+
+/***/ })
+/******/ ]);
+var js_beautify = legacy_beautify_js;
+/* Footer */
+if (typeof define === "function" && define.amd) {
+ // Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
+ define([], function() {
+ return { js_beautify: js_beautify };
+ });
+} else if (typeof exports !== "undefined") {
+ // Add support for CommonJS. Just put this file somewhere on your require.paths
+ // and you will be able to `var js_beautify = require("beautify").js_beautify`.
+ exports.js_beautify = js_beautify;
+} else if (typeof window !== "undefined") {
+ // If we're running a web page and don't have either of the above, add our one global
+ window.js_beautify = js_beautify;
+} else if (typeof global !== "undefined") {
+ // If we don't even have window, try global.
+ global.js_beautify = js_beautify;
+}
+
+}());
\ No newline at end of file
diff --git a/Support/run_script.rb b/Support/run_script.rb
new file mode 100755
index 0000000..f60268d
--- /dev/null
+++ b/Support/run_script.rb
@@ -0,0 +1,27 @@
+#!/usr/bin/env ruby18
+
+require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor"
+require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/save_current_document"
+require "pathname"
+
+TextMate.save_if_untitled
+
+USING_NVM = ARGV[0] == '1'
+
+if ENV.has_key?('TM_NODE') && !ENV['TM_NODE'].empty?
+ NODE = ENV['TM_NODE']
+else
+ NODE = 'node'
+end
+
+cmd = [ NODE, ENV['TM_FILEPATH'] ]
+
+opts = {
+ :env => ENV,
+ :use_hashbang => ENV.has_key?('TM_NODE'),
+ :create_error_pipe => true
+}
+
+opts[:version_replace] = '\1 (NVM)' if USING_NVM
+
+TextMate::Executor.run(cmd, opts)
\ No newline at end of file
diff --git a/Support/run_script.sh b/Support/run_script.sh
new file mode 100755
index 0000000..5f061ed
--- /dev/null
+++ b/Support/run_script.sh
@@ -0,0 +1,38 @@
+# Runs the current file in Node and displays output in an HTML window.
+#
+# Decides on a particular version of Node based on the first of these
+# strategies to succeed:
+#
+# 1. If $TM_NODE is set and non-empty, use it.
+# 2. If NVM is installed and there's an .nvmrc in the project root (if in a
+# project) or current file's directory (if not in a project), use that
+# version.
+# 3. If NVM is installed and the user has a 'default' alias, use that
+# version.
+# 4. If NVM is installed, use the 'system' version.
+# 5. If NVM is not installed, use whatever version of node exists in $PATH.
+
+if [[ -d "$TM_PROJECT_DIRECTORY" ]]; then
+ working_dir=$TM_PROJECT_DIRECTORY
+elif [[ -d "$TM_FILEPATH" ]]; then
+ working_dir=$(dirname $TM_FILEPATH)
+else
+ working_dir=$HOME
+fi
+
+cd "$working_dir"
+
+using_nvm=0
+if [ -z "$TM_NODE" ]; then
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
+ using_nvm=1
+ source "$NVM_DIR/nvm.sh"
+ # We should respect any .nvmrc that may exist. If it doesn't exist, fall
+ # back to a 'default' alias. If that doesn't exist, use the system node.
+ nvm use --silent 2>/dev/null ||\
+ nvm use --silent default 2>/dev/null ||\
+ nvm use --silent system 2>/dev/null
+ fi
+fi
+
+"$TM_BUNDLE_SUPPORT/run_script.rb" "$using_nvm"
diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist
index dd46b1f..7ee32ed 100644
--- a/Syntaxes/JavaScript.plist
+++ b/Syntaxes/JavaScript.plist
@@ -3,7 +3,32 @@
comment
- JavaScript Syntax: version 2.0
+
+ JavaScript / ES2015 / JSX Grammar
+ ---------------------------------
+
+ Based on https://github.com/gandm/language-babel, but with
+ many changes:
+
+ * Scope names were cleaned up and now conform much more to
+ TextMate conventions.
+ * A number of instances were fixed where _two_ space-separated
+ scope names were used as a scope value, which screws up a _lot_
+ of stuff.
+ * Removed all the Facebook Flow stuff.
+ * Added all of the defined DOM APIs that are part of the
+ official JS bundle.
+ * Leading space before a single-line comment (double-slash) is now
+ part of the comment’s scope, which makes life easier for commands
+ and snippets that act on comments.
+
+ Yet to be done:
+
+ * JSX really ought to go in a separate grammar that then includes
+ this one, but that’d be tricky, and would likely have to pluck
+ lots of individual repo items out of this grammar instead of
+ just including it whole, so I’m not looking forward to it.
+
fileTypes
js
@@ -36,1231 +61,3295 @@
1
name
- punctuation.definition.comment.js
+ punctuation.section.scope.begin.js
+
+ 2
+
+ name
+ punctuation.section.scope.end.js
comment
- Match the shebang for JavaScript executables
+ Allows the special return snippet to fire.
match
- \A(#!).*$\n
- name
- comment.line.number-sign.shebang.js
+ (\{)(\})
- begin
- (?<!\.)\b(import)(?!\s*:)\b
- beginCaptures
+ captures
1
name
- keyword.control.import.js
+ meta.brace.round.begin.js
-
- end
- (;)|\n|(?=//)
- endCaptures
-
- 1
+ 2
name
- punctuation.terminator.statement.js
+ meta.brace.round.end.js
- name
- meta.import.js
+ comment
+ Allows special actions when the cursor is between two parentheses.
+ match
+ (\()(\))
+
+
+ include
+ #core
+
+
+ repository
+
+ brackets
+
+ patterns
+
+
+ include
+ #round-brackets
+
+
+ include
+ #square-brackets
+
+
+ include
+ #curly-brackets
+
+
+
+ class-method-definition
+
patterns
begin
- \{
+ (@@[_$a-zA-Z][$\w]*|static|return)(?=\s*[<(])|(?=\s*<)
beginCaptures
- 0
+ 1
name
- punctuation.definition.modules.begin.js
+ keyword.operator.flowtype.js
- comment
- { member1 , member2 as alias2 , [...] }
end
- \}
- endCaptures
-
- 0
+ (?=\s*[;{])
+ name
+ meta.short-method.flowtype.js
+ patterns
+
- name
- punctuation.definition.modules.end.js
+ include
+ #function-declaration-parameters
-
+
+ include
+ #comments
+
+
+ include
+ #curly-brackets
+
+
+
+
+ begin
+ (?<=[]"'])\s*(?=[<(])
+ end
+ (?=\s*[;{])
+ name
+ meta.class-method.computed.js
patterns
- captures
-
- 1
-
- name
- variable.language.default.js
-
- 2
-
- name
- variable.other.module.js
-
- 3
-
- name
- keyword.control.js
-
- 4
-
- name
- invalid.illegal.js
-
- 5
-
- name
- variable.other.module-alias.js
-
-
- comment
- (default|name) as alias
- match
- (?x)
- (?: \b(default)\b | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
- \s*
- (\b as \b)
- \s*
- (?: (\b default \b | \*) | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
+ include
+ #function-declaration-parameters
- match
- ,
+ include
+ #comments
+
+
+ include
+ #curly-brackets
+
+
+
+
+ begin
+ (?x)
+ ((?>get|set)\s+)
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ ([_$a-zA-Z][$\w]*|\d+)
+ )(?=\s*[<(])
+ beginCaptures
+
+ 1
+
+ name
+ storage.type.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ string.quoted.single.js
+
+ 3
+
+ name
+ punctuation.definition.string.begin.js
+
+ 4
+
+ name
+ entity.name.function.js
+
+ 5
+
+ name
+ punctuation.definition.string.end.js
+
+ 6
+
+ name
+ string.quoted.double.js
+
+ 7
+
+ name
+ punctuation.definition.string.begin.js
+
+ 8
+
+ name
+ entity.name.function.js
+
+ 9
+
name
- punctuation.separator.object.js
+ punctuation.definition.string.end.js
+
+
+ end
+ (?=\s*[;{])
+ name
+ meta.class-accessor.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
include
#comments
- match
- \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b
- name
- variable.other.module.js
+ include
+ #curly-brackets
- captures
+ begin
+ (?x)
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ ([_$a-zA-Z][$\w]*|\d+)
+ )(?=\s*[<(])
+ beginCaptures
1
name
- variable.language.default.js
+ string.quoted.single.js
2
name
- variable.language.import-all.js
+ punctuation.definition.string.begin.js
3
name
- variable.other.module.js
+ entity.name.function.js
4
name
- keyword.control.js
+ punctuation.definition.string.end.js
5
name
- invalid.illegal.js
+ string.quoted.double.js
6
name
- variable.other.module-alias.js
+ punctuation.definition.string.begin.js
+
+ 7
+
+ name
+ entity.name.function.js
+
+ 8
+
+ name
+ punctuation.definition.string.end.js
+
+ 9
+
+ name
+ entity.name.function.js
- comment
- (default|*|name) as alias
- match
- (?x)
- (?: \b(default)\b | (\*) | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
- \s*
- (\b as \b)
- \s*
- (?: (\b default \b | \*) | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
-
-
-
- match
- \*
+ end
+ (?=\s*[;{])
name
- variable.language.import-all.js
+ meta.class-method.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+ include
+ #comments
+
+
+ include
+ #curly-brackets
+
+
+
+
+ class-method-storage
+
+ patterns
+
match
- \b(default)\b
+ (?<!\.)\b(?>static|declare)\b
name
- variable.language.default.js
-
-
- include
- #strings
-
-
- include
- #comments
+ storage.modifier.js
match
- \b(from)\b
+ (?<!\.)\b(async)\b
name
- keyword.control.js
+ storage.type.js
match
- \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b(?=.*\bfrom\b)
+ (?<!\.)\b(get|set)\b(?!\s*\()
name
- variable.other.module.js
+ storage.type.js
match
- ,
+ \*
name
- punctuation.separator.object.js
+ storage.modifier.generator.js
+ class-properties
- captures
-
- 1
-
- name
- keyword.control.js
-
- 2
-
- name
- variable.language.default.js
-
- 3
+ patterns
+
+ begin
+ ([_$a-zA-Z][$\w]*)(?=\s*[:=])
+ beginCaptures
+
+ 1
+
+ name
+ variable.other.property.js
+
+
+ end
+ (?=\s*[;}])
name
- variable.other.module.js
+ meta.class.property.js
+ patterns
+
+
+ include
+ #expression
+
+
-
- comment
- ES6 export: `export default (variable|class|function, etc.)`
- match
- (?x) \b(export)\b \s* \b(default)\b (?:\s*) \b((?!\bfunction\b|\bclass\b|\blet\b|\bvar\b|\bconst\b)[\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)?\b
- name
- meta.export.js
+
+ comments
- begin
- (?<!\.)\b(export)(?!\s*:)\b
- beginCaptures
-
- 1
-
- name
- keyword.control.export.js
-
-
- comment
- ES6 export, re-export: `export {member as alias, [...]} [from ...]`
- end
- (?=;|\bfunction\b|\bclass\b|\blet\b|\bvar\b|\bconst\b|$)
- name
- meta.export.js
patterns
-
- include
- #numbers
-
begin
- \{(?=.*\bfrom\b)
- beginCaptures
+ /\*\*(?!/)
+ captures
0
name
- punctuation.definition.modules.begin.js
+ punctuation.definition.comment.js
- comment
- `{ member1 , member2 as alias2 , [...] }` inside re-export
end
- \}
- endCaptures
-
- 0
-
- name
- punctuation.definition.modules.end.js
-
-
+ \*/
+ name
+ comment.block.documentation.js
+
patterns
- captures
-
- 1
-
- name
- variable.language.default.js
-
- 2
-
- name
- variable.other.module.js
-
- 3
-
- name
- keyword.control.js
-
- 4
-
- name
- variable.language.default.js
-
- 5
-
- name
- invalid.illegal.js
-
- 6
-
- name
- variable.other.module-alias.js
-
-
- comment
- (default|name) as alias
- match
- (?x)
- (?: \b(default)\b | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
- \s*
- (\b as \b)
- \s*
- (?: \b(default)\b | (\*) | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
-
-
-
- match
- ,
- name
- meta.delimiter.object.comma.js
-
-
+
match
- \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b
+ (?<!\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|default[vV]alue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extension[fF]or|external|field|file|file[oO]verview|final|fires|for|function|global|host|ignore|implements|inherit[dD]oc|inner|instance|interface|kind|lends|license|link|listens|main|member|member[oO]f|method|mixex|mixins?|module|name|namespace|no[cC]ollapse|no[sS]ide[eE]ffects|override|overview|package|param|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|template|this|throws|todo|TODO|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|write[oO]nce)\b
name
- variable.other.module.js
+ keyword.other.documentation.js.jsdoc
begin
- (?![\p{L}\p{Nl}$_])\{
+ /\*
beginCaptures
0
name
- punctuation.definition.modules.begin.js
+ punctuation.definition.comment.begin.js
- comment
- { member1 , member2 as alias2 , [...] }
end
- \}
+ \*/
endCaptures
0
name
- punctuation.definition.modules.end.js
+ punctuation.definition.comment.end.js
- patterns
-
-
- captures
-
- 1
-
- name
- invalid.illegal.js
-
- 2
-
- name
- variable.other.module.js
-
- 3
-
- name
- keyword.control.js
-
- 4
-
- name
- variable.language.default.js
-
- 5
-
- name
- invalid.illegal.js
-
- 6
-
- name
- variable.other.module-alias.js
-
-
- comment
- name as (default|alias)
- match
- (?x)
- (?: \b(default)\b | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
- \s*
- (\b as \b)
- \s*
- (?: \b(default)\b | (\*) | \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b)
-
-
+ name
+ comment.block.js
+
+
+ captures
+
+ 0
- match
- ,
name
- meta.delimiter.object.comma.js
+ punctuation.definition.comment.js
+
+ match
+ (?><!--|-->)
+ name
+ comment.block.html.js
+
+
+ captures
+
+ 1
- match
- \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b
name
- variable.other.module.js
+ punctuation.definition.comment.js
-
-
-
+
match
- \*(?=.*\bfrom\b)
+ (\s*)(//).*$\n?
name
- variable.language.import-all.js
+ comment.line.double-slash.js
+ captures
+
+ 1
+
+ name
+ punctuation.definition.comment.js
+
+
match
- \b(default)\b
+ ^(#!).*$\n?
name
- variable.language.default.js
+ comment.line.number-sign.shebang.js
+
+
+ core
+
+ patterns
+
include
- #strings
+ #literal-function-labels
include
- #comments
+ #literal-arrow-function-labels
- match
- \b(from)\b
- name
- keyword.control.js
+ include
+ #literal-labels
- match
- \b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)\b
- name
- variable.other.module.js
+ include
+ #literal-for
- match
- ,
- name
- meta.delimiter.object.comma.js
+ include
+ #literal-switch
+
+
+ include
+ #expression
include
- #operators
+ #literal-punctuation
+ curly-brackets
- begin
- (?x)
- (?:
- (?<!\w) # Ensure word boundry
- ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*) # Identifier
- \s*(=)\s*
- )? # Optional
- \b(function)
- (?:\s*
- (\*) # Optional generator notation
- )? # (ECMAScript 6)
- (?:\s*
- (?<=[\s\*])
- ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*) # Optional Name
- )?
- \s*(\()
-
- beginCaptures
-
- 1
+ patterns
+
+ begin
+ {
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.begin.js
+
+
+ end
+ }
+ endCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.end.js
+
+
name
- meta.function.variable.js
+ meta.group.braces.curly.js
+ patterns
+
+
+ include
+ $self
+
+
- 2
+
+
+ es7-decorators
+
+ patterns
+
+ captures
+
+ 1
+
+ name
+ punctuation.definition.tag.js
+
+ 2
+
+ name
+ entity.name.tag.js
+
+
+ match
+ (?x)
+ (@)([_$a-zA-Z][$\w]*)\b
name
- keyword.operator.assignment.js
+ meta.tag.decorator.js
- 3
+
+
+ expression
+
+ patterns
+
- name
- storage.type.function.js
+ include
+ #merge-conflits
- 4
- name
- storage.modifier.js
+ include
+ #literal-regexp
- 5
- name
- entity.name.function.js
+ include
+ #literal-jsx
- 6
- name
- punctuation.definition.parameters.begin.js
+ include
+ #es7-decorators
-
- comment
- Match function, optional function name and optional function arguments
- end
- (\))
- endCaptures
-
- 1
- name
- punctuation.definition.parameters.end.js
+ include
+ #support-class
-
- name
- meta.function.js
- patterns
-
include
- #function-params
+ #support-dom
-
-
-
- begin
- (?x)
- \b
- (?: (static) \s+ )? # Optional static keyword
- (?! # Dont match known keywords
- (?:async|await|break|case|catch|continue|do|else|finally|for|function|if|
- export|import|package|return|switch|throw|try|while|with)
- [\s\(]
- )
- ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)
- \s*
- (\()
- (?=(?:[^\(\)]*)?\)\s*\{)
-
- beginCaptures
-
- 1
- name
- storage.modifier.static.js
+ include
+ #support-other
- 2
- name
- entity.name.function.js
+ include
+ #literal-function
- 3
- name
- punctuation.definition.parameters.begin.js
+ include
+ #literal-arrow-function
-
- end
- \)
- endCaptures
-
- 0
- name
- punctuation.definition.parameters.begin.js
+ include
+ #literal-prototype
-
- name
- meta.method.js
- patterns
-
include
- #function-params
+ #literal-keywords
-
-
-
- begin
- (?x)
- \b(class)(?=\s|$)
- (?:
- \s+
- ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)
- )?
- (?:
- \s+
- (extends)
- \s+
- (?:\b([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}\.]*)\b(?![\(]))?
- )?
-
- beginCaptures
-
- 1
- name
- storage.type.class.js
+ include
+ #literal-method
- 2
- name
- entity.name.type.class.js
+ include
+ #literal-module
- 3
- name
- storage.modifier.js
+ include
+ #literal-class
- 4
- name
- entity.other.inherited-class.js
+ include
+ #literal-number
-
- end
- \s*($|(?=\{))
- name
- meta.class.js
- patterns
-
include
- #function-call
+ #literal-template-string
-
-
-
- begin
- (?<=[\[=(?:+,!]|^|return|=>|&&|\|\|)\s*(?=/[^/*+?].*/)
- comment
- Dont scope preceding whitespace as string.regex
- end
- (?<=[/igmuy])
- patterns
-
- begin
- /
- beginCaptures
+ include
+ #literal-string
+
+
+ include
+ #literal-language-constant
+
+
+ include
+ #literal-language-variable
+
+
+ include
+ #literal-constructor
+
+
+ include
+ #literal-method-call
+
+
+ include
+ #literal-function-call
+
+
+ include
+ #comments
+
+
+ include
+ #brackets
+
+
+ include
+ #literal-operators
+
+
+ include
+ #literal-variable
+
+
+
+ function-declaration-parameters
+
+ patterns
+
+
+ begin
+ \(
+ beginCaptures
- 1
+ 0
name
- punctuation.definition.string.begin.js
+ punctuation.definition.parameters.begin.js
end
- (/)[igmuy]*
+ \)
endCaptures
- 1
+ 0
name
- punctuation.definition.string.end.js
+ punctuation.definition.parameters.end.js
- name
- string.regexp.js
patterns
include
- source.js.regexp
+ #comments
+
+
+ match
+ (?<!\.)\.\.\.
+ name
+ keyword.operator.spread.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)
+ name
+ variable.parameter.function.js
+
+
+ match
+ ,
+ name
+ punctuation.separator.parameter.function.js
+
+
+ begin
+ =
+ beginCaptures
+
+ 0
+
+ name
+ keyword.operator.assignment.js
+
+
+ end
+ (?=[,)])
+ name
+ meta.parameter.optional.js
+ patterns
+
+
+ include
+ #expression
+
+
+ jsx-attribute-assignment
+
+ match
+ =
+ name
+ keyword.operator.assignment.jsx
+
+ jsx-attribute-name
+
+ match
+ [_$a-zA-Z][-$\w]*
+ name
+ entity.other.attribute-name.jsx
+
+ jsx-attributes
+
+ patterns
+
+
+ include
+ #jsx-attribute-name
+
+
+ include
+ #jsx-attribute-assignment
+
+
+ include
+ #jsx-string-quoted
+
+
+ include
+ #jsx-evaluated-code
+
+
+ include
+ #comments
+
+
+
+ jsx-entities
+
+ patterns
+
+
+ match
+ &(?:[a-zA-Z0-9]+|#\d+|#x\h+);
+ name
+ constant.character.entity.jsx
+
+
+ match
+ &\S*;
+ name
+ invalid.illegal.bad-ampersand.jsx
+
+
+
+ jsx-evaluated-code
begin
- \?
+ {
beginCaptures
0
name
- keyword.operator.ternary.js
+ punctuation.section.embedded.begin.jsx
- comment
- Matching as a capture group prevents false positives with other uses of :
end
- ([^:"'`\[\]{}()]*)(:)
+ }
endCaptures
- 1
-
- patterns
-
-
- include
- $self
-
-
-
- 2
+ 0
name
- keyword.operator.ternary.js
+ punctuation.section.embedded.end.jsx
name
- meta.ternary-if.js
+ meta.embedded.expression.jsx
patterns
include
- $self
+ #expression
+ jsx-string-quoted
- match
- (?<!\w)[\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?=\s*:\s*function\b)
- name
- entity.name.function.js
-
-
- match
- (?<!\w)[\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?=\s*:)
- name
- entity.name.type.attribute-name.js
-
-
- include
- #numbers
-
-
- include
- #strings
-
-
- include
- #comments
-
-
- include
- #function-call
-
-
- include
- #operators
-
-
- match
- =>
- name
- storage.type.arrow.js
-
-
- match
- (?<!\.|\$)\b(let|var)\b(?!\$)
- name
- storage.type.var.js
-
-
- match
- (?<!\.|\$)\b(get|set|const)\b(?!\$)
- name
- storage.modifier.js
-
-
- captures
-
- 1
+ patterns
+
+ begin
+ '
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.begin.jsx
+
+
+ end
+ (?<!\\)'
+ endCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.end.jsx
+
+
name
- keyword.control.js
+ string.quoted.single.jsx
+ patterns
+
+
+ include
+ #jsx-entities
+
+
- 2
+ begin
+ "
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.begin.jsx
+
+
+ end
+ (?<!\\)"
+ endCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.end.jsx
+
+
name
- storage.modifier.js
+ string.quoted.double.jsx
+ patterns
+
+
+ include
+ #jsx-entities
+
+
-
- match
- (?<!\.)\b(yield)(?!\s*:)\b(?:\s*(\*))?
- name
- meta.control.yield.js
-
-
- match
- (?<!\.|\$)\b(async|await|break|case|catch|continue|default|do|else|export|finally|for|if|return|switch|throw|try|while|with)\b(?!\$)
- name
- keyword.control.js
+
+ jsx-tag-end
- match
- (?<!\.|\$)\b(delete|in|instanceof|new|of|typeof|void)\b(?!\$)
+ begin
+ >
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.definition.tag.end.jsx
+
+
+ end
+ (?=</)
name
- keyword.operator.js
+ meta.tag.jsx
+ patterns
+
+
+ include
+ #jsx-tag-start
+
+
+ include
+ #jsx-evaluated-code
+
+
+ include
+ #jsx-entities
+
+
+ jsx-tag-start
- match
- (?<!\.|\$)\b(debugger)\b(?!\$)
- name
- keyword.other.js
-
-
- match
- (?<!\.|\$)\b(Array|Boolean|Date|Error|EvalError|Function|Map|Number|Object|Promise|Proxy|RangeError|ReferenceError|Reflect|RegExp|Set|String|SyntaxError|TypeError|URIError|WeakMap|WeakSet)\b(?!\$)
- name
- support.class.js
-
-
- comment
- DOM Core Level 4 (http://www.w3.org/TR/domcore/) and DOM Events Level 3 (http://www.w3.org/TR/DOM-Level-3-Events/)
- match
- (?<!\.|\$)\b(Attr|CharacterData|Comment|CompositionEvent|CustomEvent|Document|DocumentFragment|DocumentType|DOMError|DOMException|DOMImplementation|DOMParser|DOMString|DOMTimestamp|DOMSettableTokenList|DOMStringList|DOMTokenList|Element|Event|EventTarget|FocusEvent|HTMLCollection|KeyboardEvent|MouseEvent|MutationObserver|MutationRecord|Node|NodeFilter|NodeIterator|NodeList|ProcessingInstruction|Range|Text|TextEvent|TreeWalker|UIEvent|WheelEvent|XMLDocument)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (<)([_$a-zA-Z][-$:.\w]*[$\w]*)
+ beginCaptures
+
+ 1
+
+ name
+ punctuation.definition.tag.begin.jsx
+
+ 2
+
+ name
+ entity.name.tag.jsx
+
+
+ end
+ (</)(\2)(>)|(/>)
+ endCaptures
+
+ 1
+
+ name
+ punctuation.definition.tag.begin.jsx
+
+ 2
+
+ name
+ entity.name.tag.jsx
+
+ 3
+
+ name
+ punctuation.definition.tag.end.jsx
+
+ 4
+
+ name
+ punctuation.definition.tag.end.jsx
+
+
+ name
+ meta.tag.jsx
+ patterns
+
+
+ include
+ #jsx-tag-end
+
+
+ include
+ #jsx-attributes
+
+
+
+
+ match
+ <
+ name
+ invalid.illegal.tag.incomplete.jsx
+
+
+ literal-arrow-function
- comment
- DOM Core Level 4 (http://www.w3.org/TR/domcore/) and DOM Events Level 3 (http://www.w3.org/TR/DOM-Level-3-Events/)
- match
- (?<!\.|\$)\b(CDATASection|DOMConfiguration|DOMErrorHandler|DOMImplementationList|DOMImplementationSource|DOMLocator|DOMObject|DOMUserData|Entity|EntityReference|MutationEvent|NamedNodeMap|NameList|Notation|TypeInfo|UserDataHandler)\b(?!\$)
- name
- invalid.deprecated.dom.js
+ patterns
+
+
+ begin
+ (?x)
+ (?:([_$a-zA-Z][$\w]*)\s*(=)\s*)? # optional variable assignment
+ (?:\b(async)\s+)? # optional async
+ (?= # followed by...
+ (\( # literal open-paren
+ (?>
+ (?>[^()]+)| # parameters
+ \g<-1> # or repeat this capture group (paren-balancing)
+ )* # (0 or more of)
+ \))\s*(=>) # close paren, arrow
+ )
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ keyword.operator.assignment.js
+
+ 3
+
+ name
+ storage.type.js
+
+
+ end
+ (?<=\))\s*(=>)
+ endCaptures
+
+ 1
+
+ name
+ storage.type.function.arrow.js
+
+
+ name
+ meta.function.arrow.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ keyword.operator.assignment.js
+
+ 3
+
+ name
+ storage.type.js
+
+ 4
+
+ name
+ variable.parameter.function.js
+
+ 5
+
+ name
+ storage.type.function.arrow.js
+
+
+ comment
+ arrow function with one parameter (doesn’t need parens)
+ match
+ (?x)
+ (?:([_$a-zA-Z][$\w]*)\s*(=)\s*)? # optional variable assignment
+ (?:(async)\s+)? # optional async
+ \b([_$a-zA-Z][$\w]*)\s*(=>) # param name, arrow
+
+ name
+ meta.function.arrow.js
+
+
+ begin
+ (?x)
+ (\b_?[A-Z][$\w]*)? # object
+ (\.)(prototype)
+ (\.)([_$a-zA-Z][$\w]*) # identifier
+ \s*(=)
+ \s*(async)? # optional async
+ \s*
+ (?= # followed by
+ (\( # open paren
+ (?>
+ (?>[^()]+)|\g<-1> # params OR repeat this capture group (paren-balancing)
+ )*
+ \))\s*(=>)) # close paren, arrow
+
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ variable.language.prototype.js
+
+ 4
+
+ name
+ keyword.operator.accessor.js
+
+ 5
+
+ name
+ entity.name.function.js
+
+ 6
+
+ name
+ keyword.operator.assignment.js
+
+ 7
+
+ name
+ storage.type.js
+
+
+ end
+ (?<=\))\s*(=>)
+ endCaptures
+
+ 1
+
+ name
+ storage.type.function.arrow.js
+
+
+ name
+ meta.prototype.function.arrow.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ variable.language.prototype.js
+
+ 4
+
+ name
+ keyword.operator.accessor.js
+
+ 5
+
+ name
+ entity.name.function.js
+
+ 6
+
+ name
+ keyword.operator.assignment.js
+
+ 7
+
+ name
+ storage.type.js
+
+ 8
+
+ name
+ variable.parameter.function.js
+
+ 9
+
+ name
+ storage.type.function.arrow.js
+
+
+ comment
+ arrow function with one parameter (doesn’t need parens)
+ match
+ (?x)
+ (\b_?[A-Z][$\w]*)? # object
+ (\.)(prototype)
+ (\.)([_$a-zA-Z][$\w]*) # identifier
+ \s*(=)
+ \s*(async)?
+ \s*\b([_$a-zA-Z][$\w]*)\s*(=>) # param name, arrow
+
+ name
+ meta.prototype.function.arrow.js
+
+
+ begin
+ (?x)
+ (\b_?[A-Z][$\w]*)?
+ (\.)([_$a-zA-Z][$\w]*)
+ \s*(=)
+ \s*(async)?
+ \s*(?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>))
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ keyword.operator.assignment.js
+
+ 5
+
+ name
+ storage.type.js
+
+
+ end
+ (?<=\))\s*(=>)
+ endCaptures
+
+ 1
+
+ name
+ storage.type.function.arrow.js
+
+
+ name
+ meta.function.static.arrow.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ keyword.operator.assignment.js
+
+ 5
+
+ name
+ storage.type.js
+
+ 6
+
+ name
+ variable.parameter.function.js
+
+ 7
+
+ name
+ storage.type.function.arrow.js
+
+
+ match
+ (?x)
+ (\b_?[A-Z][$\w]*)?
+ (\.)([_$a-zA-Z][$\w]*)
+ \s*(=)
+ \s*(async)?
+ \s*\b([_$a-zA-Z][$\w]*)\s*(=>)
+ name
+ meta.function.static.arrow.js
+
+
+ literal-arrow-function-labels
- comment
- TypedArray specification used by HTML 5 (http://www.khronos.org/registry/typedarray/specs/latest/)
- match
- (?<!\.|\$)\b(ArrayBuffer|DataView|Float32Array|Float64Array|Int8Array|Int16Array|Int32Array|TypedArray|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (?x)
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ (([_$a-zA-Z][$\w]*|\d+))
+ )
+ \s*(:)
+ \s*(?:\b(async)\s+)?
+ \s*(?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>))
+ beginCaptures
+
+ 1
+
+ name
+ string.quoted.single.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 11
+
+ name
+ punctuation.separator.key-value.js
+
+ 12
+
+ name
+ storage.type.js
+
+ 2
+
+ name
+ punctuation.definition.string.begin.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ punctuation.definition.string.end.js
+
+ 5
+
+ name
+ string.quoted.double.js
+
+ 6
+
+ name
+ punctuation.definition.string.begin.js
+
+ 7
+
+ name
+ entity.name.function.js
+
+ 8
+
+ name
+ punctuation.definition.string.end.js
+
+ 9
+
+ name
+ meta.string.unquoted.js
+
+
+ end
+ (?<=\))\s*(=>)
+ endCaptures
+
+ 1
+
+ name
+ storage.type.function.arrow.js
+
+
+ name
+ meta.function.json.arrow.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ captures
+
+ 1
+
+ name
+ string.quoted.single.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 11
+
+ name
+ punctuation.separator.key-value.js
+
+ 12
+
+ name
+ storage.type.js
+
+ 13
+
+ name
+ variable.parameter.function.js
+
+ 14
+
+ name
+ storage.type.function.arrow.js
+
+ 2
+
+ name
+ punctuation.definition.string.begin.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ punctuation.definition.string.end.js
+
+ 5
+
+ name
+ string.quoted.double.js
+
+ 6
+
+ name
+ punctuation.definition.string.begin.js
+
+ 7
+
+ name
+ entity.name.function.js
+
+ 8
+
+ name
+ punctuation.definition.string.end.js
+
+ 9
+
+ name
+ meta.string.unquoted.js
+
+
+ match
+ (?x)
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ (([_$a-zA-Z][$\w]*|\d+))
+ )
+ \s*(:)
+ \s*(?:\b(async)\s+)?
+ \s*\b([_$a-zA-Z][$\w]*)\s*(=>)
+ name
+ meta.function.json.arrow.js
+
+
+ literal-class
- comment
- File specification used by HTML 5 (http://dev.w3.org/2006/webapi/FileAPI/)
- match
- (?<!\.|\$)\b(Blob|File|FileList|FileReader)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (?<!\.)\b(?:(class)|(interface))\b
+ beginCaptures
+
+ 1
+
+ name
+ storage.type.class.js
+
+ 2
+
+ name
+ storage.type.interface.flowtype.js
+
+
+ end
+ \}
+ endCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.end.js
+
+
+ name
+ meta.class.js
+ patterns
+
+
+ include
+ #comments
+
+
+ begin
+ ([_$a-zA-Z][$\w]*)
+ beginCaptures
+
+ 0
+
+ name
+ entity.name.type.class.js
+
+
+ end
+ (?={)
+ patterns
+
+
+ include
+ #comments
+
+
+ begin
+ (?<!\.)\b(extends)\b
+ beginCaptures
+
+ 0
+
+ name
+ storage.type.extends.js
+
+
+ end
+ (?={)
+ name
+ meta.class.extends.js
+ patterns
+
+
+ include
+ #expression
+
+
+
+
+
+
+ begin
+ \{
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.begin.js
+
+
+ end
+ (?=})
+ patterns
+
+
+ include
+ #es7-decorators
+
+
+ include
+ #class-properties
+
+
+ include
+ #class-method-definition
+
+
+ include
+ #class-method-storage
+
+
+ include
+ #brackets
+
+
+ include
+ #comments
+
+
+
+
+
+
+ literal-constructor
- comment
- XMLHttpRequest specification used by HTML 5 (http://xhr.spec.whatwg.org/)
- match
- (?<!\.|\$)\b(FormData|ProgressEvent|XMLHttpRequest|XMLHttpRequestUpload)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (new)\s+(?=[_$a-zA-Z][$\w.]*)
+ beginCaptures
+
+ 1
+
+ name
+ keyword.operator.new.js
+
+
+ end
+ (?![_$a-zA-Z][$\w.]*)
+ name
+ meta.instance.constructor.js
+ patterns
+
+
+ include
+ #support-class
+
+
+ include
+ #support-other
+
+
+ captures
+
+ 2
+
+ name
+ support.class.js
+
+
+ match
+ ([_$a-zA-Z][$\w.]*\.)?([_$a-zA-Z][$\w]*)
+
+
+
+
+ literal-for
- comment
- EventSource specification used by HTML 5 (http://www.w3.org/TR/eventsource/)
- match
- (?<!\.|\$)\b(EventSource)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (?<!\.)\b(for)\b
+ beginCaptures
+
+ 1
+
+ name
+ keyword.control.loop.js
+
+
+ end
+ \)
+ endCaptures
+
+ 0
+
+ name
+ meta.brace.round.end.js
+
+
+ name
+ meta.for.js
+ patterns
+
+
+ include
+ #comments
+
+
+ begin
+ \(
+ beginCaptures
+
+ 0
+
+ name
+ meta.brace.round.begin.js
+
+
+ end
+ (?=\))
+ patterns
+
+
+ include
+ #literal-keyword-storage
+
+
+ include
+ #expression
+
+
+ include
+ #literal-punctuation
+
+
+
+
+
+
+ literal-function
- comment
- CSSOM specification used by HTML 5 (http://dev.w3.org/csswg/cssom/)
- match
- (?<!\.|\$)\b(CSS|CSSCharsetRule|CSSImportRule|CSSPageRule|CSSRule|CSSRuleList|CSSStyleDeclaration|CSSStyleRule|CSSStyleSheet|MediaList|Stylesheet|StyleSheetList)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (?x)
+ (?:([_$a-zA-Z][$\w]*)\s*(=)\s*)? # optional label + assignment
+ (?:(async)\s+)? # optional "async" annotation
+ (function)
+ (?>
+ \s*(\*)| # generator asterisk OR
+ (?=[\s(<]) # space/paren lookahead
+ )
+ \s*([_$a-zA-Z][$\w]*)? # optional function name
+
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ keyword.operator.assignment.js
+
+ 3
+
+ name
+ storage.type.js
+
+ 4
+
+ name
+ storage.type.function.js
+
+ 5
+
+ name
+ storage.modifier.generator.js
+
+ 6
+
+ name
+ entity.name.function.js
+
+
+ end
+ (?x)
+ (?<=\)) # just past the closing paren
+
+ name
+ meta.function.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ begin
+ (?x)
+ (\b_?[A-Z][$\w]*)?
+ (\.)(prototype)
+ (\.)([_$a-zA-Z][$\w]*)
+ \s*(=)
+ \s*(?:(async)\s+)?
+ \s*(function)(?>\s*(\*)|(?=[\s(<]))
+ \s*([_$a-zA-Z][$\w]*)?\s*
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ variable.language.prototype.js
+
+ 4
+
+ name
+ keyword.operator.accessor.js
+
+ 5
+
+ name
+ entity.name.function.js
+
+ 6
+
+ name
+ keyword.operator.assignment.js
+
+ 7
+
+ name
+ storage.type.js
+
+ 8
+
+ name
+ storage.type.function.js
+
+ 9
+
+ name
+ storage.modifier.generator.js
+
+
+ end
+ (?<=\))
+ name
+ meta.function.prototype.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ begin
+ (?x)
+ (\b_?[A-Z][$\w]*)?
+ (\.)([_$a-zA-Z][$\w]*)
+ \s*(=)
+ \s*(?:(async)\s+)?
+ \s*(function)(?>\s*(\*)|(?=[\s(<]))
+ \s*([_$a-zA-Z][$\w]*)?\s*
+ beginCaptures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ keyword.operator.assignment.js
+
+ 5
+
+ name
+ storage.type.js
+
+ 6
+
+ name
+ storage.type.function.js
+
+ 7
+
+ name
+ storage.modifier.generator.js
+
+ 8
+
+ name
+ entity.name.function.js
+
+
+ end
+ (?<=\))
+ name
+ meta.function.static.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ literal-function-call
- comment
- CSSOM View specification used by HTML 5 (http://dev.w3.org/csswg/cssom-view/)
- match
- (?<!\.|\$)\b(Screen)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ captures
+
+ 1
+
+ name
+ meta.variable.function.js
+
+ 2
+
+ name
+ meta.group.braces.round.function.arguments.js
+
+ 3
+
+ name
+ meta.brace.round.begin.js
+
+ 4
+
+ name
+ meta.brace.round.end.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)\s*((\()\s*(\)))
+ name
+ meta.function-call.without-arguments.js
+
+
+ captures
+
+ 1
+
+ name
+ meta.variable.function.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)\s*(?=\()
+ name
+ meta.function-call.with-arguments.js
+
+
+ captures
+
+ 1
+
+ name
+ support.function.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)\s*(?=`)
+ name
+ meta.function-call.tagged-template.js
+
+
+ literal-function-labels
- comment
- CSS Font specification used by HTML 5 (http://dev.w3.org/csswg/css-fonts/)
- match
- (?<!\.|\$)\b(CSSFontFaceRule)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ begin
+ (?x)
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ (([_$a-zA-Z][$\w]*|\d+))
+ )
+ \s*(:)
+ \s*(?:\b(async)\s+)?
+ \s*(function)(?>\s*(\*)|(?=[\s(<]))
+ \s*([_$a-zA-Z][$\w]*)?
+ beginCaptures
+
+ 1
+
+ name
+ string.quoted.single.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 11
+
+ name
+ punctuation.separator.key-value.js
+
+ 12
+
+ name
+ storage.type.js
+
+ 13
+
+ name
+ storage.type.function.js
+
+ 14
+
+ name
+ storage.modifier.generator.js
+
+ 15
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ punctuation.definition.string.begin.js
+
+ 3
+
+ name
+ entity.name.function.js
+
+ 4
+
+ name
+ punctuation.definition.string.end.js
+
+ 5
+
+ name
+ string.quoted.double.js
+
+ 6
+
+ name
+ punctuation.definition.string.begin.js
+
+ 7
+
+ name
+ entity.name.function.js
+
+ 8
+
+ name
+ punctuation.definition.string.end.js
+
+ 9
+
+ name
+ meta.string.unquoted.js
+
+
+ end
+ (?<=\))
+ name
+ meta.function.object-literal.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ literal-jsx
- comment
- SVG specification used by HTML 5 (http://www.w3.org/TR/SVG/single-page.html)
- match
- (?<!\.|\$)\b(SVGAElement|SVGAltGlyphDefElement|SVGAltGlyphElement|SVGAltGlyphItemElement|SVGAngle|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimatedAngle|SVGAnimatedBoolean|SVGAnimatedEnumeration|SVGAnimatedInteger|SVGAnimatedLength|SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedPreserveAspectRatio|SVGAnimatedRect|SVGAnimatedString|SVGAnimatedTransformList|SVGAnimationElement|SVGCircleElement|SVGClipPathElement|SVGColor|SVGComponentTransferFunctionElement|SVGCursorElement|SVGDefsElement|SVGDescElement|SVGDocument|SVGElement|SVGElementInstance|SVGElementInstanceList|SVGEllipseElement|SVGFEBlendElement|SVGFEColorMatrixElement|SVGFEComponentTransferElement|SVGFECompositeElement|SVGFEConvolveMatrixElement|SVGFEDiffuseLightingElement|SVGFEDisplacementMapElement|SVGFEDistantLightElement|SVGFEFloodElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEGaussianBlurElement|SVGFEImageElement|SVGFEMergeElement|SVGFEMergeNodeElement|SVGFEMorphologyElement|SVGFEOffsetElement|SVGFEPointLightElement|SVGFESpecularLightingElement|SVGFESpotLightElement|SVGFETileElement|SVGFETurbulenceElement|SVGFilterElement|SVGFontElement|SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement|SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGlyphRefElement|SVGGradientElement|SVGHKernElement|SVGImageElement|SVGLength|SVGLengthList|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMarkerElement|SVGMaskElement|SVGMatrix|SVGMetadataElement|SVGMissingGlyphElement|SVGNumber|SVGNumberList|SVGPaint|SVGPathElement|SVGPathSeg|SVGPathSegArcAbs|SVGPathSegArcRel|SVGPathSegClosePath|SVGPathSegCurvetoCubicAbs|SVGPathSegCurvetoCubicRel|SVGPathSegCurvetoCubicSmoothAbs|SVGPathSegCurvetoCubicSmoothRel|SVGPathSegCurvetoQuadraticAbs|SVGPathSegCurvetoQuadraticRel|SVGPathSegCurvetoQuadraticSmoothAbs|SVGPathSegCurvetoQuadraticSmoothRel|SVGPathSegLinetoAbs|SVGPathSegLinetoHorizontalAbs|SVGPathSegLinetoHorizontalRel|SVGPathSegLinetoRel|SVGPathSegLinetoVerticalAbs|SVGPathSegLinetoVerticalRel|SVGPathSegList|SVGPathSegMovetoAbs|SVGPathSegMovetoRel|SVGPatternElement|SVGPoint|SVGPointList|SVGPolygonElement|SVGPolylineElement|SVGPreserveAspectRatio|SVGRadialGradientElement|SVGRect|SVGRectElement|SVGRenderingIntent|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStringList|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTextContentElement|SVGTextElement|SVGTextPathElement|SVGTextPositioningElement|SVGTitleElement|SVGTransform|SVGTransformList|SVGUnitTypes|SVGUseElement|SVGUseElement|SVGVKernElement|SVGViewElement|SVGViewSpec|SVGZoomEvent)\b(?!\$)
- name
- support.class.dom.js
+ begin
+ (?<=\(|\{|\[|,|&&|\|\||\?|:|=|=>|\Wreturn|^return|\Wdefault|^)(?=\s*<[_$a-zA-Z])
+ contentName
+ meta.jsx.js
+ end
+ (?<=/>|>)
+ patterns
+
+
+ include
+ #jsx-tag-start
+
+
+ literal-keyword-storage
- comment
- WebGL specification used by HTML 5 (http://www.khronos.org/registry/webgl/specs/latest/1.0/)
- match
- (?<!\.|\$)\b(WebGLActiveInfo|WebGLBuffer|WebGLContextEvent|WebGLFramebuffer|WebGLProgram|WebGLRenderbuffer|WebGLRenderingContext|WebGLShader|WebGLShaderPrecisionFormat|WebGLTexture|WebGLUniformLocation)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ match
+ (?<!\.)\b(?>const|let|var)\b
+ name
+ storage.type.js
+
+
+ literal-keywords
- comment
- HTML 5 (http://www.w3.org/TR/html5/single-page.html)
- match
- (?<!\.|\$)\b(Audio|BarProp|DOMStringMap|ErrorEvent|FileError|HTMLAllCollection|HTMLAnchorElement|HTMLAppletElement|HTMLAreaElement|HTMLAudioElement|HTMLBRElement|HTMLBaseElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement|HTMLDListElement|HTMLDataElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLDivElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFormControlsCollection|HTMLFormElement|HTMLFrameElement|HTMLFrameSetElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMediaElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOptionsCollection|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLScriptElement|HTMLSelectElement|HTMLSour|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTextAreaElement|HTMLTimeElement|HTMLTitleElement|HTMLTrackElement|HTMLUListElement|HTMLUnknownElement|HTMLVideoElement|HashChangeEvent|History|Image|Location|MediaController|MediaError|MouseEvent|Navigator|Option|PageTransitionEvent|PopStateEvent|TextTrack|TextTrackCue|TextTrackCueList|TextTrackList|TimeRanges|TrackEvent|UIEvent|ValidityState|Window)\b(?!\$)
- name
- support.class.dom.js
+ patterns
+
+
+ include
+ #literal-keyword-storage
+
+
+ captures
+
+ 1
+
+ name
+ keyword.control.flow.js
+
+ 2
+
+ name
+ storage.modifier.generator.js
+
+
+ match
+ (?<!\.)\b((?>await|yield))\b(?:\s*(\*))?
+
+
+ match
+ (?<!\.)\b(return)\b
+ name
+ keyword.control.flow.js
+
+
+ match
+ (?<!\.)\b(?>if|else)\b
+ name
+ keyword.control.conditional.js
+
+
+ match
+ (?<!\.)\b(?>catch|finally|throw|try)\b
+ name
+ keyword.control.trycatch.js
+
+
+ match
+ (?<!\.)\b(?>break|continue|do|goto|while|case|default)\b
+ name
+ keyword.control.loop.js
+
+
+ match
+ (?<!\.)\b(?>enum|module|public|package|private|interface|protected)\b
+ name
+ keyword.other.reserved.js
+
+
+ match
+ (?<!\.)\b(debugger)\b
+ name
+ keyword.other.js
+
+
+ literal-labels
- comment
- HTML 5 (http://www.w3.org/TR/html5/single-page.html#window)
- match
- (?<!\.|\$)\b(applicationCache|closed|console|crypto|document|external|frameElement|frames|history|innerHeight|innerWidth|length|location|locationbar|menubar|name|navigator|offscreenBuffering|onabort|onafterprint|onbeforeprint|onbeforeunload|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragexit|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|onhashchange|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmessage|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onoffline|ononline|onpagehide|onpageshow|onpause|onplay|onplaying|onpopstate|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onstorage|onsubmit|onsuspend|ontimeupdate|onunload|onvolumechange|onwaiting|opener|outerHeight|outerWidth|pageXOffset|pageYOffset|parent|personalbar|postMessage|screen|screenX|screenY|scrollbars|scrollX|scrollY|self|status|statusbar|toolbar|top|window)\b(?!\$)
- name
- support.constant.dom.js
+ patterns
+
+
+ begin
+ (?x)
+ (?<!\?)(?<!\?\s)(?=(?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ )\s*:)
+ end
+ :
+ endCaptures
+
+ 0
+
+ name
+ punctuation.separator.key-value.js
+
+
+ patterns
+
+
+ include
+ #literal-string
+
+
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.type.attribute-name.js
+
+ 2
+
+ name
+ punctuation.separator.key-value.js
+
+
+ match
+ (?<!\.|\?|\?\s)([_$a-zA-Z][$\w]*)\s*(:)
+ name
+ meta.object.key.js
+
+
+ literal-language-constant
- comment
- HTML 5 (http://www.w3.org/TR/html5/single-page.html#window)
- match
- (?<!\.|\$)\b(addEventListener|alert|atob|blur|btoa|clearInterval|clearTimeout|close|confirm|dispatchEvent|doNotTrack|find|focus|getComputedStyle|getMatchedCSSRules|getSelection|matchMedia|moveBy|moveTo|open|openDatabase|print|prompt|removeEventListener|resizeBy|resizeTo|scroll|scrollBy|scrollTo|setInterval|setTimeout|showModalDialog|stop)\b(?!\$)
- name
- support.function.dom.js
+ patterns
+
+
+ match
+ (?<!\.)\b(true)\b
+ name
+ constant.language.boolean.true.js
+
+
+ match
+ (?<!\.)\b(false)\b
+ name
+ constant.language.boolean.false.js
+
+
+ match
+ (?<!\.)\b(null)\b
+ name
+ constant.language.null.js
+
+
+ match
+ (?<!\.)\b(undefined)\b
+ name
+ constant.language.undefined.js
+
+
+ match
+ (?<!\.)\b(NaN)\b
+ name
+ constant.language.nan.js
+
+
+ literal-language-variable
- match
- (?<!\.|\$)\b(captureEvents|defaultStatus|defaultstatus|releaseEvents)\b(?!\$)
- name
- invalid.deprecated.dom.js
+ patterns
+
+
+ match
+ (?<!(?<!\.\.)\.)\b(arguments)\b
+ name
+ variable.language.arguments.js
+
+
+ match
+ (?<!(?<!\.\.)\.)\b(super)\b
+ name
+ variable.language.super.js
+
+
+ match
+ (?<!(?<!\.\.)\.)\b(this)\b
+ name
+ variable.language.this.js
+
+
+ match
+ (?<!(?<!\.\.)\.)\b(self)\b
+ name
+ variable.language.self.js
+
+
+ match
+ (?<=\.)(__proto__)\b
+ name
+ variable.language.proto.js
+
+
+ match
+ (?<=\.)(constructor)\b
+ name
+ variable.language.constructor.js
+
+
+ match
+ (?<=\.)(prototype)\b
+ name
+ variable.language.prototype.js
+
+
+ literal-method
- match
- (?<!\.|\$)\b(JSON|Math)\b(?!\$)
- name
- support.constant.js
+ patterns
+
+
+ begin
+ (?x)
+ (?:\b(static)\s+)? # optional "static" keyword
+ (?:\b(async)\s+)? # optional "async" keyword
+ (?:(\*)\s*)? # optional generator symbol
+ (?>
+ ((')((?>[^'\\]|\\.)*)('))|
+ ((")((?>[^"\\]|\\.)*)("))|
+ (([_$a-zA-Z][$\w]*|\d+))
+ ) # method name, quoted or unquoted
+ (?= # followed by
+ \s*
+ (\(
+ (?>(?>[^()]+)|\g<-1>)* # parens w/ optional params
+ \))
+ (?>\s|/\*.*\*/)*\{ # and an opening brace
+ )
+ beginCaptures
+
+ 1
+
+ name
+ storage.type.js
+
+ 10
+
+ name
+ entity.name.function.js
+
+ 11
+
+ name
+ punctuation.definition.string.end.js
+
+ 12
+
+ name
+ meta.string.unquoted.js
+
+ 13
+
+ name
+ entity.name.function.js
+
+ 2
+
+ name
+ storage.type.js
+
+ 3
+
+ name
+ storage.modifier.generator.js
+
+ 4
+
+ name
+ string.quoted.single.js
+
+ 5
+
+ name
+ punctuation.definition.string.begin.js
+
+ 6
+
+ name
+ entity.name.function.js
+
+ 7
+
+ name
+ punctuation.definition.string.end.js
+
+ 8
+
+ name
+ string.quoted.double.js
+
+ 9
+
+ name
+ punctuation.definition.string.begin.js
+
+
+ comment
+
+ New object literal/class notation:
+
+ class X {
+ render (foo, bar) {
+ //...
+ }
+ }
+
+
+ end
+ (?<=\))
+ name
+ meta.method.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ begin
+ (?x)
+ \b(?:(static)\s+)?
+ (get|set)\s+
+ ([_$a-zA-Z][$\w]*|\d+)\s*
+ (?=(\((?>(?>[^()]+)|\g<-1>)*\))(?>\s|/\*.*\*/)*\{)
+ beginCaptures
+
+ 1
+
+ name
+ storage.type.js
+
+ 2
+
+ name
+ storage.type.accessor.js
+
+ 3
+
+ name
+ entity.name.type.accessor.js
+
+
+ comment
+ set foo (value) {
+ end
+ (?<=\))
+ name
+ meta.accessor.js
+ patterns
+
+
+ include
+ #function-declaration-parameters
+
+
+
+
+ literal-method-call
- match
- (?<!\.|\$)\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|uneval)\b(?!\$)
- name
- support.function.js
+ patterns
+
+
+ captures
+
+ 1
+
+ name
+ variable.other.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ meta.variable.function.js
+
+ 4
+
+ name
+ meta.group.braces.round.function.arguments.js
+
+ 5
+
+ name
+ meta.brace.round.begin.js
+
+ 6
+
+ name
+ meta.brace.round.end.js
+
+
+ match
+ (?x)
+ (?:(?<=\.)|\b)
+ ([A-Z][$\w]*)\s*(\.)
+ ([_$a-zA-Z][$\w]*)\s*
+ ((\()\s*(\)))
+ name
+ meta.function-call.static.without-arguments.js
+
+
+ captures
+
+ 1
+
+ name
+ variable.other.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ meta.variable.function.js
+
+
+ match
+ (?x)
+ (?:(?<=\.)|\b)
+ ([A-Z][$\w]*)\s*(\.)
+ ([_$a-zA-Z][$\w]*)\s*
+ (?=\()
+ name
+ meta.function-call.static.with-arguments.js
+
+
+ captures
+
+ 1
+
+ name
+ meta.variable.function.js
+
+ 2
+
+ name
+ meta.group.braces.round.function.arguments.js
+
+ 3
+
+ name
+ meta.brace.round.begin.js
+
+ 4
+
+ name
+ meta.brace.round.end.js
+
+
+ match
+ (?x)
+ (?<=\.)
+ ([_$a-zA-Z][$\w]*)\s*
+ ((\()\s*(\)))
+ name
+ meta.function-call.method.without-arguments.js
+
+
+ captures
+
+ 1
+
+ name
+ meta.variable.function.js
+
+
+ match
+ (?x)
+ (?<=\.)
+ ([_$a-zA-Z][$\w]*)\s*
+ (?=\()
+ name
+ meta.function-call.method.with-arguments.js
+
+
+ literal-module
comment
- Keywords reserved for future use but now are unused.
- match
- (?<!\.|\$)\b(enum|await)\b(?!\$)
- name
- invalid.illegal.js
+ TODO: revisit
+ patterns
+
+
+ match
+ (?<!\.)\b(?>import|export|default|from|as)\b
+ name
+ keyword.operator.module.js
+
+
+ literal-number
- comment
- Keywords reserved for future use in strict mode but now are unused.
- match
- (?<!\.|\$)\b(implements|interface|package|private|protected|public)\b(?!\$)
- name
- invalid.deprecated.js
+ patterns
+
+
+ match
+ (?i)(?:\B[-+]|\b)0x[0-9a-f]*\.(\B|\b[0-9]+)
+ name
+ invalid.illegal.numeric.hex.js
+
+
+ match
+ (?:\B[-+]|\b)0[0-9]+\.(\B|\b[0-9]+)
+ name
+ invalid.illegal.numeric.octal.js
+
+
+ match
+ (?xi)
+ (?:\B[-+])?
+ (?:
+ \b0b[0-1]*| # binary
+ \b0o[0-7]*| # octal
+ \b0x[0-9a-f]*| # hex
+ (
+ \B\.[0-9]+| # e.g. .999
+ \b[0-9]+(\.[0-9]*)? # e.g. 999.999, 999. or 999
+ )(e[-+]?[0-9]+)? # e.g. e+123, E-123
+ )
+ name
+ constant.numeric.js
+
+
+ match
+ (?:\B[-+]|\b)(Infinity)\b
+ name
+ constant.language.infinity.js
+
+
+ literal-operators
- comment
- Keywords used in an invalid context
- match
- (?<!\.|\$)\b(class|function|static|extends)\b(?!\$)
- name
- invalid.illegal.js
+ patterns
+
+
+ match
+ (?<!\.)\b(?>delete|instanceof|in|new|of|typeof|void|with)\b
+ name
+ keyword.operator.js
+
+
+ match
+ (?x)
+ !(?!=)| # logical-not right-to-left right
+ && | # logical-and left-to-right both
+ \|\| # logical-or left-to-right both
+ name
+ keyword.operator.logical.js
+
+
+ match
+ (?x)
+ %= | # assignment right-to-left both
+ &= | # assignment right-to-left both
+ \*= | # assignment right-to-left both
+ \+= | # assignment right-to-left both
+ -= | # assignment right-to-left both
+ /= | # assignment right-to-left both
+ \^= | # assignment right-to-left both
+ \|= | # assignment right-to-left both
+ <<= | # assignment right-to-left both
+ >>= | # assignment right-to-left both
+ >>>= # assignment right-to-left both
+ name
+ keyword.operator.assignment.augmented.js
+
+
+ match
+ (?x)
+ ~ | # bitwise-not right-to-left right
+ << | # bitwise-shift left-to-right both
+ >>> | # bitwise-shift left-to-right both
+ >> | # bitwise-shift left-to-right both
+ & | # bitwise-and left-to-right both
+ \^ | # bitwise-xor left-to-right both
+ \| # bitwise-or left-to-right both
+ name
+ keyword.operator.bitwise.js
+
+
+ match
+ (?x)
+ <= | # relational left-to-right both
+ >= | # relational left-to-right both
+ < | # relational left-to-right both
+ > # relational left-to-right both
+ name
+ keyword.operator.relational.js
+
+
+ match
+ (?x)
+ === | # equality left-to-right both
+ !== | # equality left-to-right both
+ == | # equality left-to-right both
+ != # equality left-to-right both
+ name
+ keyword.operator.comparison.js
+
+
+ match
+ (?x)
+ -- | # decrement n/a right-or-left
+ \+\+ | # increment n/a right-or-left
+ / | # division left-to-right both
+ % | # modulus left-to-right both
+ \* | # multiplication left-to-right both
+ \+ | # addition left-to-right both
+ - # subtraction left-to-right both
+ name
+ keyword.operator.arithmetic.js
+
+
+ match
+ [?:]
+ name
+ keyword.operator.ternary.js
+
+
+ match
+ (?<!\.)\.\.\.
+ name
+ keyword.operator.spread.js
+
+
+ match
+ \.
+ name
+ keyword.operator.accessor.js
+
+
+ match
+ =
+ name
+ keyword.operator.assignment.js
+
+
+ literal-prototype
- match
- \b(false|Infinity|NaN|null|true|undefined)\b
- name
- constant.language.js
+ patterns
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ variable.language.prototype.js
+
+ 4
+
+ name
+ keyword.operator.assignment.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)(\.)(prototype)\s*(=)\s*
+ name
+ meta.prototype.declaration.js
+
+
+ captures
+
+ 1
+
+ name
+ entity.name.type.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ variable.language.prototype.js
+
+
+ match
+ ([_$a-zA-Z][$\w]*)(\.)(prototype)\b
+ name
+ meta.prototype.access.js
+
+
+ literal-punctuation
- match
- (?<!\.)\b(super|this)(?!\s*:)\b
- name
- variable.language.js
+ patterns
+
+
+ match
+ ;
+ name
+ punctuation.terminator.statement.js
+
+
+ match
+ ,
+ name
+ meta.delimiter.comma.js
+
+
+ literal-regexp
- match
- \;
- name
- punctuation.terminator.statement.js
+ patterns
+
+
+ begin
+ (?x)
+ (?<= # preceded by:
+ \.|\(|,|{|}|\[|;|<|>|<=|>=|==|!=|===| # operators
+ !==|\+|-|\*|%|\+\+|--|<<|>>|>>>|&|\||
+ \^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|<<=
+ |>>=|>>>=|&=|\|=|\^=|/|/=|
+ \Wnew|\Wdelete|\Wvoid|\Wtypeof| # or keywords
+ \Winstanceof|\Win|\Wdo|\Wreturn|
+ \Wcase|\Wthrow|\Wyield|
+ ^new|^delete|^void|^typeof|^instanceof|
+ ^in|^do|^return|^case|^throw|^yield|^
+ )\s*
+ (/) # opening slash
+ (?! # not followed by:
+ /| # another slash (comment),
+ \*| # an asterisk (comment),
+ $ # or the end of the line
+ )
+
+ beginCaptures
+
+ 1
+
+ name
+ punctuation.definition.string.begin.js
+
+
+ end
+ (?x)
+ (?<!\\) # NOT preceded by a backslash
+ (/) # closing slash
+ ([gimy]*) # and any flags
+
+ endCaptures
+
+ 1
+
+ name
+ punctuation.definition.string.end.js
+
+ 2
+
+ name
+ keyword.other.js
+
+
+ name
+ string.regexp.js
+ patterns
+
+
+ include
+ source.js.regexp
+
+
+
+
+ literal-string
- captures
-
- 1
+ patterns
+
+ begin
+ (')
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.begin.js
+
+
+ end
+ (\1)|(\n)
+ endCaptures
+
+ 1
+
+ name
+ punctuation.definition.string.end.js
+
+ 2
+
+ name
+ invalid.illegal.newline.js
+
+
name
- punctuation.section.scope.begin.js
+ string.quoted.single.js
+ patterns
+
+
+ include
+ #string-content
+
+
- 2
+ begin
+ (")
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.definition.string.begin.js
+
+
+ end
+ (\1)|(\n)
+ endCaptures
+
+ 1
+
+ name
+ punctuation.definition.string.end.js
+
+ 2
+
+ name
+ invalid.illegal.newline.js
+
+
name
- punctuation.section.scope.end.js
+ string.quoted.double.js
+ patterns
+
+
+ include
+ #string-content
+
+
-
- comment
- Allows the special return snippet to fire.
- match
- (\[)(\])
+
+ literal-switch
- begin
- \{
- beginCaptures
-
- 0
-
- name
- punctuation.section.scope.begin.js
-
-
- end
- \}
- endCaptures
-
- 0
-
- name
- punctuation.section.scope.end.js
-
-
patterns
- include
- $self
+ begin
+ (?<!\.)\b(switch)\b
+ beginCaptures
+
+ 1
+
+ name
+ keyword.control.switch.js
+
+
+ end
+ \}
+ endCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.end.js
+
+
+ name
+ meta.switch.js
+ patterns
+
+
+ include
+ #comments
+
+
+ include
+ #round-brackets
+
+
+ begin
+ \{
+ beginCaptures
+
+ 0
+
+ name
+ punctuation.section.scope.begin.js
+
+
+ end
+ (?=})
+ patterns
+
+
+ begin
+ (?<!\.)\b(case|default)\b
+ beginCaptures
+
+ 1
+
+ name
+ keyword.control.switch.js
+
+
+ end
+ (?=:)
+ patterns
+
+
+ include
+ #expression
+
+
+
+
+ include
+ $self
+
+
+
+
+ literal-template-string
begin
- \(
+ (`)
beginCaptures
- 0
+ 1
name
- punctuation.section.scope.begin.js
+ punctuation.definition.template.begin.js
+ contentName
+ meta.embedded.interpolated-string.js
end
- \)
+ (`)
endCaptures
- 0
+ 1
name
- punctuation.section.scope.end.js
+ punctuation.definition.template.end.js
+ name
+ string.quoted.other.template.js
patterns
include
- $self
+ #string-content
+
+
+ match
+ \\`
+ name
+ constant.character.escape.js
-
-
-
- match
- \[|\]
- name
- meta.brace.square.js
-
-
- comment
- Match classes based on the usage of the "new" operator.
- match
- (?<=new )([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)(?!\w)
- name
- support.class.js
-
-
- comment
- Match classes based on the usage of the "instanceof" operator.
- match
- (?<= instanceof )([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)(?!\w)
- name
- support.class.js
-
-
- comment
- Match classes based on the usage of the "prototype" property.
- match
- (?<!\w)([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)(?=\.prototype\b)
- name
- support.class.js
-
-
- comment
- Matches the "prototype" keyword. Even though it is not a valid keyword, it is a special constant of sorts.
- match
- (?<=\.)(prototype)\b
- name
- keyword.other.js
-
-
- repository
-
- comments
-
- patterns
-
begin
- /\*\*(?!/|\*)
+ \${
beginCaptures
0
name
- punctuation.definition.comment.begin.js
+ keyword.other.substitution.begin.js
end
- \*/
+ }
endCaptures
0
name
- punctuation.definition.comment.end.js
+ keyword.other.substitution.end.js
- name
- comment.block.documentation.js
patterns
- match
- (?<!\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file|fileoverview|final|fires|for|function|global|host|ignore|implements|inherit[Dd]oc|inner|instance|interface|kind|lends|license|listens|main|member|memberof|method|mixex|mixins?|module|name|namespace|nocollapse|nosideeffects|override|overview|package|param|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce)\b
- name
- keyword.other.documentation.js.jsdoc
+ include
+ #expression
+
+
+ literal-variable
+
+ patterns
+
- begin
- /\*
- beginCaptures
+ match
+ _*?[A-Z][_$\dA-Z]*\b
+ name
+ variable.other.constant.js
+
+
+ captures
- 0
+ 1
name
- punctuation.definition.comment.begin.js
+ variable.other.class.js
+
+ 2
+
+ name
+ keyword.operator.accessor.js
+
+ 3
+
+ name
+ meta.variable.other.property.static.js
- end
- \*/
- endCaptures
+ match
+ \b([A-Z][$\w]*)\s*(\.)([_$a-zA-Z][$\w]*)
+ name
+ meta.property.class.js
+
+
+ captures
- 0
+ 1
name
- punctuation.definition.comment.end.js
+ meta.variable.other.object.js
+ match
+ (?<!\.)([_$a-zA-Z][$\w]*)\s*(?=[\[\.])
name
- comment.block.js
+ variable.other.object.js
- begin
- (^[ \t]+)?(?=//)
- beginCaptures
+ captures
1
name
- punctuation.whitespace.comment.leading.js
+ meta.variable.other.property.js
- end
- (?!\G)
- patterns
-
+ match
+ (?<=\.)\s*([_$a-zA-Z][$\w]*)
+ name
+ meta.property.object.js
+
+
+ match
+ [_$a-zA-Z][$\w]*
+ name
+ variable.other.readwrite.js
+
+
+
+ merge-conflits
+
+ patterns
+
+
+ captures
+
+ 1
+
+ name
+ invalid.illegal.conflict-marker.merge-into.js
+
+ 2
+
+ name
+ invalid.illegal.string.js
+
+
+ match
+ ^([<]{7})\s(.+)$
+
+
+ captures
+
+ 1
+
+ name
+ invalid.illegal.conflict-marker.separator.js
+
+
+ match
+ ^([=|]{7})$
+
+
+ captures
+
+ 1
+
+ name
+ invalid.illegal.conflict-marker.other-commit.js
+
+ 2
- begin
- //
- beginCaptures
-
- 0
-
- name
- punctuation.definition.comment.js
-
-
- end
- \n
name
- comment.line.double-slash.js
+ invalid.illegal.string.js
-
+
+ match
+ ^([>]{7})\s(.+)$
- function-call
+ round-brackets
patterns
begin
- (?<!\w)([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)(\()
+ \(
beginCaptures
- 1
-
- name
- meta.function-call.js
-
- 2
+ 0
name
- punctuation.definition.function-call.begin.js
+ meta.brace.round.begin.js
- comment
- Matches the function calls.
end
\)
endCaptures
@@ -1268,403 +3357,332 @@
0
name
- punctuation.definition.function-call.end.js
+ meta.brace.round.end.js
+ name
+ meta.group.braces.round.js
patterns
include
- $self
+ #expression
- function-params
+ square-brackets
patterns
begin
- (?=[\p{L}\p{Nl}$_])|(\.\.\.)
+ \[
beginCaptures
- 1
+ 0
name
- keyword.operator.rest-parameters.js
+ meta.brace.square.begin.js
- comment
- Matches valid argument, function and variable names. To be thorough: https://github.com/mathiasbynens/mothereff.in/tree/master/js-variables
end
- (?=[,)/])
- patterns
-
+ \]
+ endCaptures
+
+ 0
- match
- \G[\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*
name
- variable.parameter.function.js
-
-
- include
- #function-call
-
-
- include
- #numbers
-
-
- include
- #strings
-
-
- include
- #comments
+ meta.brace.square.end.js
+
+ name
+ meta.group.braces.square.js
+ patterns
+
include
- #operators
-
-
- match
- (?<!\.)\b(super|this)(?!\s*:)\b
- name
- variable.language.js
+ #expression
-
- include
- #comments
-
- numbers
+ string-content
patterns
match
- (?<!\w|\$)0[xX]\h+\b
+ \\\s*\n
name
- constant.numeric.hex.js
+ constant.character.escape.newline.js
match
- (?<!\w|\$)0[bB][01]+\b
+ \\([1-7][0-7]{0,2}|[0-7]{2,3}|[bfnrtv0'"\\]|x\h{2}|u\{\h+\}|u\h{4})
name
- constant.numeric.binary.js
+ constant.character.escape.js
+
+
+ support-class
+
+ patterns
+
match
- (?<!\w|\$)0[oO][0-7]+\b
+ (?<!\.)\b(Array|ArrayBuffer|Boolean|DataView|Date|Float32Array|Float64Array|Function|Infinity|Int16Array|Int32Array|Int8Array|JSON|Map|Math|NaN|Number|Object|Promise|Proxy|Reflect|RegExp|Set|String|Symbol|System|TypeError|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|WeakMap|WeakSet)\b
name
- constant.numeric.octal.js
+ support.class.builtin.js
match
- (?x)
- (?<!\w|\$) # Ensure word boundry
- [+-]? # Optional sign
- (?>
- (
- (0|[1-9][0-9]*)(\.[0-9]*)? # 0 or 1 or 1. or 1.0
- | \.[0-9]+ # .1
- )
- ([eE][+-]?[0-9]+)? # Exponent
- )
- (?!\w) # Ensure word boundry
-
+ (?<!\.)\b((?>Eval|Range|Reference|Syntax|Type|URI)?Error)\b
name
- constant.numeric.js
+ support.class.error.js
+
+
+ match
+ \b(?>Buffer)\b
+ name
+ support.class.node.js
- operators
+ support-dom
patterns
+ comment
+ DOM Core Level 4 (http://www.w3.org/TR/domcore/) and DOM Events Level 3 (http://www.w3.org/TR/DOM-Level-3-Events/)
+ match
+ (?<!\.|\$)\b(Attr|CharacterData|Comment|CompositionEvent|CustomEvent|Document|DocumentFragment|DocumentType|DOMError|DOMException|DOMImplementation|DOMParser|DOMString|DOMTimestamp|DOMSettableTokenList|DOMStringList|DOMTokenList|Element|Event|EventTarget|FocusEvent|HTMLCollection|KeyboardEvent|MouseEvent|MutationObserver|MutationRecord|Node|NodeFilter|NodeIterator|NodeList|ProcessingInstruction|Range|Text|TextEvent|TreeWalker|UIEvent|WheelEvent|XMLDocument)\b(?!\$)
+ name
+ support.class.dom.js
+
+
+ comment
+ DOM Core Level 4 (http://www.w3.org/TR/domcore/) and DOM Events Level 3 (http://www.w3.org/TR/DOM-Level-3-Events/)
match
- %=|\+=|\-=|\*=|(?<!\()/=
+ (?<!\.|\$)\b(CDATASection|DOMConfiguration|DOMErrorHandler|DOMImplementationList|DOMImplementationSource|DOMLocator|DOMObject|DOMUserData|Entity|EntityReference|MutationEvent|NamedNodeMap|NameList|Notation|TypeInfo|UserDataHandler)\b(?!\$)
name
- keyword.operator.assignment.compound.js
+ invalid.deprecated.dom.js
+ comment
+ TypedArray specification used by HTML 5 (http://www.khronos.org/registry/typedarray/specs/latest/)
match
- &=|\^=|<<=|>>=|>>>=|\|=
+ (?<!\.|\$)\b(ArrayBuffer|DataView|Float32Array|Float64Array|Int8Array|Int16Array|Int32Array|TypedArray|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray)\b(?!\$)
name
- keyword.operator.assignment.compound.bitwise.js
+ support.class.dom.js
+ comment
+ File specification used by HTML 5 (http://dev.w3.org/2006/webapi/FileAPI/)
match
- !==|!=|<=|>=|===|==|<|>
+ (?<!\.|\$)\b(Blob|File|FileList|FileReader)\b(?!\$)
name
- keyword.operator.comparison.js
+ support.class.dom.js
+ comment
+ XMLHttpRequest specification used by HTML 5 (http://xhr.spec.whatwg.org/)
match
- &&|!|\|\|
+ (?<!\.|\$)\b(FormData|ProgressEvent|XMLHttpRequest|XMLHttpRequestUpload)\b(?!\$)
name
- keyword.operator.logical.js
+ support.class.dom.js
+ comment
+ EventSource specification used by HTML 5 (http://www.w3.org/TR/eventsource/)
match
- &|\||\^|~
+ (?<!\.|\$)\b(EventSource)\b(?!\$)
name
- keyword.operator.bitwise.js
+ support.class.dom.js
+ comment
+ CSSOM specification used by HTML 5 (http://dev.w3.org/csswg/cssom/)
match
- \:
+ (?<!\.|\$)\b(CSS|CSSCharsetRule|CSSImportRule|CSSPageRule|CSSRule|CSSRuleList|CSSStyleDeclaration|CSSStyleRule|CSSStyleSheet|MediaList|Stylesheet|StyleSheetList)\b(?!\$)
name
- keyword.operator.js
+ support.class.dom.js
+ comment
+ CSSOM View specification used by HTML 5 (http://dev.w3.org/csswg/cssom-view/)
match
- !
+ (?<!\.|\$)\b(Screen)\b(?!\$)
name
- keyword.operator.logical.js
+ support.class.dom.js
+ comment
+ CSS Font specification used by HTML 5 (http://dev.w3.org/csswg/css-fonts/)
match
- =|\:
+ (?<!\.|\$)\b(CSSFontFaceRule)\b(?!\$)
name
- keyword.operator.assignment.js
+ support.class.dom.js
+ comment
+ SVG specification used by HTML 5 (http://www.w3.org/TR/SVG/single-page.html)
match
- \-\-
+ (?<!\.|\$)\b(SVGAElement|SVGAltGlyphDefElement|SVGAltGlyphElement|SVGAltGlyphItemElement|SVGAngle|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimatedAngle|SVGAnimatedBoolean|SVGAnimatedEnumeration|SVGAnimatedInteger|SVGAnimatedLength|SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedPreserveAspectRatio|SVGAnimatedRect|SVGAnimatedString|SVGAnimatedTransformList|SVGAnimationElement|SVGCircleElement|SVGClipPathElement|SVGColor|SVGComponentTransferFunctionElement|SVGCursorElement|SVGDefsElement|SVGDescElement|SVGDocument|SVGElement|SVGElementInstance|SVGElementInstanceList|SVGEllipseElement|SVGFEBlendElement|SVGFEColorMatrixElement|SVGFEComponentTransferElement|SVGFECompositeElement|SVGFEConvolveMatrixElement|SVGFEDiffuseLightingElement|SVGFEDisplacementMapElement|SVGFEDistantLightElement|SVGFEFloodElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEGaussianBlurElement|SVGFEImageElement|SVGFEMergeElement|SVGFEMergeNodeElement|SVGFEMorphologyElement|SVGFEOffsetElement|SVGFEPointLightElement|SVGFESpecularLightingElement|SVGFESpotLightElement|SVGFETileElement|SVGFETurbulenceElement|SVGFilterElement|SVGFontElement|SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement|SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGlyphRefElement|SVGGradientElement|SVGHKernElement|SVGImageElement|SVGLength|SVGLengthList|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMarkerElement|SVGMaskElement|SVGMatrix|SVGMetadataElement|SVGMissingGlyphElement|SVGNumber|SVGNumberList|SVGPaint|SVGPathElement|SVGPathSeg|SVGPathSegArcAbs|SVGPathSegArcRel|SVGPathSegClosePath|SVGPathSegCurvetoCubicAbs|SVGPathSegCurvetoCubicRel|SVGPathSegCurvetoCubicSmoothAbs|SVGPathSegCurvetoCubicSmoothRel|SVGPathSegCurvetoQuadraticAbs|SVGPathSegCurvetoQuadraticRel|SVGPathSegCurvetoQuadraticSmoothAbs|SVGPathSegCurvetoQuadraticSmoothRel|SVGPathSegLinetoAbs|SVGPathSegLinetoHorizontalAbs|SVGPathSegLinetoHorizontalRel|SVGPathSegLinetoRel|SVGPathSegLinetoVerticalAbs|SVGPathSegLinetoVerticalRel|SVGPathSegList|SVGPathSegMovetoAbs|SVGPathSegMovetoRel|SVGPatternElement|SVGPoint|SVGPointList|SVGPolygonElement|SVGPolylineElement|SVGPreserveAspectRatio|SVGRadialGradientElement|SVGRect|SVGRectElement|SVGRenderingIntent|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStringList|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTextContentElement|SVGTextElement|SVGTextPathElement|SVGTextPositioningElement|SVGTitleElement|SVGTransform|SVGTransformList|SVGUnitTypes|SVGUseElement|SVGUseElement|SVGVKernElement|SVGViewElement|SVGViewSpec|SVGZoomEvent)\b(?!\$)
name
- keyword.operator.decrement.js
+ support.class.dom.js
+ comment
+ WebGL specification used by HTML 5 (http://www.khronos.org/registry/webgl/specs/latest/1.0/)
match
- \+\+
+ (?<!\.|\$)\b(WebGLActiveInfo|WebGLBuffer|WebGLContextEvent|WebGLFramebuffer|WebGLProgram|WebGLRenderbuffer|WebGLRenderingContext|WebGLShader|WebGLShaderPrecisionFormat|WebGLTexture|WebGLUniformLocation)\b(?!\$)
name
- keyword.operator.increment.js
+ support.class.dom.js
+ comment
+ HTML 5 (http://www.w3.org/TR/html5/single-page.html)
match
- %|\*|/|\-|\+
+ (?<!\.|\$)\b(Audio|BarProp|DOMStringMap|ErrorEvent|FileError|HTMLAllCollection|HTMLAnchorElement|HTMLAppletElement|HTMLAreaElement|HTMLAudioElement|HTMLBRElement|HTMLBaseElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement|HTMLDListElement|HTMLDataElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLDivElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFormControlsCollection|HTMLFormElement|HTMLFrameElement|HTMLFrameSetElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMediaElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOptionsCollection|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLScriptElement|HTMLSelectElement|HTMLSour|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTextAreaElement|HTMLTimeElement|HTMLTitleElement|HTMLTrackElement|HTMLUListElement|HTMLUnknownElement|HTMLVideoElement|HashChangeEvent|History|Image|Location|MediaController|MediaError|MouseEvent|Navigator|Option|PageTransitionEvent|PopStateEvent|TextTrack|TextTrackCue|TextTrackCueList|TextTrackList|TimeRanges|TrackEvent|UIEvent|ValidityState|Window)\b(?!\$)
name
- keyword.operator.arithmetic.js
+ support.class.dom.js
+ comment
+ HTML 5 (http://www.w3.org/TR/html5/single-page.html#window)
match
- \.\.\.
+ (?<!\.|\$)\b(applicationCache|closed|console|crypto|document|external|frameElement|frames|history|innerHeight|innerWidth|length|location|locationbar|menubar|name|navigator|offscreenBuffering|onabort|onafterprint|onbeforeprint|onbeforeunload|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragexit|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|onhashchange|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmessage|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onoffline|ononline|onpagehide|onpageshow|onpause|onplay|onplaying|onpopstate|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onstorage|onsubmit|onsuspend|ontimeupdate|onunload|onvolumechange|onwaiting|opener|outerHeight|outerWidth|pageXOffset|pageYOffset|parent|personalbar|postMessage|screen|screenX|screenY|scrollbars|scrollX|scrollY|self|status|statusbar|toolbar|top|window)\b(?!\$)
name
- keyword.operator.spread.js
+ support.constant.dom.js
+
+
+ comment
+ HTML 5 (http://www.w3.org/TR/html5/single-page.html#window)
+ match
+ (?<!\.|\$)\b(addEventListener|alert|atob|blur|btoa|clearInterval|clearTimeout|close|confirm|dispatchEvent|doNotTrack|find|focus|getComputedStyle|getMatchedCSSRules|getSelection|matchMedia|moveBy|moveTo|open|openDatabase|print|prompt|removeEventListener|resizeBy|resizeTo|scroll|scrollBy|scrollTo|setInterval|setTimeout|showModalDialog|stop)\b(?!\$)
+ name
+ support.function.dom.js
+
+
+ match
+ (?<!\.|\$)\b(captureEvents|defaultStatus|defaultstatus|releaseEvents)\b(?!\$)
+ name
+ invalid.deprecated.dom.js
- strings
+ support-other
patterns
- begin
- '
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.js
-
-
- end
- '
- endCaptures
+ match
+ (?<!\.)\b(constructor|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|hasOwnProperty|isFinite|isNaN|isPrototypeOf|parseFloat|parseInt|propertyIsEnumerable|toLocaleString|toString|unescape|valueOf)\b
+ name
+ support.function.builtin.js
+
+
+ match
+ (?<!\.)\b(clearImmediate|clearInterval|clearTimeout|require|setImmediate|setInterval|setTimeout)\b
+ name
+ support.function.node.js
+
+
+ match
+ (?<!\.)\b(?>document|window)\b
+ name
+ support.type.object.dom.js
+
+
+ match
+ (?<!\.)\b(?>global|GLOBAL|root|__dirname|__filename)\b
+ name
+ support.type.object.node.js
+
+
+ captures
- 0
+ 1
name
- punctuation.definition.string.end.js
-
-
- name
- string.quoted.single.js
- patterns
-
-
- include
- #escapes
+ support.type.object.console.js
+ 2
- match
- \\\n
name
- constant.character.escape.newline.js
+ keyword.operator.accessor.js
+ 3
- match
- \n
name
- invalid.illegal.character-not-allowed-here.js
+ support.function.console.js
-
+
+ match
+ (?<!\.)\b(console)(?:(\.)(assert|count|dir|error|group|groupCollapsed|groupEnd|info|log|profile|profileEnd|table|time|timeEnd|trace|warn))?\b
- begin
- "
- beginCaptures
+ captures
- 0
+ 1
name
- punctuation.definition.string.begin.js
+ support.type.object.process.js
-
- end
- "
- endCaptures
-
- 0
+ 2
name
- punctuation.definition.string.end.js
-
-
- name
- string.quoted.double.js
- patterns
-
-
- include
- #escapes
+ keyword.operator.accessor.js
+ 3
- match
- \\\n
name
- constant.character.escape.newline.js
+ support.type.object.process.js
+ 4
- match
- \n
name
- invalid.illegal.character-not-allowed-here.js
+ support.function.process.js
-
+
+ match
+ (?<!\.)\b(process)(?:(\.)(?:(arch|argv|config|env|execArgv|execPath|exitCode|mainModule|pid|platform|stderr|stdin|stdout|title|version|versions)|(abort|chdir|cwd|exit|getgid|getgroups|getuid|hrtime|initgroups|kill|memoryUsage|nextTick|setgid|setgroups|setuid|umask|uptime)))?\b
- begin
- `
- beginCaptures
+ captures
- 0
+ 1
name
- punctuation.definition.string.begin.js
+ support.type.object.module.js
-
- end
- `
- endCaptures
-
- 0
+ 2
name
- punctuation.definition.string.end.js
-
-
- name
- string.quoted.other.template.js
- patterns
-
-
- include
- #escapes
+ keyword.operator.accessor.js
+ 3
- include
- #interpolation
+ name
+ support.type.object.module.js
-
-
-
- repository
-
- escapes
-
+
match
- \\(x\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)
- name
- constant.character.escape.js
+ (?<!\.)\b(exports|module(?:(\.)(children|exports|filename|id|loaded|parent)))?\b
- interpolation
begin
- \$\{
- beginCaptures
-
- 0
-
- name
- punctuation.section.embedded.begin.js
-
-
- contentName
- source.js
+ {{
end
- (\})
- endCaptures
-
- 0
-
- name
- punctuation.section.embedded.end.js
-
- 1
-
- name
- source.js
-
-
+ }}
name
- meta.embedded.line.js
- patterns
-
-
- begin
- \{
- beginCaptures
-
- 0
-
- name
- meta.brace.curly.js
-
-
- end
- \}
- endCaptures
-
- 0
-
- name
- meta.brace.curly.js
-
-
- patterns
-
-
- include
- $self
-
-
-
-
- include
- $self
-
-
+ meta.tag.mustache.js
-
+
scopeName
diff --git a/info.plist b/info.plist
index 87686d8..3e84040 100644
--- a/info.plist
+++ b/info.plist
@@ -12,18 +12,17 @@
items
+ F20780A9-CE3A-41D5-99B8-F5183AB54A98
+ ------------------------------------
20E61C43-B81F-4FB9-9362-BFFE668EB9C9
36EC03E9-EFF4-479A-AB90-8DFA16800642
------------------------------------
B4874A14-2491-465A-A349-61E4EBCF4700
------------------------------------
- D7E2FD2A-5B78-4147-BBF4-BE7FE854A337
- 3E69BFC9-8C2B-4BB3-875C-8673C1740FD4
- 9B27DBEA-56C1-4484-ACC7-0A5A05CFF9A8
- ------------------------------------
D2E6A1FE-2881-4754-B399-B65F61F29C2F
43F40EB6-5839-4BE8-99C8-4976D0534E5D
52090C49-D8B2-49A0-9597-80574354B3CD
+ E24EE160-FA32-4ADE-BE39-2F834AEB1D85
submenus
@@ -31,10 +30,13 @@
items
+ 13A083C2-1F73-4CD6-9982-BFBCC5EB58B0
B2225C2E-59BD-4AD5-9554-755A9864D7F1
923442DA-69C2-4681-B57D-510BB1312E9E
C4CA6356-DBC9-4F0D-AA9B-8577692DEBB2
0701FB35-5C3C-453D-9ADE-8A0B7D1E617E
+ 29B39100-632C-498F-829A-CF0F71DE0B25
+ 29A152B6-8C5F-4BD3-82F2-EC7F21FA00A3
name
DOM
@@ -49,6 +51,18 @@
name
BOM
+ E24EE160-FA32-4ADE-BE39-2F834AEB1D85
+
+ items
+
+ 3E69BFC9-8C2B-4BB3-875C-8673C1740FD4
+ D7E2FD2A-5B78-4147-BBF4-BE7FE854A337
+ 9B27DBEA-56C1-4484-ACC7-0A5A05CFF9A8
+ B09E67F5-ED9E-4C22-BFA4-ED61F0E4D3B3
+
+ name
+ Logging
+
66778C58-CE08-4F21-AD36-562149AEEE80
items
@@ -87,6 +101,9 @@
4B1F658D-CB1C-4D10-968D-A443F8597C28
------------------------------------
C1FE098B-501D-4567-B024-5C9C394898E5
+ ------------------------------------
+ 89CEA10F-CB8E-45A2-A206-BD7EE8118791
+ 086ACC46-8307-4C69-B862-69302BFBBD66
name
Control
@@ -110,6 +127,9 @@
------------------------------------
66C3F21C-5762-40D7-A383-ABDFFC26EFE5
2F96136B-0193-42F5-90FC-B6F456A3AD77
+ ------------------------------------
+ 8F536653-6212-4A3A-ABF5-F47AC1ADAF21
+ FC9298E3-8ED7-4868-8C91-E50755F37325
name
Language
@@ -118,6 +138,13 @@
name
JavaScript
+ source
+
+ method
+ git
+ url
+ git@github.com:textmate/javascript.tmbundle
+
uuid
AAB4FD74-73F9-11D9-B89A-000D93589AF6