aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_js.c
diff options
context:
space:
mode:
Diffstat (limited to 'nginx/ngx_js.c')
-rw-r--r--nginx/ngx_js.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index 831593da..7a816498 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -953,16 +953,21 @@ ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_js_conf_t *conf,
}
}
- rc = externals_init(cf, conf);
- if (rc != NGX_OK) {
- return NGX_ERROR;
- }
+ /*
+ * Core prototypes must be inited before externals_init() because
+ * the core prototype ids have to be identical in all the modules.
+ */
rc = ngx_js_core_init(conf->vm, cf->log);
if (njs_slow_path(rc != NJS_OK)) {
return NGX_ERROR;
}
+ rc = externals_init(cf, conf);
+ if (rc != NGX_OK) {
+ return NGX_ERROR;
+ }
+
end = start + size;
rc = njs_vm_compile(conf->vm, &start, end);