ref: 6e62eb0923b6648387ae045623836ed18d476159
parent: 3d3f473c399186d229bc0313d3f4efaef0cc5bdb
author: Tor Andersson <[email protected]>
date: Tue Nov 19 07:53:09 EST 2019
Issue 113: Add a js_delglobal function.
--- a/jsrun.c
+++ b/jsrun.c
@@ -792,6 +792,11 @@
js_pop(J, 1);
}
+void js_delglobal(js_State *J, const char *name)
+{
+ jsR_delproperty(J, J->G, name);
+}
+
void js_getproperty(js_State *J, int idx, const char *name)
{
jsR_getproperty(J, js_toobject(J, idx), name);
--- a/mujs.h
+++ b/mujs.h
@@ -121,6 +121,7 @@
void js_getglobal(js_State *J, const char *name);
void js_setglobal(js_State *J, const char *name);
void js_defglobal(js_State *J, const char *name, int atts);
+void js_delglobal(js_State *J, const char *name);
int js_hasproperty(js_State *J, int idx, const char *name);
void js_getproperty(js_State *J, int idx, const char *name);