From ce36a96db9828d4de11f8b522084d5f528dd1e62 Mon Sep 17 00:00:00 2001 From: rdrpenguin04 Date: Sun, 10 Jun 2018 11:14:55 -0500 Subject: [PATCH 1/2] Update jsapi.c Add true and false as keywords; should fix #619. --- src/jsapi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jsapi.c b/src/jsapi.c index 8eb7372..1df985d 100644 --- a/src/jsapi.c +++ b/src/jsapi.c @@ -775,7 +775,7 @@ static duk_ret_t duk_reset(duk_context* duk) return 0; } -static const char* const ApiKeywords[] = API_KEYWORDS; +static const char* const Apis[] = API_KEYWORDS; static const struct{duk_c_function func; s32 params;} ApiFunc[] = { {NULL, 0}, @@ -936,7 +936,8 @@ static const char* const JsKeywords [] = "break", "do", "instanceof", "typeof", "case", "else", "new", "var", "catch", "finally", "return", "void", "continue", "for", "switch", "while", "debugger", "function", "this", "with", - "default", "if", "throw", "delete", "in", "try", "const" + "default", "if", "throw", "delete", "in", "try", "const", + "true", "false" }; static inline bool isalnum_(char c) {return isalnum(c) || c == '_';} @@ -1034,4 +1035,4 @@ const tic_script_config* getJsScriptConfig() s32 duk_timeout_check(void* udata){return 0;} -#endif /* defined(TIC_BUILD_WITH_JS) */ \ No newline at end of file +#endif /* defined(TIC_BUILD_WITH_JS) */ From 0a329ef8387b3a776ab3971fe30629ec8ea12616 Mon Sep 17 00:00:00 2001 From: rdrpenguin04 Date: Sun, 10 Jun 2018 11:20:58 -0500 Subject: [PATCH 2/2] Update jsapi.c Fix typo... oops. --- src/jsapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsapi.c b/src/jsapi.c index 1df985d..b99f8ce 100644 --- a/src/jsapi.c +++ b/src/jsapi.c @@ -775,7 +775,7 @@ static duk_ret_t duk_reset(duk_context* duk) return 0; } -static const char* const Apis[] = API_KEYWORDS; +static const char* const ApiKeywords[] = API_KEYWORDS; static const struct{duk_c_function func; s32 params;} ApiFunc[] = { {NULL, 0},