The issue was introduced in
452ce96df2e3.
This closes #258 issue on Github.
vm->variables_hash = scope->variables;
- if (vm->options.init) {
+ if (vm->options.init && !vm->options.accumulative) {
ret = njs_vm_init(vm);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
{ njs_str("/abc/i.test('ABC')" ENTER),
njs_str("true") },
+ /* Accumulative mode. */
+
+ { njs_str("var a = 1" ENTER
+ "a" ENTER),
+ njs_str("1") },
+
+ { njs_str("Number.prototype.test = 'test'" ENTER
+ "Number.prototype.test" ENTER),
+ njs_str("test") },
+
/* Error handling */
{ njs_str("var a = ;" ENTER