Skip to content

Instantly share code, notes, and snippets.

View xeioex's full-sized avatar

Dmitry Volyntsev xeioex

View GitHub Profile
# HG changeset patch
# User Dmitry Volyntsev <[email protected]>
# Date 1545914285 -10800
# Thu Dec 27 15:38:05 2018 +0300
# Node ID 52c69512c5d6b8f7466e75f8d7179b8146d91150
# Parent 9ab8d11c151d4af4e634fa9bb8ef0bfef662c064
njs_vm_run() is rectified.
Previously, both njs_vm_call() and njs_vm_run() can be used to run njs
code. njs_vm_call() was used to invoke a single function, while
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1546019024 -28800
# Sat Dec 29 01:43:44 2018 +0800
# Node ID 792dbba9b9022ef6435f6f07a0b83cf5a723c8db
# Parent c4ec36309dda20b888ba65dc9ffa3f6de8945c8f
Improved njs_generate_typeof_operation().
njs_variable_typeof() cannot fail.
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1546070637 -28800
# Sat Dec 29 16:03:57 2018 +0800
# Node ID 0ddf94510f23979d79f26fee0ecc603e2ac6432a
# Parent 9fc5ed136eb63d021b8a34b981097a85c1e193fc
Improved working with scope indexes of variables.
diff --git a/njs/njs_parser.h b/njs/njs_parser.h
--- a/njs/njs_parser.h
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1546070637 -28800
# Sat Dec 29 16:03:57 2018 +0800
# Node ID 4538d14396e65616cb37733d617fbb57305763ab
# Parent 157bbb5d50ebc222e5d95d1be47fb05757da5ad9
Improved working with scope indexes of variables.
diff --git a/njs/njs_parser.h b/njs/njs_parser.h
--- a/njs/njs_parser.h
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1546094131 -28800
# Sat Dec 29 22:35:31 2018 +0800
# Node ID 39bbddb3f19c18e24b0df0adbd02e3b86e076cb4
# Parent 4538d14396e65616cb37733d617fbb57305763ab
Improved function naming in variable code.
Renaming:
1) njs_variable_get() to njs_variable_resolve().
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1546870457 -28800
# Mon Jan 07 22:14:17 2019 +0800
# Node ID f13d10d26346480e73c80cf3e8bb2111d878ace1
# Parent 07d1e6a4d270dff6c88fb6518488edba7721b295
Introduced function native call.
diff --git a/njs/njs_function.c b/njs/njs_function.c
--- a/njs/njs_function.c
diff --git a/njs/njs_function.h b/njs/njs_function.h
--- a/njs/njs_function.h
+++ b/njs/njs_function.h
@@ -174,7 +174,8 @@ njs_native_frame_t *njs_function_previou
void njs_function_frame_free(njs_vm_t *vm, njs_native_frame_t *frame);
njs_ret_t njs_function_call(njs_vm_t *vm, njs_index_t retval, size_t advance);
njs_ret_t njs_function_native_call(njs_vm_t *vm, njs_function_native_t native,
- njs_value_t *args, uint8_t *args_types, nxt_uint_t nargs, njs_index_t retval);
+ njs_value_t *args, uint8_t *args_types, nxt_uint_t nargs,
+ njs_index_t retval);
diff --git a/njs/njs.c b/njs/njs.c
--- a/njs/njs.c
+++ b/njs/njs.c
@@ -461,14 +461,14 @@ nxt_int_t
njs_vm_call(njs_vm_t *vm, njs_function_t *function, const njs_value_t *args,
nxt_uint_t nargs)
{
- u_char *current;
- njs_ret_t ret;
- njs_value_t *this;
diff --git a/njs/njs_parser.c b/njs/njs_parser.c
--- a/njs/njs_parser.c
+++ b/njs/njs_parser.c
@@ -878,12 +878,6 @@ njs_parser_export_statement(njs_vm_t *vm
}
}
- if (parser->mode == NJS_PARSER_MODE_SCRIPT || scope->nesting != 0) {
- njs_parser_syntax_error(vm, parser, "Illegal export statement");
-
diff --git a/njs/njs_parser.c b/njs/njs_parser.c
--- a/njs/njs_parser.c
+++ b/njs/njs_parser.c
@@ -878,12 +878,6 @@ njs_parser_export_statement(njs_vm_t *vm
}
}
- if (parser->mode == NJS_PARSER_MODE_SCRIPT || scope->nesting != 0) {
- njs_parser_syntax_error(vm, parser, "Illegal export statement");
-