Skip to content

Commit

Permalink
JavaScript add FormData APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jun 19, 2018
1 parent 11103fc commit 1df51a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EditLexers/stlJavaScript.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static KEYWORDLIST Keywords_JS = {{
"arguments ActiveXObject ConversionError Debug Enumerator VBArray WScript WinRTError "
// HTML DOM
//
"XMLHttpRequest jQuery "
"XMLHttpRequest FormData jQuery "

, // 6 Interface
""
Expand Down Expand Up @@ -132,6 +132,8 @@ static KEYWORDLIST Keywords_JS = {{
"getElementById() getElementsByClassName() getElementsByName() getElementsByTagName() "
// XMLHttpRequest
"abort() getAllResponseHeaders() getResponseHeader() open() overrideMimeType() send() setRequestHeader() "
// FormData
"append() getAll() "
// Storage
"getItem() key() removeItem() setItem() "
, "", "", ""
Expand Down
15 changes: 15 additions & 0 deletions tools/lang/JavaScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ Proxy(target, handler) {
}

// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
// https://xhr.spec.whatwg.org/
XMLHttpRequest() {
UNSENT
OPENED
Expand Down Expand Up @@ -522,6 +523,20 @@ XMLHttpRequest() {
setRequestHeader(header, value)
}

// https://developer.mozilla.org/en-US/docs/Web/API/FormData
// https://xhr.spec.whatwg.org/#formdata
FormData([form]) {
append(name, value [, filename])
delete(name)
delete(name)
get(name)
getAll(name)
has(name)
keys()
set(name, value [, filename])
values()
}

// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope
WindowOrWorkerGlobalScope {
atob(encodedData)
Expand Down

0 comments on commit 1df51a7

Please sign in to comment.