@@ -272,7 +272,8 @@ bool JSB_CCPhysicsDebugNode_constructor(JSContext *cx, uint32_t argc, jsval *vp)
272
272
CCASSERT (typeMapIter != _js_global_type_map.end (), " Can't find the class type!" );
273
273
typeClass = typeMapIter->second ;
274
274
CCASSERT (typeClass, " The value is null." );
275
- JS::RootedObject obj (cx, JS_NewObjectForConstructor (cx, typeClass->jsclass , args));
275
+ // JS::RootedObject obj(cx, JS_NewObjectForConstructor(cx, typeClass->jsclass, args));
276
+ JS::RootedObject obj (cx, JS_NewObject (cx, typeClass->jsclass , JS::RootedObject (cx, typeClass->proto ), JS::RootedObject (cx, typeClass->parentProto )));
276
277
args.rval ().set (OBJECT_TO_JSVAL (obj));
277
278
// link the native object with the javascript object
278
279
js_proxy_t * p = jsb_new_proxy (cobj, obj);
@@ -494,7 +495,8 @@ bool JSPROXY_CCPhysicsSprite_constructor(JSContext *cx, uint32_t argc, jsval *vp
494
495
CCASSERT (typeMapIter != _js_global_type_map.end (), " Can't find the class type!" );
495
496
typeClass = typeMapIter->second ;
496
497
CCASSERT (typeClass, " The value is null." );
497
- JS::RootedObject obj (cx, JS_NewObjectForConstructor (cx, typeClass->jsclass , args));
498
+ // JS::RootedObject obj(cx, JS_NewObjectForConstructor(cx, typeClass->jsclass, args));
499
+ JS::RootedObject obj (cx, JS_NewObject (cx, typeClass->jsclass , JS::RootedObject (cx, typeClass->proto ), JS::RootedObject (cx, typeClass->parentProto )));
498
500
args.rval ().set (OBJECT_TO_JSVAL (obj));
499
501
// link the native object with the javascript object
500
502
js_proxy_t * p = jsb_new_proxy (cobj, obj);
0 commit comments