summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-22 22:36:16 +0100
committerportix <none@none>2012-11-22 22:36:16 +0100
commita018f961010258d20d174c53dcad2972f6d8a5ab (patch)
treeece787542ec3662d8905309fbc63f27babc5e7bc /src
parent85659e8488445ce7a9fd2c51c00cee1f2e848ce3 (diff)
downloaddwb-a018f961010258d20d174c53dcad2972f6d8a5ab.zip
Create context object for global_include
Diffstat (limited to 'src')
-rw-r--r--src/scripts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scripts.c b/src/scripts.c
index 5d0aa418..81668260 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -888,7 +888,9 @@ global_include(JSContextRef ctx, JSObjectRef f, JSObjectRef thisObject, size_t a
else {
JSObjectRef function = JSObjectMakeFunction(ctx, NULL, 0, NULL, script, NULL, 0, exc);
if (function != NULL) {
- ret = JSObjectCallAsFunction(ctx, function, thisObject, 0, NULL, exc);
+ JSObjectRef this = JSObjectMake(ctx, NULL, NULL);
+ JSValueProtect(ctx, this);
+ ret = JSObjectCallAsFunction(ctx, function, this, 0, NULL, exc);
}
}
JSStringRelease(script);