Skip to content
Snippets Groups Projects
Commit cba1822d authored by rswindell's avatar rswindell
Browse files

JS_GetProperty will return TRUE even if the property doesn't exist but the val

will be undefined.
parent c2f60a8b
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ JSObject* DLLCALL js_CreateFileAreaObject(JSContext* cx, JSObject* parent, scfg_
JSBool found;
/* Return existing object if it's already been created */
if(JS_GetProperty(cx,parent,"file_area",&val))
if(JS_GetProperty(cx,parent,"file_area",&val) && val!=JSVAL_VOID)
return(JSVAL_TO_OBJECT(val));
areaobj = JS_DefineObject(cx, parent, "file_area", &js_file_area_class, NULL, 0);
......
......@@ -130,7 +130,7 @@ JSObject* DLLCALL js_CreateMsgAreaObject(JSContext* cx, JSObject* parent, scfg_t
JSBool found;
/* Return existing object if it's already been created */
if(JS_GetProperty(cx,parent,"msg_area",&val))
if(JS_GetProperty(cx,parent,"msg_area",&val) && val!=JSVAL_VOID)
return(JSVAL_TO_OBJECT(val));
areaobj = JS_DefineObject(cx, parent, "msg_area", &js_msg_area_class, NULL, 0);
......
......@@ -750,7 +750,7 @@ JSObject* DLLCALL js_CreateUserObject(JSContext* cx, JSObject* parent, scfg_t* c
jsval val;
/* Return existing user object if it's already been created */
if(JS_GetProperty(cx,parent,name,&val))
if(JS_GetProperty(cx,parent,name,&val) && val!=JSVAL_VOID)
return(JSVAL_TO_OBJECT(val));
userobj = JS_DefineObject(cx, parent, name, &js_user_class, NULL, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment