From 0e50289cf77f40c05f6bbaf70a8619c1f1b116ba Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 2 Aug 2017 16:44:53 +0800 Subject: [PATCH] cleanup. --- .../scripting/js-bindings/jswrapper/chakracore/Class.cpp | 2 +- native/cocos/scripting/js-bindings/jswrapper/config.hpp | 4 ++-- native/cocos/scripting/js-bindings/jswrapper/jsc/Utils.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native/cocos/scripting/js-bindings/jswrapper/chakracore/Class.cpp b/native/cocos/scripting/js-bindings/jswrapper/chakracore/Class.cpp index fced3767ad..bdb1235416 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/chakracore/Class.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/chakracore/Class.cpp @@ -100,7 +100,7 @@ namespace se { JsValueRef prototype; _CHECK(JsCreateObject(&prototype)); - Object* prototypeObj = Object::_createJSObject(nullptr, prototype, true); + Object* prototypeObj = Object::_createJSObject(this, prototype, true); for (const auto& func : _funcs) { diff --git a/native/cocos/scripting/js-bindings/jswrapper/config.hpp b/native/cocos/scripting/js-bindings/jswrapper/config.hpp index 2b278d462b..7eab99dc14 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/config.hpp +++ b/native/cocos/scripting/js-bindings/jswrapper/config.hpp @@ -1,8 +1,8 @@ #pragma once -//#define SCRIPT_ENGINE_SM +#define SCRIPT_ENGINE_SM //#define SCRIPT_ENGINE_V8 -#define SCRIPT_ENGINE_JSC +//#define SCRIPT_ENGINE_JSC //#define SCRIPT_ENGINE_CHAKRACORE #ifdef ANDROID diff --git a/native/cocos/scripting/js-bindings/jswrapper/jsc/Utils.cpp b/native/cocos/scripting/js-bindings/jswrapper/jsc/Utils.cpp index 422dea37cc..36da6ab806 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/jsc/Utils.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/jsc/Utils.cpp @@ -151,7 +151,7 @@ namespace se { } else { - HandleObject obj(Object::_createJSObject(nullptr, jsobj)); + HandleObject obj(Object::_createJSObject(nullptr, jsobj)); //FIXME: consider which in sm, new create a new object everytime? obj->root(); data->setObject(obj); }