How to defineObject with name, proto and parent (spidermonkey 60)

msami <[email protected]> Tue, 20 Aug 2019 05:18:17 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
JSObject * JS_New(JSContext *cx, JS::HandleObject ctor, const JS::HandleValueArray& args); 
#just like new object();


JSObject *
JS_DefineObject(JSContext *cx, JS::HandleObject obj, const char *name,
                const JSClass *clasp = nullptr, unsigned attrs = 0);
#can access by evaluate but no properties

JS_NewObjectWithGivenProto

# can't access by evaluate


I want to define JSObject* on context and access it as if I evaluated script like that var object1={ x:1,y:5};

any help or readings will be most appreciated

Thanks on advance