You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/04/10 09:37:12 UTC
[incubator-weex] branch master updated: [Android][iOS][WeexCore]
Remove eagle from weex (#2302)
This is an automated email from the ASF dual-hosted git repository.
jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 7b46280 [Android][iOS][WeexCore] Remove eagle from weex (#2302)
7b46280 is described below
commit 7b4628062404506b08510d3206cb569f75b7d86d
Author: YorkShen <sh...@gmail.com>
AuthorDate: Wed Apr 10 17:37:07 2019 +0800
[Android][iOS][WeexCore] Remove eagle from weex (#2302)
* [core] remove eagle from weexsdk
* [iOS] add WXDataRenderHandler.h file
* [iOS] remove eagle_bridge.h from WeexSDK.h
* [core] new WeexCoreHandler when EagleBridge create
* [core] add __cplusplus in eagle_bridge.h
* [core] add GetPage interface for eagle
* [iOS] run execute js on component thread
* [core]add interface in DataRenderHandler
* [iOS] execute js on bridge thread
* [iOS] execte js code
* [core] remove eagle_bridge.h
* [core] add eagle_bridge.h
* [iOS] add WXDataRenderHandler.h
* * [Android] Fix compiling issue for android.
* * [Android] Update execJS in eagle_bridge.h
* * [Android] Add PostTaskToMsgLoop
* * [Android] Update CMakeList.txt
* * Add InitConfig.nativeLibraryList
* * [Android] Make InitConfig as private
* [iOS] public WXConvertUtility.h file
* * [Android] Update .so
* ParamsType adding two type
* add env in createpage for eagle
* support invokecallback and register component for eagle'
* [iOS]fix compile error
* run ok
* [iOS]remove eagle_bridge.h file from WeexSDK.h
* [Weex][Eagle][Qking] adapt to ios add qking source code
* update so
* [Weex][Eagle] ios eagle rax OK
* [Weex][Eagle] remove c++ static class register
* [core] hide RenderObject class
* [core] remove renderobject
* [iOS] Public headers.
* Update .so
* [iOS] remove weexeagle from playground demo
* [iOS] fix compile error when other project import weexsdk by source code
* [iOS] support js parallel download
* [iOS] support refresh event on eagle
* fix ios crash on app exit of json11 static field
---
WeexSDK.podspec | 5 +-
.../src/main/java/com/taobao/weex/InitConfig.java | 20 +-
.../src/main/java/com/taobao/weex/WXSDKEngine.java | 18 +-
.../main/java/com/taobao/weex/bridge/WXBridge.java | 48 +-
.../com/taobao/weex/bridge/WXBridgeManager.java | 78 +-
ios/playground/Podfile | 1 +
ios/playground/WeexDemo/WXNavigationHandlerImpl.h | 2 +-
ios/playground/WeexDemo/WXNavigationHandlerImpl.m | 2 +-
.../extend/handler/WXImgLoaderDefaultImpl.h | 2 +-
.../extend/handler/WXImgLoaderDefaultImpl.m | 4 +-
ios/sdk/.warningignore | 0
ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 606 +---
ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 92 +-
ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h | 14 -
ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 238 +-
.../WeexSDK/Sources/Eagle/WXDataRenderHandler.h | 44 +
ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m | 37 +-
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 5 +
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 36 +
ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h | 14 +-
.../WeexSDK/Sources/Utility/WXConvertUtility.mm | 77 +-
ios/sdk/WeexSDK/Sources/WeexSDK.h | 2 +
ios/sdk/buildScripts.sh | 35 +-
weex_core/Source/CMakeLists.txt | 48 +-
weex_core/Source/android/wrap/wx_bridge.cpp | 54 +-
.../android/jniprebuild/jniheader/WXBridge_jni.h | 49 +-
weex_core/Source/core/bridge/eagle_bridge.cpp | 232 ++
weex_core/Source/core/bridge/eagle_bridge.h | 149 +
.../core/bridge/platform/core_side_in_platform.cpp | 62 +-
.../core/bridge/script/core_side_in_script.cpp | 5 +-
weex_core/Source/core/data_render/ast.cc | 41 -
weex_core/Source/core/data_render/ast.h | 695 ----
weex_core/Source/core/data_render/ast_builder.cc | 295 --
weex_core/Source/core/data_render/ast_builder.h | 146 -
weex_core/Source/core/data_render/ast_factory.cc | 395 ---
weex_core/Source/core/data_render/ast_factory.h | 127 -
weex_core/Source/core/data_render/ast_visitor.h | 64 -
weex_core/Source/core/data_render/binary_file.cc | 87 -
weex_core/Source/core/data_render/binary_file.h | 67 -
weex_core/Source/core/data_render/class.cc | 141 -
weex_core/Source/core/data_render/class.h | 51 -
weex_core/Source/core/data_render/class_array.cc | 302 --
weex_core/Source/core/data_render/class_array.h | 47 -
weex_core/Source/core/data_render/class_console.cc | 135 -
weex_core/Source/core/data_render/class_console.h | 39 -
weex_core/Source/core/data_render/class_factory.cc | 238 --
weex_core/Source/core/data_render/class_factory.h | 63 -
.../Source/core/data_render/class_function.cc | 73 -
weex_core/Source/core/data_render/class_function.h | 40 -
weex_core/Source/core/data_render/class_json.cc | 91 -
weex_core/Source/core/data_render/class_json.h | 39 -
weex_core/Source/core/data_render/class_math.cc | 137 -
weex_core/Source/core/data_render/class_math.h | 40 -
weex_core/Source/core/data_render/class_object.cc | 68 -
weex_core/Source/core/data_render/class_object.h | 39 -
weex_core/Source/core/data_render/class_regex.cc | 148 -
weex_core/Source/core/data_render/class_regex.h | 39 -
weex_core/Source/core/data_render/class_string.cc | 554 ----
weex_core/Source/core/data_render/class_string.h | 41 -
weex_core/Source/core/data_render/class_window.cc | 47 -
weex_core/Source/core/data_render/class_window.h | 40 -
.../Source/core/data_render/code_generator.cc | 1621 ----------
weex_core/Source/core/data_render/code_generator.h | 247 --
weex_core/Source/core/data_render/common_error.h | 139 -
weex_core/Source/core/data_render/exec_state.cc | 342 --
weex_core/Source/core/data_render/exec_state.h | 244 --
.../Source/core/data_render/exec_state_binary.cc | 638 ----
.../Source/core/data_render/exec_state_binary.h | 90 -
.../Source/core/data_render/exec_state_section.cc | 3309 --------------------
.../Source/core/data_render/exec_state_section.h | 262 --
weex_core/Source/core/data_render/handle.h | 154 -
.../Source/core/data_render/js_common_function.cc | 69 -
.../Source/core/data_render/js_common_function.h | 40 -
.../Source/core/data_render/monitor/vm_monitor.h | 229 --
weex_core/Source/core/data_render/object.cc | 295 --
weex_core/Source/core/data_render/object.h | 670 ----
weex_core/Source/core/data_render/op_code.cc | 36 -
weex_core/Source/core/data_render/op_code.h | 155 -
weex_core/Source/core/data_render/parser.cc | 839 -----
weex_core/Source/core/data_render/parser.h | 64 -
weex_core/Source/core/data_render/rax_jsx_ast.cc | 153 -
weex_core/Source/core/data_render/rax_jsx_ast.h | 65 -
weex_core/Source/core/data_render/rax_parser.cc | 1557 ---------
weex_core/Source/core/data_render/rax_parser.h | 138 -
.../Source/core/data_render/rax_parser_builder.cc | 53 -
.../Source/core/data_render/rax_parser_builder.h | 57 -
.../Source/core/data_render/rax_parser_context.cc | 44 -
.../Source/core/data_render/rax_parser_context.h | 49 -
.../Source/core/data_render/rax_parser_scope.cc | 92 -
.../Source/core/data_render/rax_parser_scope.h | 100 -
.../core/data_render/rax_parser_statistics.cc | 39 -
.../core/data_render/rax_parser_statistics.h | 61 -
.../Source/core/data_render/rax_source_locator.cc | 38 -
.../Source/core/data_render/rax_source_locator.h | 48 -
weex_core/Source/core/data_render/scanner.h | 74 -
weex_core/Source/core/data_render/statement.cc | 42 -
weex_core/Source/core/data_render/statement.h | 291 --
weex_core/Source/core/data_render/string_table.cc | 55 -
weex_core/Source/core/data_render/string_table.h | 61 -
weex_core/Source/core/data_render/table.cc | 283 --
weex_core/Source/core/data_render/table.h | 51 -
weex_core/Source/core/data_render/token.cc | 51 -
weex_core/Source/core/data_render/token.h | 251 --
weex_core/Source/core/data_render/tokenizer.cc | 705 -----
weex_core/Source/core/data_render/tokenizer.h | 60 -
weex_core/Source/core/data_render/vm.cc | 988 ------
weex_core/Source/core/data_render/vm.h | 54 -
.../core/data_render/vnode/android/conversion.cc | 80 -
.../core/data_render/vnode/android/conversion.h | 45 -
.../vnode/android/vcomponent_lifecycle_listener.cc | 282 --
.../vnode/android/vnode_on_event_listener.cc | 108 -
.../vnode/ios/vcomponent_lifecycle_listener.mm | 89 -
.../vnode/ios/vnode_on_event_listener.mm | 49 -
.../Source/core/data_render/vnode/vcomponent.cc | 310 --
.../Source/core/data_render/vnode/vcomponent.h | 117 -
.../vnode/vcomponent_lifecycle_listener.h | 42 -
weex_core/Source/core/data_render/vnode/vnode.cc | 174 -
weex_core/Source/core/data_render/vnode/vnode.h | 165 -
.../core/data_render/vnode/vnode_exec_env.cc | 842 -----
.../Source/core/data_render/vnode/vnode_exec_env.h | 43 -
.../data_render/vnode/vnode_on_event_listener.h | 39 -
.../core/data_render/vnode/vnode_render_context.cc | 39 -
.../core/data_render/vnode/vnode_render_context.h | 109 -
.../core/data_render/vnode/vnode_render_manager.cc | 1008 ------
.../core/data_render/vnode/vnode_render_manager.h | 106 -
.../core/network/ios/default_request_handler.mm | 11 +-
weex_core/Source/core/render/page/render_page.cpp | 3 +-
weex_core/Source/include/WeexApiValue.h | 2 +
weex_core/Source/third_party/json11/json11.cc | 8 +-
129 files changed, 1066 insertions(+), 23816 deletions(-)
diff --git a/WeexSDK.podspec b/WeexSDK.podspec
index 6a7ab3f..6e06b5b 100644
--- a/WeexSDK.podspec
+++ b/WeexSDK.podspec
@@ -98,8 +98,10 @@ Pod::Spec.new do |s|
'ios/sdk/WeexSDK/Sources/Manager/WXInvocationConfig.h',
'ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h',
'ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h',
+ 'ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h',
'ios/sdk/WeexSDK/Sources/Utility/WXConvert.h',
'ios/sdk/WeexSDK/Sources/Utility/WXUtility.h',
+ 'ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h',
'ios/sdk/WeexSDK/Sources/Utility/WXLog.h',
'ios/sdk/WeexSDK/Sources/Utility/WXDefine.h',
'ios/sdk/WeexSDK/Sources/Utility/WXType.h',
@@ -110,7 +112,8 @@ Pod::Spec.new do |s|
'ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.h',
'weex_core/Source/core/layout/flex_enum.h',
'weex_core/Source/core/layout/layout.h',
- 'weex_core/Source/core/layout/style.h'
+ 'weex_core/Source/core/layout/style.h',
+ 'weex_core/Source/core/bridge/eagle_bridge.h'
s.module_map = 'WeexSDK.modulemap'
diff --git a/android/sdk/src/main/java/com/taobao/weex/InitConfig.java b/android/sdk/src/main/java/com/taobao/weex/InitConfig.java
index d87c28f..053fb82 100644
--- a/android/sdk/src/main/java/com/taobao/weex/InitConfig.java
+++ b/android/sdk/src/main/java/com/taobao/weex/InitConfig.java
@@ -18,19 +18,22 @@
*/
package com.taobao.weex;
+import android.support.annotation.NonNull;
import com.taobao.weex.adapter.ClassLoaderAdapter;
import com.taobao.weex.adapter.IDrawableLoader;
-import com.taobao.weex.adapter.IWXJscProcessManager;
import com.taobao.weex.adapter.IWXHttpAdapter;
import com.taobao.weex.adapter.IWXImgLoaderAdapter;
import com.taobao.weex.adapter.IWXJSExceptionAdapter;
import com.taobao.weex.adapter.IWXJsFileLoaderAdapter;
+import com.taobao.weex.adapter.IWXJscProcessManager;
import com.taobao.weex.adapter.IWXSoLoaderAdapter;
import com.taobao.weex.adapter.IWXUserTrackAdapter;
import com.taobao.weex.adapter.URIAdapter;
import com.taobao.weex.appfram.storage.IWXStorageAdapter;
import com.taobao.weex.appfram.websocket.IWebSocketAdapterFactory;
import com.taobao.weex.performance.IApmGenerator;
+import java.util.LinkedList;
+import java.util.List;
/**
* Created by sospartan on 5/31/16.
@@ -50,6 +53,7 @@ public class InitConfig {
private IApmGenerator apmGenerater;
private IWXJsFileLoaderAdapter jsFileLoaderAdapter;
private IWXJscProcessManager jscProcessManager;
+ private List<String> nativeLibraryList;
public IWXHttpAdapter getHttpAdapter() {
return httpAdapter;
@@ -111,6 +115,13 @@ public class InitConfig {
return jscProcessManager;
}
+ @NonNull Iterable<String> getNativeLibraryList() {
+ if(nativeLibraryList == null){
+ nativeLibraryList = new LinkedList<>();
+ }
+ return nativeLibraryList;
+ }
+
private InitConfig() {
}
@@ -128,6 +139,7 @@ public class InitConfig {
ClassLoaderAdapter classLoaderAdapter;
IApmGenerator apmGenerater;
private IWXJsFileLoaderAdapter jsFileLoaderAdapter;
+ private List<String> nativeLibraryList = new LinkedList<>();
public IWXJscProcessManager getJscProcessManager() {
return jscProcessManager;
@@ -209,6 +221,11 @@ public class InitConfig {
return this;
}
+ public Builder addNativeLibrary(String name){
+ nativeLibraryList.add(name);
+ return this;
+ }
+
public InitConfig build(){
InitConfig config = new InitConfig();
config.httpAdapter = this.httpAdapter;
@@ -225,6 +242,7 @@ public class InitConfig {
config.apmGenerater = this.apmGenerater;
config.jsFileLoaderAdapter = this.jsFileLoaderAdapter;
config.jscProcessManager = this.jscProcessManager;
+ config.nativeLibraryList = this.nativeLibraryList;
return config;
}
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
index c29377c..e684082 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
@@ -18,14 +18,14 @@
*/
package com.taobao.weex;
+import static com.taobao.weex.WXEnvironment.CORE_SO_NAME;
+
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
-
-import android.util.Log;
import com.taobao.weex.adapter.IDrawableLoader;
import com.taobao.weex.adapter.IWXHttpAdapter;
import com.taobao.weex.adapter.IWXImgLoaderAdapter;
@@ -50,7 +50,6 @@ import com.taobao.weex.common.WXErrorCode;
import com.taobao.weex.common.WXException;
import com.taobao.weex.common.WXInstanceWrap;
import com.taobao.weex.common.WXModule;
-import com.taobao.weex.common.WXPerformance;
import com.taobao.weex.http.WXStreamModule;
import com.taobao.weex.ui.ExternalLoaderComponentHolder;
import com.taobao.weex.ui.IExternalComponentGetter;
@@ -79,7 +78,6 @@ import com.taobao.weex.ui.component.WXSwitch;
import com.taobao.weex.ui.component.WXText;
import com.taobao.weex.ui.component.WXVideo;
import com.taobao.weex.ui.component.WXWeb;
-import com.taobao.weex.ui.component.basic.WXBasicComponent;
import com.taobao.weex.ui.component.list.HorizontalListComponent;
import com.taobao.weex.ui.component.list.SimpleListComponent;
import com.taobao.weex.ui.component.list.WXCell;
@@ -98,13 +96,10 @@ import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXSoInstallMgrSdk;
import com.taobao.weex.utils.batch.BatchOperationHelper;
import com.taobao.weex.utils.cache.RegisterCache;
-
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
-import static com.taobao.weex.WXEnvironment.CORE_SO_NAME;
-
public class WXSDKEngine implements Serializable {
public static final String JS_FRAMEWORK_RELOAD="js_framework_reload";
@@ -227,7 +222,14 @@ public class WXSDKEngine implements Serializable {
WXSoInstallMgrSdk.init(application,
sm.getIWXSoLoaderAdapter(),
sm.getWXStatisticsListener());
- mIsSoInit = WXSoInstallMgrSdk.initSo(V8_SO_NAME, 1, config!=null?config.getUtAdapter():null);
+ final IWXUserTrackAdapter userTrackAdapter= config!=null?config.getUtAdapter():null;
+ final int version = 1;
+ mIsSoInit = WXSoInstallMgrSdk.initSo(V8_SO_NAME, version, userTrackAdapter);
+ if(config!=null) {
+ for (String libraryName : config.getNativeLibraryList()) {
+ WXSoInstallMgrSdk.initSo(libraryName, version, userTrackAdapter);
+ }
+ }
if (!mIsSoInit) {
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_SDK_INIT,
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridge.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridge.java
index 15fd438..22ec2bc 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridge.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridge.java
@@ -35,6 +35,7 @@ import com.taobao.weex.dom.CSSShorthand;
import com.taobao.weex.layout.ContentBoxMeasurement;
import com.taobao.weex.performance.WXInstanceApm;
import com.taobao.weex.utils.WXExceptionUtils;
+import com.taobao.weex.utils.WXJsonUtils;
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXUtils;
import com.taobao.weex.utils.WXWsonJSONSwitch;
@@ -71,8 +72,12 @@ public class WXBridge implements IWXBridge {
public native void nativeFireEventOnDataRenderNode(String instanceId, String ref, String type, String data, String domChanges);
+ public native void nativeInvokeCallbackOnDataRender(String instanceId, String callbackId, String data, boolean keepAlive);
+
public native void nativeRegisterModuleOnDataRenderNode( String data);
+ public native void nativeRegisterComponentOnDataRenderNode( String data);
+
private native void nativeTakeHeapSnapshot(String filename);
private native void nativeBindMeasurementToRenderObject(long ptr);
@@ -296,7 +301,23 @@ public class WXBridge implements IWXBridge {
WXUtils.getFixUnixTime()-start
);
}
- return WXWsonJSONSwitch.toWsonOrJsonWXJSObject(object);
+ if (instance!=null && (instance.getRenderStrategy()== WXRenderStrategy.DATA_RENDER
+ || instance.getRenderStrategy()== WXRenderStrategy.DATA_RENDER_BINARY)){
+ try {
+ if(object == null){
+ return new WXJSObject(null);
+ }
+ if(object.getClass() == WXJSObject.class){
+ return (WXJSObject) object;
+ }
+ return new WXJSObject(WXJSObject.JSON, WXJsonUtils.fromObjectToJSONString(object));
+ } catch (Exception e) {
+ // For wson use in data render mode
+ return WXWsonJSONSwitch.toWsonOrJsonWXJSObject(object);
+ }
+ } else {
+ return WXWsonJSONSwitch.toWsonOrJsonWXJSObject(object);
+ }
}catch (Exception e){
WXLogUtils.e(TAG, e);
return new WXJSObject(null);
@@ -316,7 +337,22 @@ public class WXBridge implements IWXBridge {
@CalledByNative
public void callNativeComponent(String instanceId, String ref, String method, byte[] arguments, byte[] optionsData) {
try{
- JSONArray argArray = (JSONArray) WXWsonJSONSwitch.parseWsonOrJSON(arguments);
+ WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
+ JSONArray argArray = null;
+ if (arguments != null){
+ // TODO use a better way
+ if (instance!=null && (instance.getRenderStrategy()== WXRenderStrategy.DATA_RENDER
+ || instance.getRenderStrategy()== WXRenderStrategy.DATA_RENDER_BINARY)){
+ try {
+ argArray = (JSONArray) JSON.parse(new String(arguments, "UTF-8"));
+ } catch (Exception e) {
+ // For wson use in data render mode
+ argArray = (JSONArray) WXWsonJSONSwitch.parseWsonOrJSON(arguments);
+ }
+ } else {
+ argArray = (JSONArray) WXWsonJSONSwitch.parseWsonOrJSON(arguments);
+ }
+ }
Object options = WXWsonJSONSwitch.parseWsonOrJSON(optionsData);
WXBridgeManager.getInstance().callNativeComponent(instanceId, ref, method, argArray, options);
}catch (Exception e){
@@ -714,7 +750,15 @@ public class WXBridge implements IWXBridge {
nativeFireEventOnDataRenderNode(instanceId,ref,type,data, domChanges);
}
+ public void invokeCallbackOnDataRender(String instanceId, String callbackId, String data, boolean keepAlive) {
+ nativeInvokeCallbackOnDataRender(instanceId,callbackId,data, keepAlive);
+ }
+
public void registerModuleOnDataRenderNode(String data) {
nativeRegisterModuleOnDataRenderNode(data);
}
+
+ public void registerComponentOnDataRenderNode(String data) {
+ nativeRegisterComponentOnDataRenderNode(data);
+ }
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index ff0fd53..85b8ceb 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -33,6 +33,8 @@ import android.support.annotation.UiThread;
import android.support.v4.util.ArrayMap;
import android.text.TextUtils;
import android.util.Log;
+import android.util.Pair;
+
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -1290,8 +1292,39 @@ public class WXBridgeManager implements Callback, BactchExecutor {
return;
}
- addJSTask(METHOD_CALLBACK, instanceId, callback, data, keepAlive);
- sendMessage(instanceId, WXJSBridgeMsgType.CALL_JS_BATCH);
+ WXSDKInstance instance = WXSDKManager.getInstance().getAllInstanceMap().get(instanceId);
+ if (instance != null && (instance.getRenderStrategy() == WXRenderStrategy.DATA_RENDER_BINARY)) {
+ callbackJavascriptOnDataRender(instanceId, callback, data, keepAlive);
+ } else {
+ addJSTask(METHOD_CALLBACK, instanceId, callback, data, keepAlive);
+ sendMessage(instanceId, WXJSBridgeMsgType.CALL_JS_BATCH);
+ }
+ }
+
+ void callbackJavascriptOnDataRender(final String instanceId, final String callback, final Object data, final boolean keepAlive){
+ mJSHandler.postDelayed(WXThread.secure(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ long start = System.currentTimeMillis();
+ String data_str = JSON.toJSONString(data);
+ if (WXEnvironment.isApkDebugable()) {
+ WXLogUtils.d("callbackJavascriptOnDataRender >>>> instanceId:" + instanceId
+ + ", data:" + data_str);
+ }
+ if (mWXBridge instanceof WXBridge) {
+ ((WXBridge) mWXBridge).invokeCallbackOnDataRender(instanceId, callback,data_str ,keepAlive);
+ }
+ WXLogUtils.renderPerformanceLog("callbackJavascriptOnDataRender", System.currentTimeMillis() - start);
+ } catch (Throwable e) {
+ String err = "[WXBridgeManager] callbackJavascriptOnDataRender " + WXLogUtils.getStackTrace(e);
+ WXExceptionUtils.commitCriticalExceptionRT(instanceId,
+ WXErrorCode.WX_KEY_EXCEPTION_INVOKE_BRIDGE, "callbackJavascriptOnDataRender",
+ err, null);
+ WXLogUtils.e(err);
+ }
+ }
+ }), 0);
}
/**
@@ -1768,8 +1801,19 @@ public class WXBridgeManager implements Callback, BactchExecutor {
mLodBuilder.setLength(0);
}
final long start = System.currentTimeMillis();
- mWXBridge.execJS(instanceId, namespace, function, args);
WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
+ if (instance != null && (instance.getRenderStrategy() == WXRenderStrategy.DATA_RENDER_BINARY)) {
+ Pair<Pair<String,Object>, Boolean> data = null;
+ if(args.length!=2 || !(args[0].data instanceof String)
+ || !(args[1].data instanceof String)
+ || (data = extractCallbackArgs((String) args[1].data))==null){
+ WXLogUtils.w("invokeExecJS on data render that is not a callback call");
+ return;
+ }
+ callbackJavascriptOnDataRender(instanceId, (String) data.first.first, data.first.second, data.second);
+ } else {
+ mWXBridge.execJS(instanceId, namespace, function, args);
+ }
if (null != instance){
long diff = System.currentTimeMillis()-start;
instance.getApmForInstance().updateFSDiffStats(WXInstanceApm.KEY_PAGE_STATS_FS_CALL_JS_NUM,1);
@@ -1778,6 +1822,25 @@ public class WXBridgeManager implements Callback, BactchExecutor {
}
}
+ private Pair<Pair<String,Object>,Boolean> extractCallbackArgs(String data) {
+ try {
+ JSONArray obj = JSON.parseArray(data);
+ JSONObject arg_obj = obj.getJSONObject(0);
+ JSONArray args = arg_obj.getJSONArray("args");
+ if (args.size()!=3){
+ return null;
+ }
+ String method = arg_obj.getString("method");
+ if (!"callback".equals(method)){
+ return null;
+ }
+
+ return new Pair<Pair<String,Object>, Boolean>(new Pair<String, Object>(args.getString(0), args.getJSONObject(1)),args.getBooleanValue(2));
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
public int invokeCreateInstanceContext(String instanceId, String namespace, String function,
WXJSObject[] args, boolean logTaskDetail) {
WXLogUtils.d("invokeCreateInstanceContext instanceId:" + instanceId + " function:"
@@ -2249,6 +2312,15 @@ public class WXBridgeManager implements Callback, BactchExecutor {
return;
}
+ try{
+ // TODO use a better way
+ if (mWXBridge instanceof WXBridge) {
+ ((WXBridge) mWXBridge).registerComponentOnDataRenderNode(WXJsonUtils.fromObjectToJSONString(components));
+ }
+ } catch (Throwable e){
+ WXLogUtils.e("Weex [data_render register err]", e);
+ }
+
WXJSObject[] args = {WXWsonJSONSwitch.toWsonOrJsonWXJSObject(components)};
String errorMsg = null;
try {
diff --git a/ios/playground/Podfile b/ios/playground/Podfile
index 8a4debb..1fd5f3f 100644
--- a/ios/playground/Podfile
+++ b/ios/playground/Podfile
@@ -4,6 +4,7 @@ platform :ios, '8.0'
def common
pod 'WeexSDK', :path=>'../../'
+
pod 'WXDevtool','0.20.0'
pod 'SDWebImage', '3.7.5'
pod 'SocketRocket', '0.4.2'
diff --git a/ios/playground/WeexDemo/WXNavigationHandlerImpl.h b/ios/playground/WeexDemo/WXNavigationHandlerImpl.h
index edad34b..bfd4020 100644
--- a/ios/playground/WeexDemo/WXNavigationHandlerImpl.h
+++ b/ios/playground/WeexDemo/WXNavigationHandlerImpl.h
@@ -18,7 +18,7 @@
*/
#import <Foundation/Foundation.h>
-#import "WXNavigationProtocol.h"
+#import <WeexSDK/WXNavigationProtocol.h>
@interface WXNavigationHandlerImpl : NSObject <WXNavigationProtocol>
diff --git a/ios/playground/WeexDemo/WXNavigationHandlerImpl.m b/ios/playground/WeexDemo/WXNavigationHandlerImpl.m
index ef657b2..67b129c 100644
--- a/ios/playground/WeexDemo/WXNavigationHandlerImpl.m
+++ b/ios/playground/WeexDemo/WXNavigationHandlerImpl.m
@@ -17,9 +17,9 @@
* under the License.
*/
+#import <WeexSDK/WeexSDK.h>
#import "WXNavigationHandlerImpl.h"
#import "WXDemoViewController.h"
-#import <WeexSDK/WeexSDK.h>
@implementation WXNavigationHandlerImpl
diff --git a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
index 159e1d1..cfc354c 100644
--- a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
+++ b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h
@@ -18,7 +18,7 @@
*/
#import <Foundation/Foundation.h>
-#import "WXImgLoaderProtocol.h"
+#import <WeexSDK/WXImgLoaderProtocol.h>
@interface WXImgLoaderDefaultImpl : NSObject<WXImgLoaderProtocol, WXModuleProtocol>
@end
diff --git a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
index b957cd7..13836b3 100644
--- a/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
+++ b/ios/playground/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m
@@ -19,8 +19,8 @@
#import "WXImgLoaderDefaultImpl.h"
#import <SDWebImage/UIImageView+WebCache.h>
-#import "WXLog.h"
-#import "WXSDKManager.h"
+#import <WeexSDK/WXLog.h>
+#import <WeexSDK/WXSDKManager.h>
#define MIN_IMAGE_WIDTH 36
#define MIN_IMAGE_HEIGHT 36
diff --git a/ios/sdk/.warningignore b/ios/sdk/.warningignore
new file mode 100644
index 0000000..e69de29
diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
index 0a9f481..a745221 100644
--- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
+++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
@@ -71,60 +71,23 @@
33CE19142153444900CF9670 /* WXJSFrameworkLoadProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 33CE19122153444900CF9670 /* WXJSFrameworkLoadProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
37B51EE41E97804D0040A743 /* WXCycleSliderComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B51EE21E97804D0040A743 /* WXCycleSliderComponent.h */; };
37B51EE51E97804D0040A743 /* WXCycleSliderComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B51EE31E97804D0040A743 /* WXCycleSliderComponent.mm */; };
- 4505D11B219B1F720083A1A2 /* class_math.h in Headers */ = {isa = PBXBuildFile; fileRef = 4505D119219B1F710083A1A2 /* class_math.h */; };
- 4505D11C219B1F720083A1A2 /* class_math.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4505D11A219B1F710083A1A2 /* class_math.cc */; };
- 4505D11D219B1F9E0083A1A2 /* class_math.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4505D11A219B1F710083A1A2 /* class_math.cc */; };
- 4505D11E219B1FAC0083A1A2 /* class_math.h in Headers */ = {isa = PBXBuildFile; fileRef = 4505D119219B1F710083A1A2 /* class_math.h */; };
- 4505D11F219B20290083A1A2 /* vcomponent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 453267132140E38900DAA620 /* vcomponent.cc */; };
- 4505D120219B20310083A1A2 /* vcomponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 453267122140E38900DAA620 /* vcomponent.h */; };
- 4505D121219B206B0083A1A2 /* exec_state_binary.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A7F21916A9600D83CCE /* exec_state_binary.cc */; };
- 4505D122219B207D0083A1A2 /* exec_state_binary.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8121916A9600D83CCE /* exec_state_binary.h */; };
- 4505D124219B20A80083A1A2 /* exec_state_section.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A7E21916A9600D83CCE /* exec_state_section.cc */; };
- 4505D125219B20B20083A1A2 /* exec_state_section.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8821916A9700D83CCE /* exec_state_section.h */; };
- 4505D126219B20DA0083A1A2 /* class_function.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8421916A9700D83CCE /* class_function.cc */; };
- 4505D127219B20E70083A1A2 /* class_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8921916A9800D83CCE /* class_function.h */; };
- 4505D128219B21110083A1A2 /* class_console.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8221916A9700D83CCE /* class_console.cc */; };
- 4505D129219B211D0083A1A2 /* class_console.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8621916A9700D83CCE /* class_console.h */; };
- 4505D12A219B213B0083A1A2 /* class_regex.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8021916A9600D83CCE /* class_regex.cc */; };
- 4505D12B219B21470083A1A2 /* class_regex.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8721916A9700D83CCE /* class_regex.h */; };
- 4505D12C219B216D0083A1A2 /* class_window.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8321916A9700D83CCE /* class_window.cc */; };
- 4505D12D219B21760083A1A2 /* class_window.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8521916A9700D83CCE /* class_window.h */; };
- 4505D12E219B22630083A1A2 /* op_code.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8A21916A9800D83CCE /* op_code.cc */; };
4532670A213FC84A00DAA620 /* WXDisplayLinkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 45326708213FC84900DAA620 /* WXDisplayLinkManager.h */; };
4532670B213FC84A00DAA620 /* WXDisplayLinkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 45326709213FC84900DAA620 /* WXDisplayLinkManager.m */; };
4532670C213FCF2300DAA620 /* WXDisplayLinkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 45326708213FC84900DAA620 /* WXDisplayLinkManager.h */; };
4532670D213FCFB400DAA620 /* WXDisplayLinkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 45326709213FC84900DAA620 /* WXDisplayLinkManager.m */; };
- 453267142140E38900DAA620 /* vcomponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 453267122140E38900DAA620 /* vcomponent.h */; };
- 453267152140E38900DAA620 /* vcomponent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 453267132140E38900DAA620 /* vcomponent.cc */; };
453F374E219A76A600A03F1D /* WXConvertUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F374C219A76A500A03F1D /* WXConvertUtility.mm */; };
453F3756219A76CA00A03F1D /* default_request_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3750219A76CA00A03F1D /* default_request_handler.h */; };
453F3757219A76CA00A03F1D /* http_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 453F3751219A76CA00A03F1D /* http_module.cc */; };
453F3758219A76CA00A03F1D /* default_request_handler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F3753219A76CA00A03F1D /* default_request_handler.mm */; };
453F3759219A76CA00A03F1D /* request_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3754219A76CA00A03F1D /* request_handler.h */; };
453F375A219A76CA00A03F1D /* http_module.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3755219A76CA00A03F1D /* http_module.h */; };
- 453F375E219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F375C219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm */; };
- 453F375F219A76FA00A03F1D /* vnode_on_event_listener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F375D219A76FA00A03F1D /* vnode_on_event_listener.mm */; };
- 453F3762219A770900A03F1D /* vcomponent_lifecycle_listener.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3760219A770900A03F1D /* vcomponent_lifecycle_listener.h */; };
- 453F3763219A770900A03F1D /* vnode_on_event_listener.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3761219A770900A03F1D /* vnode_on_event_listener.h */; };
- 453F3764219A77EE00A03F1D /* vcomponent_lifecycle_listener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F375C219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm */; };
- 453F3765219A77FF00A03F1D /* vnode_on_event_listener.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F375D219A76FA00A03F1D /* vnode_on_event_listener.mm */; };
- 453F3767219A781900A03F1D /* vcomponent_lifecycle_listener.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3760219A770900A03F1D /* vcomponent_lifecycle_listener.h */; };
- 453F3768219A782900A03F1D /* vnode_on_event_listener.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3761219A770900A03F1D /* vnode_on_event_listener.h */; };
453F376A219A784F00A03F1D /* http_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 453F3751219A76CA00A03F1D /* http_module.cc */; };
453F376B219A785C00A03F1D /* http_module.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3755219A76CA00A03F1D /* http_module.h */; };
453F376C219A786F00A03F1D /* request_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3754219A76CA00A03F1D /* request_handler.h */; };
453F376D219A788800A03F1D /* default_request_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F3750219A76CA00A03F1D /* default_request_handler.h */; };
453F376E219A789A00A03F1D /* default_request_handler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F3753219A76CA00A03F1D /* default_request_handler.mm */; };
453F376F219A78D700A03F1D /* WXConvertUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 453F374C219A76A500A03F1D /* WXConvertUtility.mm */; };
- 4547FD012152048700E79971 /* class_object.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4547FCFF2152048600E79971 /* class_object.cc */; };
- 4547FD022152048700E79971 /* class_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 4547FD002152048600E79971 /* class_object.h */; };
- 4547FD032152049F00E79971 /* class_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 4547FD002152048600E79971 /* class_object.h */; };
- 4547FD04215204AB00E79971 /* class_object.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4547FCFF2152048600E79971 /* class_object.cc */; };
- 4547FD0D215392FA00E79971 /* js_common_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 4547FD0B215392F900E79971 /* js_common_function.h */; };
- 4547FD0E215392FA00E79971 /* js_common_function.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4547FD0C215392F900E79971 /* js_common_function.cc */; };
- 4547FD0F2153931000E79971 /* js_common_function.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4547FD0C215392F900E79971 /* js_common_function.cc */; };
- 4547FD102153932A00E79971 /* js_common_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 4547FD0B215392F900E79971 /* js_common_function.h */; };
- 45E0B4C121CB7B82005D1B3B /* WXConvertUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F374B219A76A500A03F1D /* WXConvertUtility.h */; };
+ 45E0B4C121CB7B82005D1B3B /* WXConvertUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F374B219A76A500A03F1D /* WXConvertUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
45E0B4C221CB7B9C005D1B3B /* WXConvertUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 453F374B219A76A500A03F1D /* WXConvertUtility.h */; };
591324A31D49B7F1004E89ED /* WXTimerModuleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 591324A21D49B7F1004E89ED /* WXTimerModuleTests.m */; };
591DD3311D23AD5800BE8709 /* WXErrorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 591DD32F1D23AD5800BE8709 /* WXErrorView.m */; };
@@ -354,19 +317,6 @@
841CD1051F974DFA0081196D /* WXExceptionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 841CD1041F97399C0081196D /* WXExceptionUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
841CD1061F974DFA0081196D /* WXExceptionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 841CD1041F97399C0081196D /* WXExceptionUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
841CD1071F974E000081196D /* WXExceptionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 841CD1021F9739890081196D /* WXExceptionUtils.m */; };
- 98399A8B21916A9800D83CCE /* exec_state_section.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A7E21916A9600D83CCE /* exec_state_section.cc */; };
- 98399A8C21916A9800D83CCE /* exec_state_binary.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A7F21916A9600D83CCE /* exec_state_binary.cc */; };
- 98399A8D21916A9800D83CCE /* class_regex.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8021916A9600D83CCE /* class_regex.cc */; };
- 98399A8E21916A9800D83CCE /* exec_state_binary.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8121916A9600D83CCE /* exec_state_binary.h */; };
- 98399A8F21916A9800D83CCE /* class_console.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8221916A9700D83CCE /* class_console.cc */; };
- 98399A9021916A9800D83CCE /* class_window.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8321916A9700D83CCE /* class_window.cc */; };
- 98399A9121916A9800D83CCE /* class_function.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8421916A9700D83CCE /* class_function.cc */; };
- 98399A9221916A9800D83CCE /* class_window.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8521916A9700D83CCE /* class_window.h */; };
- 98399A9321916A9800D83CCE /* class_console.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8621916A9700D83CCE /* class_console.h */; };
- 98399A9421916A9800D83CCE /* class_regex.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8721916A9700D83CCE /* class_regex.h */; };
- 98399A9521916A9800D83CCE /* exec_state_section.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8821916A9700D83CCE /* exec_state_section.h */; };
- 98399A9621916A9800D83CCE /* class_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 98399A8921916A9800D83CCE /* class_function.h */; };
- 98399A9721916A9800D83CCE /* op_code.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98399A8A21916A9800D83CCE /* op_code.cc */; };
9B9E74791FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B9E74781FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m */; };
B82A159820F8556F0098A509 /* WXSDKInstance_performance.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B1221F2090AA9300387E33 /* WXSDKInstance_performance.m */; };
B82A159920F857200098A509 /* WXSDKError.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B122242090AAB000387E33 /* WXSDKError.m */; };
@@ -389,86 +339,6 @@
B89543F620EB18B5006EAD63 /* WXJSCoreBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = B89543EE20EB18B4006EAD63 /* WXJSCoreBridge.mm */; };
B89543F720EB18B5006EAD63 /* WXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B89543EF20EB18B4006EAD63 /* WXCoreBridge.h */; };
B89543F820EB18B5006EAD63 /* WXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B89543EF20EB18B4006EAD63 /* WXCoreBridge.h */; };
- B8A72C9A213F8BAE0024E7BE /* class_json.h in Headers */ = {isa = PBXBuildFile; fileRef = B8A72C96213F8BAD0024E7BE /* class_json.h */; };
- B8A72C9B213F8BAE0024E7BE /* class_json.h in Headers */ = {isa = PBXBuildFile; fileRef = B8A72C96213F8BAD0024E7BE /* class_json.h */; };
- B8A72C9C213F8BAE0024E7BE /* class_string.h in Headers */ = {isa = PBXBuildFile; fileRef = B8A72C97213F8BAD0024E7BE /* class_string.h */; };
- B8A72C9D213F8BAE0024E7BE /* class_string.h in Headers */ = {isa = PBXBuildFile; fileRef = B8A72C97213F8BAD0024E7BE /* class_string.h */; };
- B8A72C9E213F8BAE0024E7BE /* class_json.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A72C98213F8BAD0024E7BE /* class_json.cc */; };
- B8A72C9F213F8BAE0024E7BE /* class_json.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A72C98213F8BAD0024E7BE /* class_json.cc */; };
- B8A72CA0213F8BAE0024E7BE /* class_string.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A72C99213F8BAD0024E7BE /* class_string.cc */; };
- B8A72CA1213F8BAE0024E7BE /* class_string.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A72C99213F8BAD0024E7BE /* class_string.cc */; };
- B8D66BA72125572F003960BD /* string_table.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AEE2125572F003960BD /* string_table.cc */; };
- B8D66BA82125572F003960BD /* string_table.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AEE2125572F003960BD /* string_table.cc */; };
- B8D66BA92125572F003960BD /* table.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AEF2125572F003960BD /* table.cc */; };
- B8D66BAA2125572F003960BD /* table.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AEF2125572F003960BD /* table.cc */; };
- B8D66BAB2125572F003960BD /* code_generator.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF02125572F003960BD /* code_generator.h */; };
- B8D66BAC2125572F003960BD /* code_generator.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF02125572F003960BD /* code_generator.h */; };
- B8D66BAD2125572F003960BD /* code_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF12125572F003960BD /* code_generator.cc */; };
- B8D66BAE2125572F003960BD /* code_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF12125572F003960BD /* code_generator.cc */; };
- B8D66BAF2125572F003960BD /* ast_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF22125572F003960BD /* ast_factory.cc */; };
- B8D66BB02125572F003960BD /* ast_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF22125572F003960BD /* ast_factory.cc */; };
- B8D66BB12125572F003960BD /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF32125572F003960BD /* parser.h */; };
- B8D66BB22125572F003960BD /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF32125572F003960BD /* parser.h */; };
- B8D66BB32125572F003960BD /* parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF42125572F003960BD /* parser.cc */; };
- B8D66BB42125572F003960BD /* parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF42125572F003960BD /* parser.cc */; };
- B8D66BB52125572F003960BD /* vnode.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF62125572F003960BD /* vnode.h */; };
- B8D66BB62125572F003960BD /* vnode.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AF62125572F003960BD /* vnode.h */; };
- B8D66BB72125572F003960BD /* vnode_exec_env.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF72125572F003960BD /* vnode_exec_env.cc */; };
- B8D66BB82125572F003960BD /* vnode_exec_env.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF72125572F003960BD /* vnode_exec_env.cc */; };
- B8D66BB92125572F003960BD /* vnode.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF82125572F003960BD /* vnode.cc */; };
- B8D66BBA2125572F003960BD /* vnode.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF82125572F003960BD /* vnode.cc */; };
- B8D66BBB2125572F003960BD /* vnode_render_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF92125572F003960BD /* vnode_render_context.cc */; };
- B8D66BBC2125572F003960BD /* vnode_render_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AF92125572F003960BD /* vnode_render_context.cc */; };
- B8D66BBD2125572F003960BD /* vnode_exec_env.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFA2125572F003960BD /* vnode_exec_env.h */; };
- B8D66BBE2125572F003960BD /* vnode_exec_env.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFA2125572F003960BD /* vnode_exec_env.h */; };
- B8D66BBF2125572F003960BD /* vnode_render_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AFB2125572F003960BD /* vnode_render_manager.cc */; };
- B8D66BC02125572F003960BD /* vnode_render_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AFB2125572F003960BD /* vnode_render_manager.cc */; };
- B8D66BC12125572F003960BD /* vnode_render_manager.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFC2125572F003960BD /* vnode_render_manager.h */; };
- B8D66BC22125572F003960BD /* vnode_render_manager.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFC2125572F003960BD /* vnode_render_manager.h */; };
- B8D66BC32125572F003960BD /* vnode_render_context.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFD2125572F003960BD /* vnode_render_context.h */; };
- B8D66BC42125572F003960BD /* vnode_render_context.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFD2125572F003960BD /* vnode_render_context.h */; };
- B8D66BC52125572F003960BD /* tokenizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AFE2125572F003960BD /* tokenizer.cc */; };
- B8D66BC62125572F003960BD /* tokenizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66AFE2125572F003960BD /* tokenizer.cc */; };
- B8D66BC72125572F003960BD /* ast_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFF2125572F003960BD /* ast_factory.h */; };
- B8D66BC82125572F003960BD /* ast_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66AFF2125572F003960BD /* ast_factory.h */; };
- B8D66BC92125572F003960BD /* ast.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B002125572F003960BD /* ast.cc */; };
- B8D66BCA2125572F003960BD /* ast.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B002125572F003960BD /* ast.cc */; };
- B8D66BCD2125572F003960BD /* statement.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B022125572F003960BD /* statement.h */; };
- B8D66BCE2125572F003960BD /* statement.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B022125572F003960BD /* statement.h */; };
- B8D66BCF2125572F003960BD /* tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B032125572F003960BD /* tokenizer.h */; };
- B8D66BD02125572F003960BD /* tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B032125572F003960BD /* tokenizer.h */; };
- B8D66BD12125572F003960BD /* statement.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B042125572F003960BD /* statement.cc */; };
- B8D66BD22125572F003960BD /* statement.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B042125572F003960BD /* statement.cc */; };
- B8D66BD32125572F003960BD /* vm.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B052125572F003960BD /* vm.cc */; };
- B8D66BD42125572F003960BD /* vm.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B052125572F003960BD /* vm.cc */; };
- B8D66BD52125572F003960BD /* string_table.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B062125572F003960BD /* string_table.h */; };
- B8D66BD62125572F003960BD /* string_table.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B062125572F003960BD /* string_table.h */; };
- B8D66BD72125572F003960BD /* ast.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B072125572F003960BD /* ast.h */; };
- B8D66BD82125572F003960BD /* ast.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B072125572F003960BD /* ast.h */; };
- B8D66BDD2125572F003960BD /* scanner.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0A2125572F003960BD /* scanner.h */; };
- B8D66BDE2125572F003960BD /* scanner.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0A2125572F003960BD /* scanner.h */; };
- B8D66BE12125572F003960BD /* handle.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0C2125572F003960BD /* handle.h */; };
- B8D66BE22125572F003960BD /* handle.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0C2125572F003960BD /* handle.h */; };
- B8D66BE32125572F003960BD /* exec_state.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0D2125572F003960BD /* exec_state.h */; };
- B8D66BE42125572F003960BD /* exec_state.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0D2125572F003960BD /* exec_state.h */; };
- B8D66BE52125572F003960BD /* object.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0E2125572F003960BD /* object.h */; };
- B8D66BE62125572F003960BD /* object.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0E2125572F003960BD /* object.h */; };
- B8D66BE72125572F003960BD /* table.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0F2125572F003960BD /* table.h */; };
- B8D66BE82125572F003960BD /* table.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B0F2125572F003960BD /* table.h */; };
- B8D66BEB2125572F003960BD /* token.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B112125572F003960BD /* token.h */; };
- B8D66BEC2125572F003960BD /* token.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B112125572F003960BD /* token.h */; };
- B8D66BED2125572F003960BD /* vm.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B122125572F003960BD /* vm.h */; };
- B8D66BEE2125572F003960BD /* vm.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B122125572F003960BD /* vm.h */; };
- B8D66BEF2125572F003960BD /* op_code.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B132125572F003960BD /* op_code.h */; };
- B8D66BF02125572F003960BD /* op_code.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B132125572F003960BD /* op_code.h */; };
- B8D66BF12125572F003960BD /* ast_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B142125572F003960BD /* ast_visitor.h */; };
- B8D66BF22125572F003960BD /* ast_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B142125572F003960BD /* ast_visitor.h */; };
- B8D66BF32125572F003960BD /* object.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B152125572F003960BD /* object.cc */; };
- B8D66BF42125572F003960BD /* object.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B152125572F003960BD /* object.cc */; };
- B8D66BF52125572F003960BD /* token.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B162125572F003960BD /* token.cc */; };
- B8D66BF62125572F003960BD /* token.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B162125572F003960BD /* token.cc */; };
- B8D66BF92125572F003960BD /* exec_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B182125572F003960BD /* exec_state.cc */; };
- B8D66BFA2125572F003960BD /* exec_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B182125572F003960BD /* exec_state.cc */; };
B8D66BFB2125572F003960BD /* render_performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B1A2125572F003960BD /* render_performance.cpp */; };
B8D66BFC2125572F003960BD /* render_performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B8D66B1A2125572F003960BD /* render_performance.cpp */; };
B8D66BFD2125572F003960BD /* render_performance.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B1B2125572F003960BD /* render_performance.h */; };
@@ -650,60 +520,15 @@
B8D66CBD21255730003960BD /* closure.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B8E2125572F003960BD /* closure.h */; };
B8D66CBE21255730003960BD /* closure.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D66B8E2125572F003960BD /* closure.h */; };
B8D66CEB21255B2A003960BD /* WXWebSocketLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F012841E150307003378D0 /* WXWebSocketLoader.h */; };
- B8F2C6E42133A83C00635B37 /* rax_source_locator.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CD2133A83900635B37 /* rax_source_locator.h */; };
- B8F2C6E52133A83C00635B37 /* rax_source_locator.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CD2133A83900635B37 /* rax_source_locator.h */; };
- B8F2C6E62133A83C00635B37 /* common_error.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CE2133A83A00635B37 /* common_error.h */; };
- B8F2C6E72133A83C00635B37 /* common_error.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CE2133A83A00635B37 /* common_error.h */; };
- B8F2C6E82133A83C00635B37 /* class_array.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CF2133A83A00635B37 /* class_array.h */; };
- B8F2C6E92133A83C00635B37 /* class_array.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6CF2133A83A00635B37 /* class_array.h */; };
- B8F2C6EA2133A83C00635B37 /* rax_source_locator.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D02133A83A00635B37 /* rax_source_locator.cc */; };
- B8F2C6EB2133A83C00635B37 /* rax_source_locator.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D02133A83A00635B37 /* rax_source_locator.cc */; };
- B8F2C6EC2133A83C00635B37 /* rax_jsx_ast.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D12133A83A00635B37 /* rax_jsx_ast.h */; };
- B8F2C6ED2133A83C00635B37 /* rax_jsx_ast.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D12133A83A00635B37 /* rax_jsx_ast.h */; };
- B8F2C6EE2133A83C00635B37 /* class.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D22133A83A00635B37 /* class.h */; };
- B8F2C6EF2133A83C00635B37 /* class.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D22133A83A00635B37 /* class.h */; };
- B8F2C6F02133A83C00635B37 /* rax_jsx_ast.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D32133A83A00635B37 /* rax_jsx_ast.cc */; };
- B8F2C6F12133A83C00635B37 /* rax_jsx_ast.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D32133A83A00635B37 /* rax_jsx_ast.cc */; };
- B8F2C6F22133A83C00635B37 /* class_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D42133A83A00635B37 /* class_factory.cc */; };
- B8F2C6F32133A83C00635B37 /* class_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D42133A83A00635B37 /* class_factory.cc */; };
- B8F2C6F42133A83C00635B37 /* rax_parser_statistics.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D52133A83A00635B37 /* rax_parser_statistics.cc */; };
- B8F2C6F52133A83C00635B37 /* rax_parser_statistics.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D52133A83A00635B37 /* rax_parser_statistics.cc */; };
- B8F2C6F62133A83C00635B37 /* rax_parser_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D62133A83B00635B37 /* rax_parser_context.cc */; };
- B8F2C6F72133A83C00635B37 /* rax_parser_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D62133A83B00635B37 /* rax_parser_context.cc */; };
- B8F2C6F82133A83C00635B37 /* class.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D72133A83B00635B37 /* class.cc */; };
- B8F2C6F92133A83C00635B37 /* class.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D72133A83B00635B37 /* class.cc */; };
- B8F2C6FA2133A83C00635B37 /* class_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D82133A83B00635B37 /* class_factory.h */; };
- B8F2C6FB2133A83C00635B37 /* class_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6D82133A83B00635B37 /* class_factory.h */; };
- B8F2C6FC2133A83C00635B37 /* rax_parser_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D92133A83B00635B37 /* rax_parser_builder.cc */; };
- B8F2C6FD2133A83C00635B37 /* rax_parser_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6D92133A83B00635B37 /* rax_parser_builder.cc */; };
- B8F2C6FE2133A83C00635B37 /* rax_parser_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DA2133A83B00635B37 /* rax_parser_builder.h */; };
- B8F2C6FF2133A83C00635B37 /* rax_parser_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DA2133A83B00635B37 /* rax_parser_builder.h */; };
- B8F2C7002133A83C00635B37 /* ast_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DB2133A83B00635B37 /* ast_builder.h */; };
- B8F2C7012133A83C00635B37 /* ast_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DB2133A83B00635B37 /* ast_builder.h */; };
- B8F2C7022133A83C00635B37 /* rax_parser_scope.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DC2133A83B00635B37 /* rax_parser_scope.h */; };
- B8F2C7032133A83C00635B37 /* rax_parser_scope.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DC2133A83B00635B37 /* rax_parser_scope.h */; };
- B8F2C7042133A83C00635B37 /* class_array.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6DD2133A83B00635B37 /* class_array.cc */; };
- B8F2C7052133A83C00635B37 /* class_array.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6DD2133A83B00635B37 /* class_array.cc */; };
- B8F2C7062133A83C00635B37 /* rax_parser_scope.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6DE2133A83B00635B37 /* rax_parser_scope.cc */; };
- B8F2C7072133A83C00635B37 /* rax_parser_scope.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6DE2133A83B00635B37 /* rax_parser_scope.cc */; };
- B8F2C7082133A83C00635B37 /* rax_parser_context.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DF2133A83B00635B37 /* rax_parser_context.h */; };
- B8F2C7092133A83C00635B37 /* rax_parser_context.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6DF2133A83B00635B37 /* rax_parser_context.h */; };
- B8F2C70A2133A83C00635B37 /* rax_parser_statistics.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6E02133A83B00635B37 /* rax_parser_statistics.h */; };
- B8F2C70B2133A83C00635B37 /* rax_parser_statistics.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6E02133A83B00635B37 /* rax_parser_statistics.h */; };
- B8F2C70C2133A83C00635B37 /* rax_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6E12133A83C00635B37 /* rax_parser.cc */; };
- B8F2C70D2133A83C00635B37 /* rax_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6E12133A83C00635B37 /* rax_parser.cc */; };
- B8F2C70E2133A83C00635B37 /* rax_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6E22133A83C00635B37 /* rax_parser.h */; };
- B8F2C70F2133A83C00635B37 /* rax_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C6E22133A83C00635B37 /* rax_parser.h */; };
- B8F2C7102133A83C00635B37 /* ast_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6E32133A83C00635B37 /* ast_builder.cc */; };
- B8F2C7112133A83C00635B37 /* ast_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8F2C6E32133A83C00635B37 /* ast_builder.cc */; };
- B8F2C7142133A8BC00635B37 /* vm_monitor.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C7132133A8BC00635B37 /* vm_monitor.h */; };
- B8F2C7152133A8BC00635B37 /* vm_monitor.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F2C7132133A8BC00635B37 /* vm_monitor.h */; };
B8F3323C2141A4C600701BA0 /* string_util.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F3323B2141A4C500701BA0 /* string_util.h */; };
B8F3323D2141A4C600701BA0 /* string_util.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F3323B2141A4C500701BA0 /* string_util.h */; };
BA5F00F11FC5AFFE00F76B5C /* WXLocaleModule.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */; };
BA5F00F21FC5AFFE00F76B5C /* WXLocaleModule.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */; };
BA5F00F31FC6834900F76B5C /* WXLocaleModule.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */; };
BA5F00F41FC6834C00F76B5C /* WXLocaleModule.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */; };
+ BD9205F82236518700EDF93D /* WXDataRenderHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9205F72236518700EDF93D /* WXDataRenderHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ BD9205FB223651D900EDF93D /* eagle_bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9205F9223651D800EDF93D /* eagle_bridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ BD9205FC223651D900EDF93D /* eagle_bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD9205FA223651D800EDF93D /* eagle_bridge.cpp */; };
C401945E1E344E8300D19C31 /* WXFloatCompareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C401945D1E344E8300D19C31 /* WXFloatCompareTests.m */; };
C41E1A971DC1FD15009C7F90 /* WXDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C41E1A951DC1FD15009C7F90 /* WXDatePickerManager.h */; };
C41E1A981DC1FD15009C7F90 /* WXDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C41E1A961DC1FD15009C7F90 /* WXDatePickerManager.m */; };
@@ -969,7 +794,7 @@
DCA4460D1EFA5A7900D0CFA8 /* WXThreadSafeMutableArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7461F8A61CFC33A800F62D44 /* WXThreadSafeMutableArray.h */; };
DCA4460E1EFA5A7E00D0CFA8 /* WXLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 747DF6801E31AEE4005C53A8 /* WXLength.h */; };
DCA4460F1EFA5A8100D0CFA8 /* WXDiffUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 744D61121E4AF23E00B624B3 /* WXDiffUtil.h */; };
- DCA446101EFA5A8500D0CFA8 /* WXBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A919DA41E321F1F006EB6B5 /* WXBridgeMethod.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DCA446101EFA5A8500D0CFA8 /* WXBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A919DA41E321F1F006EB6B5 /* WXBridgeMethod.h */; };
DCA446111EFA5A8800D0CFA8 /* WXModuleMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 74862F7B1E03A0F300B7A041 /* WXModuleMethod.h */; };
DCA446121EFA5A8A00D0CFA8 /* WXComponentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 74862F7F1E03A24500B7A041 /* WXComponentMethod.h */; };
DCA446131EFA5A8C00D0CFA8 /* WXCallJSMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 74D2051E1E091B8000128F44 /* WXCallJSMethod.h */; };
@@ -978,11 +803,11 @@
DCA446171EFA5A9900D0CFA8 /* WXPolyfillSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AD99821D5B0E59008F0336 /* WXPolyfillSet.h */; };
DCA446181EFA5A9B00D0CFA8 /* JSValue+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = 74862F771E02B88D00B7A041 /* JSValue+Weex.h */; };
DCA446191EFA5A9E00D0CFA8 /* WXServiceFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 740451E81E14BB26004157CB /* WXServiceFactory.h */; };
- DCA4461A1EFA5AA000D0CFA8 /* WXInvocationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF0875F1DCAE161005CD6EB /* WXInvocationConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DCA4461A1EFA5AA000D0CFA8 /* WXInvocationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF0875F1DCAE161005CD6EB /* WXInvocationConfig.h */; };
DCA4461B1EFA5AA200D0CFA8 /* WXDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C41E1A951DC1FD15009C7F90 /* WXDatePickerManager.h */; };
DCA4461C1EFA5AA600D0CFA8 /* WXModuleFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E659EF1C0C3612008B8775 /* WXModuleFactory.h */; };
DCA4461D1EFA5AAA00D0CFA8 /* WXHandlerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA9C1CB3C0A100195969 /* WXHandlerFactory.h */; };
- DCA4461E1EFA5AAF00D0CFA8 /* WXComponentFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 741081211CED6756001BC6E5 /* WXComponentFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DCA4461E1EFA5AAF00D0CFA8 /* WXComponentFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 741081211CED6756001BC6E5 /* WXComponentFactory.h */; };
DCA4461F1EFA5AB100D0CFA8 /* WXRuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DCAB35FC1D658EB700C0EA70 /* WXRuleManager.h */; };
DCA446201EFA5AB800D0CFA8 /* WXComponent+Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5961A1CB630F10012CD52 /* WXComponent+Navigation.h */; };
DCA446211EFA5ABA00D0CFA8 /* WXSDKInstance_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 748B25161C44A6F9005D491E /* WXSDKInstance_private.h */; };
@@ -1089,12 +914,8 @@
33CE19122153444900CF9670 /* WXJSFrameworkLoadProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXJSFrameworkLoadProtocol.h; sourceTree = "<group>"; };
37B51EE21E97804D0040A743 /* WXCycleSliderComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXCycleSliderComponent.h; sourceTree = "<group>"; };
37B51EE31E97804D0040A743 /* WXCycleSliderComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXCycleSliderComponent.mm; sourceTree = "<group>"; };
- 4505D119219B1F710083A1A2 /* class_math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_math.h; sourceTree = "<group>"; };
- 4505D11A219B1F710083A1A2 /* class_math.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_math.cc; sourceTree = "<group>"; };
45326708213FC84900DAA620 /* WXDisplayLinkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDisplayLinkManager.h; sourceTree = "<group>"; };
45326709213FC84900DAA620 /* WXDisplayLinkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDisplayLinkManager.m; sourceTree = "<group>"; };
- 453267122140E38900DAA620 /* vcomponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vcomponent.h; sourceTree = "<group>"; };
- 453267132140E38900DAA620 /* vcomponent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vcomponent.cc; sourceTree = "<group>"; };
453F374B219A76A500A03F1D /* WXConvertUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXConvertUtility.h; sourceTree = "<group>"; };
453F374C219A76A500A03F1D /* WXConvertUtility.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXConvertUtility.mm; sourceTree = "<group>"; };
453F3750219A76CA00A03F1D /* default_request_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_request_handler.h; sourceTree = "<group>"; };
@@ -1102,14 +923,6 @@
453F3753219A76CA00A03F1D /* default_request_handler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = default_request_handler.mm; sourceTree = "<group>"; };
453F3754219A76CA00A03F1D /* request_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = request_handler.h; sourceTree = "<group>"; };
453F3755219A76CA00A03F1D /* http_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = http_module.h; sourceTree = "<group>"; };
- 453F375C219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = vcomponent_lifecycle_listener.mm; sourceTree = "<group>"; };
- 453F375D219A76FA00A03F1D /* vnode_on_event_listener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = vnode_on_event_listener.mm; sourceTree = "<group>"; };
- 453F3760219A770900A03F1D /* vcomponent_lifecycle_listener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vcomponent_lifecycle_listener.h; sourceTree = "<group>"; };
- 453F3761219A770900A03F1D /* vnode_on_event_listener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vnode_on_event_listener.h; sourceTree = "<group>"; };
- 4547FCFF2152048600E79971 /* class_object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_object.cc; sourceTree = "<group>"; };
- 4547FD002152048600E79971 /* class_object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_object.h; sourceTree = "<group>"; };
- 4547FD0B215392F900E79971 /* js_common_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_common_function.h; sourceTree = "<group>"; };
- 4547FD0C215392F900E79971 /* js_common_function.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_common_function.cc; sourceTree = "<group>"; };
591324A21D49B7F1004E89ED /* WXTimerModuleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTimerModuleTests.m; sourceTree = "<group>"; };
591DD32F1D23AD5800BE8709 /* WXErrorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXErrorView.m; sourceTree = "<group>"; };
591DD3301D23AD5800BE8709 /* WXErrorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXErrorView.h; sourceTree = "<group>"; };
@@ -1320,19 +1133,6 @@
77E65A181C155F25008B8775 /* WXScrollerComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXScrollerComponent.mm; sourceTree = "<group>"; };
841CD1021F9739890081196D /* WXExceptionUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXExceptionUtils.m; sourceTree = "<group>"; };
841CD1041F97399C0081196D /* WXExceptionUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXExceptionUtils.h; sourceTree = "<group>"; };
- 98399A7E21916A9600D83CCE /* exec_state_section.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec_state_section.cc; sourceTree = "<group>"; };
- 98399A7F21916A9600D83CCE /* exec_state_binary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec_state_binary.cc; sourceTree = "<group>"; };
- 98399A8021916A9600D83CCE /* class_regex.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_regex.cc; sourceTree = "<group>"; };
- 98399A8121916A9600D83CCE /* exec_state_binary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec_state_binary.h; sourceTree = "<group>"; };
- 98399A8221916A9700D83CCE /* class_console.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_console.cc; sourceTree = "<group>"; };
- 98399A8321916A9700D83CCE /* class_window.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_window.cc; sourceTree = "<group>"; };
- 98399A8421916A9700D83CCE /* class_function.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_function.cc; sourceTree = "<group>"; };
- 98399A8521916A9700D83CCE /* class_window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_window.h; sourceTree = "<group>"; };
- 98399A8621916A9700D83CCE /* class_console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_console.h; sourceTree = "<group>"; };
- 98399A8721916A9700D83CCE /* class_regex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_regex.h; sourceTree = "<group>"; };
- 98399A8821916A9700D83CCE /* exec_state_section.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec_state_section.h; sourceTree = "<group>"; };
- 98399A8921916A9800D83CCE /* class_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_function.h; sourceTree = "<group>"; };
- 98399A8A21916A9800D83CCE /* op_code.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = op_code.cc; sourceTree = "<group>"; };
9B9E74771FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTestBridgeMethodDummy.h; sourceTree = "<group>"; };
9B9E74781FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTestBridgeMethodDummy.m; sourceTree = "<group>"; };
B8394F3521468AF100CA1EFF /* render_action_trigger_vsync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render_action_trigger_vsync.h; sourceTree = "<group>"; };
@@ -1343,46 +1143,6 @@
B89543ED20EB18B4006EAD63 /* WXCoreBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXCoreBridge.mm; sourceTree = "<group>"; };
B89543EE20EB18B4006EAD63 /* WXJSCoreBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXJSCoreBridge.mm; sourceTree = "<group>"; };
B89543EF20EB18B4006EAD63 /* WXCoreBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXCoreBridge.h; sourceTree = "<group>"; };
- B8A72C96213F8BAD0024E7BE /* class_json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_json.h; sourceTree = "<group>"; };
- B8A72C97213F8BAD0024E7BE /* class_string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_string.h; sourceTree = "<group>"; };
- B8A72C98213F8BAD0024E7BE /* class_json.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_json.cc; sourceTree = "<group>"; };
- B8A72C99213F8BAD0024E7BE /* class_string.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_string.cc; sourceTree = "<group>"; };
- B8D66AEE2125572F003960BD /* string_table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string_table.cc; sourceTree = "<group>"; };
- B8D66AEF2125572F003960BD /* table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = table.cc; sourceTree = "<group>"; };
- B8D66AF02125572F003960BD /* code_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = code_generator.h; sourceTree = "<group>"; };
- B8D66AF12125572F003960BD /* code_generator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = code_generator.cc; sourceTree = "<group>"; };
- B8D66AF22125572F003960BD /* ast_factory.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ast_factory.cc; sourceTree = "<group>"; };
- B8D66AF32125572F003960BD /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = "<group>"; };
- B8D66AF42125572F003960BD /* parser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser.cc; sourceTree = "<group>"; };
- B8D66AF62125572F003960BD /* vnode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vnode.h; sourceTree = "<group>"; };
- B8D66AF72125572F003960BD /* vnode_exec_env.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vnode_exec_env.cc; sourceTree = "<group>"; };
- B8D66AF82125572F003960BD /* vnode.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vnode.cc; sourceTree = "<group>"; };
- B8D66AF92125572F003960BD /* vnode_render_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vnode_render_context.cc; sourceTree = "<group>"; };
- B8D66AFA2125572F003960BD /* vnode_exec_env.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vnode_exec_env.h; sourceTree = "<group>"; };
- B8D66AFB2125572F003960BD /* vnode_render_manager.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vnode_render_manager.cc; sourceTree = "<group>"; };
- B8D66AFC2125572F003960BD /* vnode_render_manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vnode_render_manager.h; sourceTree = "<group>"; };
- B8D66AFD2125572F003960BD /* vnode_render_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vnode_render_context.h; sourceTree = "<group>"; };
- B8D66AFE2125572F003960BD /* tokenizer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tokenizer.cc; sourceTree = "<group>"; };
- B8D66AFF2125572F003960BD /* ast_factory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ast_factory.h; sourceTree = "<group>"; };
- B8D66B002125572F003960BD /* ast.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ast.cc; sourceTree = "<group>"; };
- B8D66B022125572F003960BD /* statement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = statement.h; sourceTree = "<group>"; };
- B8D66B032125572F003960BD /* tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tokenizer.h; sourceTree = "<group>"; };
- B8D66B042125572F003960BD /* statement.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = statement.cc; sourceTree = "<group>"; };
- B8D66B052125572F003960BD /* vm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vm.cc; sourceTree = "<group>"; };
- B8D66B062125572F003960BD /* string_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string_table.h; sourceTree = "<group>"; };
- B8D66B072125572F003960BD /* ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ast.h; sourceTree = "<group>"; };
- B8D66B0A2125572F003960BD /* scanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scanner.h; sourceTree = "<group>"; };
- B8D66B0C2125572F003960BD /* handle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = handle.h; sourceTree = "<group>"; };
- B8D66B0D2125572F003960BD /* exec_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec_state.h; sourceTree = "<group>"; };
- B8D66B0E2125572F003960BD /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = "<group>"; };
- B8D66B0F2125572F003960BD /* table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = table.h; sourceTree = "<group>"; };
- B8D66B112125572F003960BD /* token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = token.h; sourceTree = "<group>"; };
- B8D66B122125572F003960BD /* vm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm.h; sourceTree = "<group>"; };
- B8D66B132125572F003960BD /* op_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_code.h; sourceTree = "<group>"; };
- B8D66B142125572F003960BD /* ast_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ast_visitor.h; sourceTree = "<group>"; };
- B8D66B152125572F003960BD /* object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cc; sourceTree = "<group>"; };
- B8D66B162125572F003960BD /* token.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = token.cc; sourceTree = "<group>"; };
- B8D66B182125572F003960BD /* exec_state.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec_state.cc; sourceTree = "<group>"; };
B8D66B1A2125572F003960BD /* render_performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = render_performance.cpp; sourceTree = "<group>"; };
B8D66B1B2125572F003960BD /* render_performance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render_performance.h; sourceTree = "<group>"; };
B8D66B1D2125572F003960BD /* constants_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = constants_name.h; sourceTree = "<group>"; };
@@ -1473,33 +1233,12 @@
B8D66B892125572F003960BD /* make_copyable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = make_copyable.h; sourceTree = "<group>"; };
B8D66B8B2125572F003960BD /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
B8D66B8E2125572F003960BD /* closure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = closure.h; sourceTree = "<group>"; };
- B8F2C6CD2133A83900635B37 /* rax_source_locator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_source_locator.h; sourceTree = "<group>"; };
- B8F2C6CE2133A83A00635B37 /* common_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common_error.h; sourceTree = "<group>"; };
- B8F2C6CF2133A83A00635B37 /* class_array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_array.h; sourceTree = "<group>"; };
- B8F2C6D02133A83A00635B37 /* rax_source_locator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_source_locator.cc; sourceTree = "<group>"; };
- B8F2C6D12133A83A00635B37 /* rax_jsx_ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_jsx_ast.h; sourceTree = "<group>"; };
- B8F2C6D22133A83A00635B37 /* class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class.h; sourceTree = "<group>"; };
- B8F2C6D32133A83A00635B37 /* rax_jsx_ast.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_jsx_ast.cc; sourceTree = "<group>"; };
- B8F2C6D42133A83A00635B37 /* class_factory.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_factory.cc; sourceTree = "<group>"; };
- B8F2C6D52133A83A00635B37 /* rax_parser_statistics.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_parser_statistics.cc; sourceTree = "<group>"; };
- B8F2C6D62133A83B00635B37 /* rax_parser_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_parser_context.cc; sourceTree = "<group>"; };
- B8F2C6D72133A83B00635B37 /* class.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class.cc; sourceTree = "<group>"; };
- B8F2C6D82133A83B00635B37 /* class_factory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_factory.h; sourceTree = "<group>"; };
- B8F2C6D92133A83B00635B37 /* rax_parser_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_parser_builder.cc; sourceTree = "<group>"; };
- B8F2C6DA2133A83B00635B37 /* rax_parser_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_parser_builder.h; sourceTree = "<group>"; };
- B8F2C6DB2133A83B00635B37 /* ast_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ast_builder.h; sourceTree = "<group>"; };
- B8F2C6DC2133A83B00635B37 /* rax_parser_scope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_parser_scope.h; sourceTree = "<group>"; };
- B8F2C6DD2133A83B00635B37 /* class_array.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_array.cc; sourceTree = "<group>"; };
- B8F2C6DE2133A83B00635B37 /* rax_parser_scope.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_parser_scope.cc; sourceTree = "<group>"; };
- B8F2C6DF2133A83B00635B37 /* rax_parser_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_parser_context.h; sourceTree = "<group>"; };
- B8F2C6E02133A83B00635B37 /* rax_parser_statistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_parser_statistics.h; sourceTree = "<group>"; };
- B8F2C6E12133A83C00635B37 /* rax_parser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rax_parser.cc; sourceTree = "<group>"; };
- B8F2C6E22133A83C00635B37 /* rax_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rax_parser.h; sourceTree = "<group>"; };
- B8F2C6E32133A83C00635B37 /* ast_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ast_builder.cc; sourceTree = "<group>"; };
- B8F2C7132133A8BC00635B37 /* vm_monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_monitor.h; sourceTree = "<group>"; };
B8F3323B2141A4C500701BA0 /* string_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string_util.h; sourceTree = "<group>"; };
BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXLocaleModule.h; sourceTree = "<group>"; };
BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WXLocaleModule.m; sourceTree = "<group>"; };
+ BD9205F72236518700EDF93D /* WXDataRenderHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDataRenderHandler.h; sourceTree = "<group>"; };
+ BD9205F9223651D800EDF93D /* eagle_bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eagle_bridge.h; sourceTree = "<group>"; };
+ BD9205FA223651D800EDF93D /* eagle_bridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eagle_bridge.cpp; sourceTree = "<group>"; };
C401945D1E344E8300D19C31 /* WXFloatCompareTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXFloatCompareTests.m; sourceTree = "<group>"; };
C41E1A951DC1FD15009C7F90 /* WXDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDatePickerManager.h; sourceTree = "<group>"; };
C41E1A961DC1FD15009C7F90 /* WXDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDatePickerManager.m; sourceTree = "<group>"; };
@@ -1659,15 +1398,6 @@
path = ios;
sourceTree = "<group>";
};
- 453F375B219A76FA00A03F1D /* ios */ = {
- isa = PBXGroup;
- children = (
- 453F375C219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm */,
- 453F375D219A76FA00A03F1D /* vnode_on_event_listener.mm */,
- );
- path = ios;
- sourceTree = "<group>";
- };
59A583031CF5B2FD0081FD3E /* Handler */ = {
isa = PBXGroup;
children = (
@@ -1940,6 +1670,7 @@
59A583031CF5B2FD0081FD3E /* Handler */,
77E659D71C07F585008B8775 /* Module */,
77D161481C02E3670010B15B /* Utility */,
+ BD9205F62236518700EDF93D /* Eagle */,
77D1611D1C02DDA40010B15B /* Engine */,
77D161191C02DD3C0010B15B /* Bridge */,
77D1611A1C02DD3C0010B15B /* Manager */,
@@ -2249,7 +1980,6 @@
isa = PBXGroup;
children = (
453F374F219A76CA00A03F1D /* network */,
- B8D66AED2125572F003960BD /* data_render */,
B8D66B192125572F003960BD /* moniter */,
B8D66B1C2125572F003960BD /* css */,
B8D66B212125572F003960BD /* config */,
@@ -2263,109 +1993,6 @@
path = ../../../../weex_core/Source/core;
sourceTree = "<group>";
};
- B8D66AED2125572F003960BD /* data_render */ = {
- isa = PBXGroup;
- children = (
- B8F2C7122133A8BC00635B37 /* monitor */,
- 98399A8221916A9700D83CCE /* class_console.cc */,
- 98399A8621916A9700D83CCE /* class_console.h */,
- 98399A8421916A9700D83CCE /* class_function.cc */,
- 98399A8921916A9800D83CCE /* class_function.h */,
- 98399A8021916A9600D83CCE /* class_regex.cc */,
- 4505D11A219B1F710083A1A2 /* class_math.cc */,
- 4505D119219B1F710083A1A2 /* class_math.h */,
- 98399A8721916A9700D83CCE /* class_regex.h */,
- 98399A8321916A9700D83CCE /* class_window.cc */,
- 98399A8521916A9700D83CCE /* class_window.h */,
- 98399A7F21916A9600D83CCE /* exec_state_binary.cc */,
- 98399A8121916A9600D83CCE /* exec_state_binary.h */,
- 98399A7E21916A9600D83CCE /* exec_state_section.cc */,
- 98399A8821916A9700D83CCE /* exec_state_section.h */,
- B8F2C6E32133A83C00635B37 /* ast_builder.cc */,
- B8F2C6DB2133A83B00635B37 /* ast_builder.h */,
- B8A72C98213F8BAD0024E7BE /* class_json.cc */,
- 4547FD0C215392F900E79971 /* js_common_function.cc */,
- 4547FD0B215392F900E79971 /* js_common_function.h */,
- B8A72C96213F8BAD0024E7BE /* class_json.h */,
- B8A72C99213F8BAD0024E7BE /* class_string.cc */,
- B8A72C97213F8BAD0024E7BE /* class_string.h */,
- B8F2C6DD2133A83B00635B37 /* class_array.cc */,
- B8F2C6CF2133A83A00635B37 /* class_array.h */,
- 4547FCFF2152048600E79971 /* class_object.cc */,
- 4547FD002152048600E79971 /* class_object.h */,
- B8F2C6D42133A83A00635B37 /* class_factory.cc */,
- B8F2C6D82133A83B00635B37 /* class_factory.h */,
- B8F2C6D72133A83B00635B37 /* class.cc */,
- B8F2C6D22133A83A00635B37 /* class.h */,
- B8F2C6CE2133A83A00635B37 /* common_error.h */,
- B8F2C6D32133A83A00635B37 /* rax_jsx_ast.cc */,
- B8F2C6D12133A83A00635B37 /* rax_jsx_ast.h */,
- B8F2C6D92133A83B00635B37 /* rax_parser_builder.cc */,
- B8F2C6DA2133A83B00635B37 /* rax_parser_builder.h */,
- B8F2C6D62133A83B00635B37 /* rax_parser_context.cc */,
- B8F2C6DF2133A83B00635B37 /* rax_parser_context.h */,
- B8F2C6DE2133A83B00635B37 /* rax_parser_scope.cc */,
- B8F2C6DC2133A83B00635B37 /* rax_parser_scope.h */,
- B8F2C6D52133A83A00635B37 /* rax_parser_statistics.cc */,
- B8F2C6E02133A83B00635B37 /* rax_parser_statistics.h */,
- B8F2C6E12133A83C00635B37 /* rax_parser.cc */,
- B8F2C6E22133A83C00635B37 /* rax_parser.h */,
- B8F2C6D02133A83A00635B37 /* rax_source_locator.cc */,
- B8F2C6CD2133A83900635B37 /* rax_source_locator.h */,
- B8D66AEE2125572F003960BD /* string_table.cc */,
- B8D66AEF2125572F003960BD /* table.cc */,
- B8D66AF02125572F003960BD /* code_generator.h */,
- B8D66AF12125572F003960BD /* code_generator.cc */,
- B8D66AF22125572F003960BD /* ast_factory.cc */,
- B8D66AF32125572F003960BD /* parser.h */,
- B8D66AF42125572F003960BD /* parser.cc */,
- B8D66AF52125572F003960BD /* vnode */,
- B8D66AFE2125572F003960BD /* tokenizer.cc */,
- B8D66AFF2125572F003960BD /* ast_factory.h */,
- B8D66B002125572F003960BD /* ast.cc */,
- B8D66B022125572F003960BD /* statement.h */,
- B8D66B032125572F003960BD /* tokenizer.h */,
- B8D66B042125572F003960BD /* statement.cc */,
- B8D66B052125572F003960BD /* vm.cc */,
- B8D66B062125572F003960BD /* string_table.h */,
- B8D66B072125572F003960BD /* ast.h */,
- B8D66B0A2125572F003960BD /* scanner.h */,
- B8D66B0C2125572F003960BD /* handle.h */,
- B8D66B0D2125572F003960BD /* exec_state.h */,
- B8D66B182125572F003960BD /* exec_state.cc */,
- B8D66B0E2125572F003960BD /* object.h */,
- B8D66B0F2125572F003960BD /* table.h */,
- B8D66B112125572F003960BD /* token.h */,
- B8D66B122125572F003960BD /* vm.h */,
- B8D66B132125572F003960BD /* op_code.h */,
- 98399A8A21916A9800D83CCE /* op_code.cc */,
- B8D66B142125572F003960BD /* ast_visitor.h */,
- B8D66B152125572F003960BD /* object.cc */,
- B8D66B162125572F003960BD /* token.cc */,
- );
- path = data_render;
- sourceTree = "<group>";
- };
- B8D66AF52125572F003960BD /* vnode */ = {
- isa = PBXGroup;
- children = (
- 453F375B219A76FA00A03F1D /* ios */,
- B8D66AF62125572F003960BD /* vnode.h */,
- 453F3760219A770900A03F1D /* vcomponent_lifecycle_listener.h */,
- 453F3761219A770900A03F1D /* vnode_on_event_listener.h */,
- B8D66AF72125572F003960BD /* vnode_exec_env.cc */,
- B8D66AF82125572F003960BD /* vnode.cc */,
- 453267132140E38900DAA620 /* vcomponent.cc */,
- 453267122140E38900DAA620 /* vcomponent.h */,
- B8D66AF92125572F003960BD /* vnode_render_context.cc */,
- B8D66AFA2125572F003960BD /* vnode_exec_env.h */,
- B8D66AFB2125572F003960BD /* vnode_render_manager.cc */,
- B8D66AFC2125572F003960BD /* vnode_render_manager.h */,
- B8D66AFD2125572F003960BD /* vnode_render_context.h */,
- );
- path = vnode;
- sourceTree = "<group>";
- };
B8D66B192125572F003960BD /* moniter */ = {
isa = PBXGroup;
children = (
@@ -2398,6 +2025,8 @@
B8D66B242125572F003960BD /* bridge */ = {
isa = PBXGroup;
children = (
+ BD9205FA223651D800EDF93D /* eagle_bridge.cpp */,
+ BD9205F9223651D800EDF93D /* eagle_bridge.h */,
B8D66B252125572F003960BD /* platform_bridge.h */,
B8D66B262125572F003960BD /* platform */,
B8D66B292125572F003960BD /* script */,
@@ -2614,12 +2243,12 @@
path = ../../../../weex_core/Source/base;
sourceTree = "<group>";
};
- B8F2C7122133A8BC00635B37 /* monitor */ = {
+ BD9205F62236518700EDF93D /* Eagle */ = {
isa = PBXGroup;
children = (
- B8F2C7132133A8BC00635B37 /* vm_monitor.h */,
+ BD9205F72236518700EDF93D /* WXDataRenderHandler.h */,
);
- path = monitor;
+ path = Eagle;
sourceTree = "<group>";
};
C4F012711E1502A6003378D0 /* WebSocket */ = {
@@ -2660,6 +2289,9 @@
2A919DA61E321F1F006EB6B5 /* WXBridgeMethod.h in Headers */,
DCF087611DCAE161005CD6EB /* WXInvocationConfig.h in Headers */,
741081231CED6756001BC6E5 /* WXComponentFactory.h in Headers */,
+ 45E0B4C121CB7B82005D1B3B /* WXConvertUtility.h in Headers */,
+ BD9205FB223651D900EDF93D /* eagle_bridge.h in Headers */,
+ BD9205F82236518700EDF93D /* WXDataRenderHandler.h in Headers */,
7715EB6221A69DD9001F1108 /* WXRichText.h in Headers */,
B8D66C1B21255730003960BD /* style.h in Headers */,
B8D66C2321255730003960BD /* layout.h in Headers */,
@@ -2668,20 +2300,15 @@
7408C48E1CFB345D000BCCD0 /* WXComponent+Events.h in Headers */,
B8D66C8F21255730003960BD /* render_cell_factory.h in Headers */,
B8D66C7521255730003960BD /* render_object.h in Headers */,
- B8D66BC12125572F003960BD /* vnode_render_manager.h in Headers */,
775BEE711C1BD977008D1629 /* WXModuleProtocol.h in Headers */,
- B8F2C70E2133A83C00635B37 /* rax_parser.h in Headers */,
7469869F1C4E2C000054A57E /* NSArray+Weex.h in Headers */,
- B8D66BDD2125572F003960BD /* scanner.h in Headers */,
B8D66C4121255730003960BD /* render_action_add_event.h in Headers */,
74CC7A201C2BF9DC00829368 /* WXListComponent.h in Headers */,
17036A5320FDE7490029AE3D /* WXApmProtocol.h in Headers */,
7423EB511F4ADE30001662D1 /* WXComponent+DataBinding.h in Headers */,
74FD6E041C7C0E9600DBEB6D /* WXScrollerProtocol.h in Headers */,
74CFDD3D1F459400007A1A66 /* WXRecycleListDataManager.h in Headers */,
- B8D66BE52125572F003960BD /* object.h in Headers */,
77D161201C02DDB40010B15B /* WXSDKEngine.h in Headers */,
- B8A72C9C213F8BAE0024E7BE /* class_string.h in Headers */,
745ED2DA1C5F2C7E002DB5A8 /* WXView.h in Headers */,
B8F3323C2141A4C600701BA0 /* string_util.h in Headers */,
17B122252090AAB000387E33 /* WXSDKError.h in Headers */,
@@ -2696,33 +2323,26 @@
59A5961C1CB630F10012CD52 /* WXComponent+Navigation.h in Headers */,
B8D66C3D21255730003960BD /* render_action_createfinish.h in Headers */,
775BEE6E1C1BD8F4008D1629 /* WXImgLoaderProtocol.h in Headers */,
- 98399A8E21916A9800D83CCE /* exec_state_binary.h in Headers */,
B8D66C1321255730003960BD /* core_side_in_script.h in Headers */,
7410811F1CED585A001BC6E5 /* WXComponentManager.h in Headers */,
B8D66C8521255730003960BD /* render_appbar_factory.h in Headers */,
74CFDD411F45941E007A1A66 /* WXRecycleListTemplateManager.h in Headers */,
- B8F2C7002133A83C00635B37 /* ast_builder.h in Headers */,
1D3000F11D40B9AC004F3B4F /* WXClipboardModule.h in Headers */,
59A583081CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h in Headers */,
17B122222090AA9300387E33 /* WXSDKInstance_performance.h in Headers */,
775BEE4E1C16F993008D1629 /* WXDefine.h in Headers */,
- B8D66BE12125572F003960BD /* handle.h in Headers */,
- B8D66BCD2125572F003960BD /* statement.h in Headers */,
77D161241C02DDD10010B15B /* WXSDKInstance.h in Headers */,
DC6836E61EBB12B200AD2D84 /* WXConfigCenterProtocol.h in Headers */,
DC7764941F3C2CA300B5727E /* WXRecyclerDragController.h in Headers */,
- 98399A9221916A9800D83CCE /* class_window.h in Headers */,
74A4BAA61CB4F98300195969 /* WXStreamModule.h in Headers */,
B8D66CB321255730003960BD /* make_copyable.h in Headers */,
740451EA1E14BB26004157CB /* WXServiceFactory.h in Headers */,
744BEA591D0520F300452B5D /* WXComponent+Layout.h in Headers */,
B8D66C3121255730003960BD /* render_action_appendtree_createfinish.h in Headers */,
- B8F2C6EE2133A83C00635B37 /* class.h in Headers */,
B8D66C7F21255730003960BD /* render_scroller_factory.h in Headers */,
4532670A213FC84A00DAA620 /* WXDisplayLinkManager.h in Headers */,
74A4BA5B1CABBBD000195969 /* WXDebugTool.h in Headers */,
2A837AB41CD9DE9200AEDF03 /* WXLoadingIndicator.h in Headers */,
- 45E0B4C121CB7B82005D1B3B /* WXConvertUtility.h in Headers */,
747A787C1D1BAAC900DED9D0 /* WXComponent+ViewManagement.h in Headers */,
2AE5B7561CABA04E0082FDDB /* WXEventModuleProtocol.h in Headers */,
B8D66C6B21255730003960BD /* render_scroller.h in Headers */,
@@ -2734,45 +2354,33 @@
D362F94F1C83EDA20003F546 /* WXWebViewModule.h in Headers */,
C4F012861E150307003378D0 /* WXWebSocketLoader.h in Headers */,
77D161381C02DE940010B15B /* WXBridgeManager.h in Headers */,
- B8F2C70A2133A83C00635B37 /* rax_parser_statistics.h in Headers */,
C4D872251E5DDF7500E39BC1 /* WXBoxShadow.h in Headers */,
042013AD1E66CD6A001FC79C /* WXValidateProtocol.h in Headers */,
- B8D66BF12125572F003960BD /* ast_visitor.h in Headers */,
B8D66C2F21255730003960BD /* render_action_render_success.h in Headers */,
- B8D66BD72125572F003960BD /* ast.h in Headers */,
- B8F2C6EC2133A83C00635B37 /* rax_jsx_ast.h in Headers */,
C4D872221E5DDEDA00E39BC1 /* WXInnerLayer.h in Headers */,
- B8D66BB12125572F003960BD /* parser.h in Headers */,
- B8A72C9A213F8BAE0024E7BE /* class_json.h in Headers */,
B8D66C5121255730003960BD /* render_action_remove_event.h in Headers */,
37B51EE41E97804D0040A743 /* WXCycleSliderComponent.h in Headers */,
77D161281C02DE1A0010B15B /* WXSDKManager.h in Headers */,
59CE27E81CC387DB000BE37A /* WXEmbedComponent.h in Headers */,
- B8D66BC72125572F003960BD /* ast_factory.h in Headers */,
B8D66C0F21255730003960BD /* core_side_in_platform.h in Headers */,
B8D66C9121255730003960BD /* render_factory_interface.h in Headers */,
DCE2CF9B1F46D4220021BDC4 /* WXVoiceOverModule.h in Headers */,
453F3756219A76CA00A03F1D /* default_request_handler.h in Headers */,
74BB5FB91DFEE81A004FC3DF /* WXMetaModule.h in Headers */,
- 98399A9621916A9800D83CCE /* class_function.h in Headers */,
DCA0EF641D6EED6F00CB18B9 /* WXGlobalEventModule.h in Headers */,
2A837AB21CD9DE9200AEDF03 /* WXLoadingComponent.h in Headers */,
77CF6A5821E6E47E00BA8634 /* log_defines.h in Headers */,
- B8D66BBD2125572F003960BD /* vnode_exec_env.h in Headers */,
DCA446271EFA5DAF00D0CFA8 /* WeexSDK.h in Headers */,
841CD1051F974DFA0081196D /* WXExceptionUtils.h in Headers */,
745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */,
- 453F3763219A770900A03F1D /* vnode_on_event_listener.h in Headers */,
B8D66C6D21255730003960BD /* render_text.h in Headers */,
7423899F1C32733800D748CA /* WXType.h in Headers */,
59A582FC1CF5B17B0081FD3E /* WXBridgeContext.h in Headers */,
77D161621C02ED790010B15B /* WXLog.h in Headers */,
- B8F2C6E42133A83C00635B37 /* rax_source_locator.h in Headers */,
77D1614B1C02E3790010B15B /* WXConvert.h in Headers */,
1746EA7320E9D253007E55BD /* WXComponent_performance.h in Headers */,
59A596221CB6311F0012CD52 /* WXNavigatorModule.h in Headers */,
77CF6A5621E6E47E00BA8634 /* core_constants.h in Headers */,
- B8F2C7082133A83C00635B37 /* rax_parser_context.h in Headers */,
33CE190E2153443000CF9670 /* WXJSFrameworkLoadDefaultImpl.h in Headers */,
C47B78CE1F2998EE001D3B0C /* WXExtendCallNativeManager.h in Headers */,
B8D66CA321255730003960BD /* wson.h in Headers */,
@@ -2781,14 +2389,10 @@
74EF31AD1DE58BE200667A07 /* WXURLRewriteDefaultImpl.h in Headers */,
B87B9E7D21539B3300B6DC61 /* WXVersion.h in Headers */,
746B923B1F46BE36009AE86B /* WXCellSlotComponent.h in Headers */,
- 4505D11B219B1F720083A1A2 /* class_math.h in Headers */,
744D61101E49979000B624B3 /* WXFooterComponent.h in Headers */,
744D61141E4AF23E00B624B3 /* WXDiffUtil.h in Headers */,
- B8F2C7022133A83C00635B37 /* rax_parser_scope.h in Headers */,
- 4547FD022152048700E79971 /* class_object.h in Headers */,
74862F791E02B88D00B7A041 /* JSValue+Weex.h in Headers */,
453F375A219A76CA00A03F1D /* http_module.h in Headers */,
- B8F2C6FA2133A83C00635B37 /* class_factory.h in Headers */,
2A1F57B71C75C6A600B58017 /* WXTextInputComponent.h in Headers */,
B8D66C2D21255730003960BD /* render_manager.h in Headers */,
74CFDD451F459443007A1A66 /* WXRecycleListUpdateManager.h in Headers */,
@@ -2801,7 +2405,6 @@
59A596191CB630E50012CD52 /* WXNavigationProtocol.h in Headers */,
59A5962F1CB632050012CD52 /* WXBaseViewController.h in Headers */,
33CE19132153444900CF9670 /* WXJSFrameworkLoadProtocol.h in Headers */,
- B8F2C7142133A8BC00635B37 /* vm_monitor.h in Headers */,
B8D66C012125572F003960BD /* constants_value.h in Headers */,
77A3D66E222F9F5B0078A6F5 /* WeexApiValue.h in Headers */,
74AD99841D5B0E59008F0336 /* WXPolyfillSet.h in Headers */,
@@ -2810,7 +2413,6 @@
7461F8921CFB373100F62D44 /* WXLayer.h in Headers */,
B8D66C052125572F003960BD /* css_value_getter.h in Headers */,
594C28931CF9E61A009793A4 /* WXAnimationModule.h in Headers */,
- B8D66BE32125572F003960BD /* exec_state.h in Headers */,
B8D66C6121255730003960BD /* render_cell.h in Headers */,
B8D66C3B21255730003960BD /* render_action_update_style.h in Headers */,
B8D66C7721255730003960BD /* render_appbar.h in Headers */,
@@ -2832,13 +2434,11 @@
DC03ADBA1D508719003F76E7 /* WXTextAreaComponent.h in Headers */,
B8D66C5721255730003960BD /* render_action_layout.h in Headers */,
2AC750241C7565690041D390 /* WXIndicatorComponent.h in Headers */,
- B8F2C6E82133A83C00635B37 /* class_array.h in Headers */,
DCAB35FE1D658EB700C0EA70 /* WXRuleManager.h in Headers */,
748B25181C44A6F9005D491E /* WXSDKInstance_private.h in Headers */,
74862F7D1E03A0F300B7A041 /* WXModuleMethod.h in Headers */,
742AD7331DF98C45007DC46C /* WXResourceResponse.h in Headers */,
77E65A0D1C155E99008B8775 /* WXDivComponent.h in Headers */,
- B8D66BED2125572F003960BD /* vm.h in Headers */,
C41E1A971DC1FD15009C7F90 /* WXDatePickerManager.h in Headers */,
B8D66CB721255730003960BD /* common.h in Headers */,
333D9A271F41507A007CED39 /* WXTransition.h in Headers */,
@@ -2851,19 +2451,15 @@
B8D66C1721255730003960BD /* script_bridge.h in Headers */,
59A582D41CF481110081FD3E /* WXAppMonitorProtocol.h in Headers */,
2A837AB61CD9DE9200AEDF03 /* WXRefreshComponent.h in Headers */,
- B8F2C6E62133A83C00635B37 /* common_error.h in Headers */,
B8D66BFD2125572F003960BD /* render_performance.h in Headers */,
C43C03E81EC8ACA40044C7FF /* WXPrerenderManager.h in Headers */,
- 453267142140E38900DAA620 /* vcomponent.h in Headers */,
17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */,
- 98399A9321916A9800D83CCE /* class_console.h in Headers */,
B8D66CBD21255730003960BD /* closure.h in Headers */,
C4B834281DE69B09007AD27E /* WXPickerModule.h in Headers */,
59A596311CB632050012CD52 /* WXRootViewController.h in Headers */,
B8D66C7D21255730003960BD /* render_text_factory.h in Headers */,
742AD7301DF98C45007DC46C /* WXResourceRequestHandler.h in Headers */,
77E65A151C155EB5008B8775 /* WXTextComponent.h in Headers */,
- 98399A9421916A9800D83CCE /* class_regex.h in Headers */,
B8D66C9921255730003960BD /* weex_core_manager.h in Headers */,
C4B3D6D41E6954300013F38D /* WXEditComponent.h in Headers */,
74CC7A1C1C2BC5F800829368 /* WXCellComponent.h in Headers */,
@@ -2872,7 +2468,6 @@
DCF343671E49CAEE00A2FB34 /* WXJSExceptionInfo.h in Headers */,
C4F012821E1502E9003378D0 /* WXWebSocketModule.h in Headers */,
74EF31AA1DE58AE600667A07 /* WXURLRewriteProtocol.h in Headers */,
- B8D66BE72125572F003960BD /* table.h in Headers */,
59A596241CB6311F0012CD52 /* WXStorageModule.h in Headers */,
74A4BA851CAD453400195969 /* WXNetworkProtocol.h in Headers */,
7461F8A81CFC33A800F62D44 /* WXThreadSafeMutableArray.h in Headers */,
@@ -2888,7 +2483,6 @@
B8D66C8B21255730003960BD /* render_list_factory.h in Headers */,
745B2D681E5A8E1E0092D38A /* WXMultiColumnLayout.h in Headers */,
B89543F720EB18B5006EAD63 /* WXCoreBridge.h in Headers */,
- B8D66BD52125572F003960BD /* string_table.h in Headers */,
2A60CE9C1C91733E00857B9F /* WXSwitchComponent.h in Headers */,
DCDFED011E68238F00C228D7 /* WXJSExceptionProtocol.h in Headers */,
B8D66C0921255730003960BD /* core_environment.h in Headers */,
@@ -2896,39 +2490,29 @@
746319021C60AFC100EFEBD4 /* WXThreadSafeCounter.h in Headers */,
744D610C1E49978200B624B3 /* WXHeaderComponent.h in Headers */,
B8D66C1521255730003960BD /* wx_type_define.h in Headers */,
- B8D66BEB2125572F003960BD /* token.h in Headers */,
- B8D66BEF2125572F003960BD /* op_code.h in Headers */,
B8D66C7921255730003960BD /* render_list.h in Headers */,
B8D66C3321255730003960BD /* render_action_update_attr.h in Headers */,
77D1613C1C02DEA60010B15B /* WXJSCoreBridge.h in Headers */,
74D205201E091B8000128F44 /* WXCallJSMethod.h in Headers */,
- B8D66BAB2125572F003960BD /* code_generator.h in Headers */,
- B8D66BB52125572F003960BD /* vnode.h in Headers */,
741DFE061DDD9B30009B020F /* UIBezierPath+Weex.h in Headers */,
BA5F00F11FC5AFFE00F76B5C /* WXLocaleModule.h in Headers */,
742AD72E1DF98C45007DC46C /* WXResourceRequest.h in Headers */,
B8D66C9321255730003960BD /* dom_wson.h in Headers */,
B8D66CAF21255730003960BD /* wson_parser.h in Headers */,
D317338C1C57257000BB7539 /* WXTransform.h in Headers */,
- 453F3762219A770900A03F1D /* vcomponent_lifecycle_listener.h in Headers */,
- B8D66BC32125572F003960BD /* vnode_render_context.h in Headers */,
77D161301C02DE4E0010B15B /* WXComponent.h in Headers */,
B8D66C1921255730003960BD /* measure_func_adapter.h in Headers */,
2AFEB17B1C747139000507FA /* WXInstanceWrap.h in Headers */,
744BEA551D05178F00452B5D /* WXComponent+Display.h in Headers */,
DCE7F1EF20AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */,
B8D66C7B21255730003960BD /* render_mask_factory.h in Headers */,
- 4547FD0D215392FA00E79971 /* js_common_function.h in Headers */,
59D3CA4A1CFC3CE1008835DC /* NSTimer+Weex.h in Headers */,
C4424E5B1F24DA3D009F52E2 /* WXExtendCallNativeProtocol.h in Headers */,
- B8F2C6FE2133A83C00635B37 /* rax_parser_builder.h in Headers */,
74CFDD391F45939C007A1A66 /* WXRecycleListComponent.h in Headers */,
ED053500207F4DEB007B4568 /* JSContext+Weex.h in Headers */,
- B8D66BCF2125572F003960BD /* tokenizer.h in Headers */,
D334510C1D3E19B80083598A /* WXCanvasModule.h in Headers */,
742AD73A1DF98C8B007DC46C /* WXResourceLoader.h in Headers */,
746319291C71B92600EFEBD4 /* WXModalUIModule.h in Headers */,
- 98399A9521916A9800D83CCE /* exec_state_section.h in Headers */,
B8D66BFF2125572F003960BD /* constants_name.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -2937,9 +2521,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- DCA446101EFA5A8500D0CFA8 /* WXBridgeMethod.h in Headers */,
- DCA4461A1EFA5AA000D0CFA8 /* WXInvocationConfig.h in Headers */,
- DCA4461E1EFA5AAF00D0CFA8 /* WXComponentFactory.h in Headers */,
B85ED3032126715100EBEC11 /* WXRecyclerComponent.h in Headers */,
7715EB6321A69DD9001F1108 /* WXRichText.h in Headers */,
B8D66C1C21255730003960BD /* style.h in Headers */,
@@ -2956,21 +2537,13 @@
DCA4459E1EFA56E500D0CFA8 /* WXUtility.h in Headers */,
77A3D66F222F9F5B0078A6F5 /* WeexApiValue.h in Headers */,
DCA445B91EFA579D00D0CFA8 /* WXErrorView.h in Headers */,
- B8D66BE42125572F003960BD /* exec_state.h in Headers */,
B8D66C022125572F003960BD /* constants_value.h in Headers */,
- B8F2C7032133A83C00635B37 /* rax_parser_scope.h in Headers */,
- B8F2C7012133A83C00635B37 /* ast_builder.h in Headers */,
170B4665208733BF00562666 /* WXAnalyzerCenter+Transfer.h in Headers */,
- B8F2C6FB2133A83C00635B37 /* class_factory.h in Headers */,
- B8D66BC22125572F003960BD /* vnode_render_manager.h in Headers */,
DCA445A01EFA56F400D0CFA8 /* WXType.h in Headers */,
DCA445B21EFA576D00D0CFA8 /* WXListComponent.h in Headers */,
DCA445AD1EFA575100D0CFA8 /* WXNavigationProtocol.h in Headers */,
- B8A72C9B213F8BAE0024E7BE /* class_json.h in Headers */,
DCA445B01EFA576200D0CFA8 /* WXModalUIModule.h in Headers */,
DCA445A61EFA571E00D0CFA8 /* WXSDKEngine.h in Headers */,
- B8F2C6FF2133A83C00635B37 /* rax_parser_builder.h in Headers */,
- B8F2C7092133A83C00635B37 /* rax_parser_context.h in Headers */,
DCA445AA1EFA573900D0CFA8 /* WXResourceRequest.h in Headers */,
DCA445C61EFA57EE00D0CFA8 /* NSObject+WXSwizzle.h in Headers */,
74B81AEB1F73C3E900D3A61D /* WXRecycleListLayout.h in Headers */,
@@ -2985,12 +2558,9 @@
B8D66C8E21255730003960BD /* render_creator.h in Headers */,
B8D66C7A21255730003960BD /* render_list.h in Headers */,
B8D66C9A21255730003960BD /* weex_core_manager.h in Headers */,
- B8D66BB62125572F003960BD /* vnode.h in Headers */,
DCA445BF1EFA57C300D0CFA8 /* WXComponent.h in Headers */,
DCA445A71EFA572300D0CFA8 /* WXRootViewController.h in Headers */,
1746EA7520E9D25E007E55BD /* WXSDKInstance_performance.h in Headers */,
- B8F2C6E92133A83C00635B37 /* class_array.h in Headers */,
- B8D66BE82125572F003960BD /* table.h in Headers */,
74B81AE91F73C3E900D3A61D /* WXRecycleListUpdateManager.h in Headers */,
DCA445C01EFA57C900D0CFA8 /* WXBridgeProtocol.h in Headers */,
B8D66C2A21255730003960BD /* render_page.h in Headers */,
@@ -2998,29 +2568,14 @@
B8D66C8A21255730003960BD /* render_object_interface.h in Headers */,
DCA445AC1EFA574A00D0CFA8 /* WXNetworkProtocol.h in Headers */,
DCA445C31EFA57DC00D0CFA8 /* WXAppMonitorProtocol.h in Headers */,
- B8D66BC42125572F003960BD /* vnode_render_context.h in Headers */,
4532670C213FCF2300DAA620 /* WXDisplayLinkManager.h in Headers */,
DCA445AF1EFA575D00D0CFA8 /* WXModuleProtocol.h in Headers */,
- 4547FD102153932A00E79971 /* js_common_function.h in Headers */,
45E0B4C221CB7B9C005D1B3B /* WXConvertUtility.h in Headers */,
453F376D219A788800A03F1D /* default_request_handler.h in Headers */,
453F376C219A786F00A03F1D /* request_handler.h in Headers */,
453F376B219A785C00A03F1D /* http_module.h in Headers */,
- 453F3768219A782900A03F1D /* vnode_on_event_listener.h in Headers */,
- 453F3767219A781900A03F1D /* vcomponent_lifecycle_listener.h in Headers */,
- B8D66BF02125572F003960BD /* op_code.h in Headers */,
- 4505D12D219B21760083A1A2 /* class_window.h in Headers */,
- 4505D12B219B21470083A1A2 /* class_regex.h in Headers */,
- 4505D129219B211D0083A1A2 /* class_console.h in Headers */,
- 4505D127219B20E70083A1A2 /* class_function.h in Headers */,
- 4505D125219B20B20083A1A2 /* exec_state_section.h in Headers */,
- 4505D122219B207D0083A1A2 /* exec_state_binary.h in Headers */,
- 4505D120219B20310083A1A2 /* vcomponent.h in Headers */,
- 4505D11E219B1FAC0083A1A2 /* class_math.h in Headers */,
- 4547FD032152049F00E79971 /* class_object.h in Headers */,
ED053501207F4DEB007B4568 /* JSContext+Weex.h in Headers */,
DCA4459F1EFA56EC00D0CFA8 /* WXURLRewriteProtocol.h in Headers */,
- B8D66BAC2125572F003960BD /* code_generator.h in Headers */,
DCA445A21EFA570100D0CFA8 /* WXScrollerComponent.h in Headers */,
B8D66C7621255730003960BD /* render_object.h in Headers */,
DCA445B71EFA579200D0CFA8 /* WXImgLoaderProtocol.h in Headers */,
@@ -3030,14 +2585,9 @@
DCA445AB1EFA574100D0CFA8 /* WXPrerenderManager.h in Headers */,
DCA445BB1EFA57AA00D0CFA8 /* WXDebugTool.h in Headers */,
B8D66C8621255730003960BD /* render_appbar_factory.h in Headers */,
- B8D66BBE2125572F003960BD /* vnode_exec_env.h in Headers */,
- B8A72C9D213F8BAE0024E7BE /* class_string.h in Headers */,
- B8D66BB22125572F003960BD /* parser.h in Headers */,
DCA445A91EFA573200D0CFA8 /* WXResourceRequestHandler.h in Headers */,
DCA445C41EFA57E300D0CFA8 /* WXAppConfiguration.h in Headers */,
DCA445BA1EFA57A200D0CFA8 /* WXDefine.h in Headers */,
- B8F2C6E72133A83C00635B37 /* common_error.h in Headers */,
- B8F2C70B2133A83C00635B37 /* rax_parser_statistics.h in Headers */,
B8D66C8821255730003960BD /* simple_render_factory.h in Headers */,
DCA445A41EFA570E00D0CFA8 /* WXSDKInstance.h in Headers */,
DCA445C51EFA57E800D0CFA8 /* WXAComponent.h in Headers */,
@@ -3052,7 +2602,6 @@
DCA445BD1EFA57B500D0CFA8 /* WXConfigCenterProtocol.h in Headers */,
DCA445A11EFA56FA00D0CFA8 /* WXScrollerProtocol.h in Headers */,
DCA445DE1EFA59B800D0CFA8 /* WXSectionDataController.h in Headers */,
- B8D66BD82125572F003960BD /* ast.h in Headers */,
DCA445F01EFA5A1D00D0CFA8 /* WXComponent_internal.h in Headers */,
B8D66C3221255730003960BD /* render_action_appendtree_createfinish.h in Headers */,
170B4664208733AF00562666 /* WXAnalyzerCenter.h in Headers */,
@@ -3073,12 +2622,10 @@
DCA4460B1EFA5A7200D0CFA8 /* WXAssert.h in Headers */,
B8D66C3C21255730003960BD /* render_action_update_style.h in Headers */,
DCA445F71EFA5A3100D0CFA8 /* WXPickerModule.h in Headers */,
- B8F2C6E52133A83C00635B37 /* rax_source_locator.h in Headers */,
DCA445E71EFA59E900D0CFA8 /* WXTextComponent.h in Headers */,
B8D66C1821255730003960BD /* script_bridge.h in Headers */,
DCA445D01EFA593E00D0CFA8 /* WXDisplayQueue.h in Headers */,
DCA445E21EFA59D700D0CFA8 /* WXRefreshComponent.h in Headers */,
- B8D66BDE2125572F003960BD /* scanner.h in Headers */,
DCA445E81EFA59EF00D0CFA8 /* WXCycleSliderComponent.h in Headers */,
DCA4461F1EFA5AB100D0CFA8 /* WXRuleManager.h in Headers */,
DCA445E31EFA59DA00D0CFA8 /* WXEmbedComponent.h in Headers */,
@@ -3087,11 +2634,11 @@
C42E8FAD1F3C7C3F001EBE9D /* WXExtendCallNativeManager.h in Headers */,
DCA445CB1EFA590600D0CFA8 /* WXComponent+Layout.h in Headers */,
DCA4460F1EFA5A8100D0CFA8 /* WXDiffUtil.h in Headers */,
- B8D66BEC2125572F003960BD /* token.h in Headers */,
DCE7F1F020AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */,
77CF6A5921E6E47E00BA8634 /* log_defines.h in Headers */,
DCA445F91EFA5A3700D0CFA8 /* WXClipboardModule.h in Headers */,
DCA445FD1EFA5A4000D0CFA8 /* WXAnimationModule.h in Headers */,
+ DCA446101EFA5A8500D0CFA8 /* WXBridgeMethod.h in Headers */,
B8D66C7E21255730003960BD /* render_text_factory.h in Headers */,
DCA446171EFA5A9900D0CFA8 /* WXPolyfillSet.h in Headers */,
DCA446291EFA688B00D0CFA8 /* WeexSDK.h in Headers */,
@@ -3100,7 +2647,6 @@
B8D66C1421255730003960BD /* core_side_in_script.h in Headers */,
B89543F820EB18B5006EAD63 /* WXCoreBridge.h in Headers */,
17F2D6E72087227300084378 /* WXAnalyzerProtocol.h in Headers */,
- B8D66BEE2125572F003960BD /* vm.h in Headers */,
B8D66C6221255730003960BD /* render_cell.h in Headers */,
DC7764961F3C685600B5727E /* WXRecyclerDragController.h in Headers */,
DCA446161EFA5A9600D0CFA8 /* WXJSCoreBridge.h in Headers */,
@@ -3108,7 +2654,6 @@
DCA445CF1EFA593A00D0CFA8 /* WXInnerLayer.h in Headers */,
B8D66C6E21255730003960BD /* render_text.h in Headers */,
DCA446041EFA5A5500D0CFA8 /* WXMetaModule.h in Headers */,
- B8D66BCE2125572F003960BD /* statement.h in Headers */,
B8D66C5A21255730003960BD /* render_action_remove_element.h in Headers */,
DCA445FC1EFA5A3E00D0CFA8 /* WXStreamModule.h in Headers */,
B8D66C5C21255730003960BD /* render_action_add_element.h in Headers */,
@@ -3118,7 +2663,6 @@
DCA445F11EFA5A2000D0CFA8 /* WXCanvasComponent.h in Headers */,
B8D66CB021255730003960BD /* wson_parser.h in Headers */,
DCA445D51EFA598200D0CFA8 /* WXComponent+PseudoClassManagement.h in Headers */,
- B8D66BC82125572F003960BD /* ast_factory.h in Headers */,
DCA4460E1EFA5A7E00D0CFA8 /* WXLength.h in Headers */,
DCA445FA1EFA5A3A00D0CFA8 /* WXNavigatorModule.h in Headers */,
841CD1061F974DFA0081196D /* WXExceptionUtils.h in Headers */,
@@ -3128,24 +2672,22 @@
B8D66C3E21255730003960BD /* render_action_createfinish.h in Headers */,
DCA445F21EFA5A2300D0CFA8 /* WXHeaderComponent.h in Headers */,
DCA445DD1EFA59B300D0CFA8 /* WXRecyclerUpdateController.h in Headers */,
+ DCA4461E1EFA5AAF00D0CFA8 /* WXComponentFactory.h in Headers */,
33CE190F2153443000CF9670 /* WXJSFrameworkLoadDefaultImpl.h in Headers */,
DCA445F41EFA5A2800D0CFA8 /* WXNavigationDefaultImpl.h in Headers */,
B87B9E7E21539B3300B6DC61 /* WXVersion.h in Headers */,
B8D66C9421255730003960BD /* dom_wson.h in Headers */,
DCA445E51EFA59E100D0CFA8 /* WXDivComponent.h in Headers */,
DCA446211EFA5ABA00D0CFA8 /* WXSDKInstance_private.h in Headers */,
- B8D66BD62125572F003960BD /* string_table.h in Headers */,
DCA4461D1EFA5AAA00D0CFA8 /* WXHandlerFactory.h in Headers */,
DCA445EE1EFA5A1500D0CFA8 /* WXWebComponent.h in Headers */,
DCA4460D1EFA5A7900D0CFA8 /* WXThreadSafeMutableArray.h in Headers */,
B8D66C3021255730003960BD /* render_action_render_success.h in Headers */,
- B8D66BD02125572F003960BD /* tokenizer.h in Headers */,
B8D66C6C21255730003960BD /* render_scroller.h in Headers */,
B8D66CBE21255730003960BD /* closure.h in Headers */,
74B81AE31F73C3E300D3A61D /* WXRecycleListComponent.h in Headers */,
DCA445DA1EFA59A600D0CFA8 /* WXMultiColumnLayout.h in Headers */,
DCA445E01EFA59CD00D0CFA8 /* WXLoadingIndicator.h in Headers */,
- B8F2C6ED2133A83C00635B37 /* rax_jsx_ast.h in Headers */,
17036A4F20FDE72F0029AE3D /* WXApmForInstance.h in Headers */,
DCA445E61EFA59E500D0CFA8 /* WXImageComponent.h in Headers */,
DCA4461B1EFA5AA200D0CFA8 /* WXDatePickerManager.h in Headers */,
@@ -3162,7 +2704,6 @@
B8D66C1A21255730003960BD /* measure_func_adapter.h in Headers */,
DCA446001EFA5A4800D0CFA8 /* WXDomModule.h in Headers */,
DCA446021EFA5A5000D0CFA8 /* WXWebViewModule.h in Headers */,
- B8D66BF22125572F003960BD /* ast_visitor.h in Headers */,
DCA446181EFA5A9B00D0CFA8 /* JSValue+Weex.h in Headers */,
DCA446061EFA5A5B00D0CFA8 /* NSTimer+Weex.h in Headers */,
DCA445D61EFA598600D0CFA8 /* WXView.h in Headers */,
@@ -3173,7 +2714,7 @@
17E5ACE3209211C200EE81F1 /* WXTransition.h in Headers */,
DCA445F31EFA5A2500D0CFA8 /* WXFooterComponent.h in Headers */,
DCA446151EFA5A9000D0CFA8 /* WXBridgeContext.h in Headers */,
- B8D66BE62125572F003960BD /* object.h in Headers */,
+ DCA4461A1EFA5AA000D0CFA8 /* WXInvocationConfig.h in Headers */,
DCA445DC1EFA59AD00D0CFA8 /* WXRecyclerDataController.h in Headers */,
DCA446191EFA5A9E00D0CFA8 /* WXServiceFactory.h in Headers */,
DCA446121EFA5A8A00D0CFA8 /* WXComponentMethod.h in Headers */,
@@ -3188,15 +2729,11 @@
B8D66CA421255730003960BD /* wson.h in Headers */,
B8D66CB821255730003960BD /* common.h in Headers */,
C49642EC1F73E6DF0092CC5A /* WXWebSocketHandler.h in Headers */,
- B8D66BE22125572F003960BD /* handle.h in Headers */,
DCA445EB1EFA5A0B00D0CFA8 /* WXTextInputComponent.h in Headers */,
B8D66C5821255730003960BD /* render_action_layout.h in Headers */,
DCA4460C1EFA5A7600D0CFA8 /* WXThreadSafeMutableDictionary.h in Headers */,
- B8F2C7152133A8BC00635B37 /* vm_monitor.h in Headers */,
B8394F3821468AF100CA1EFF /* render_action_trigger_vsync.h in Headers */,
- B8F2C6EF2133A83C00635B37 /* class.h in Headers */,
DCA445CE1EFA593500D0CFA8 /* WXComponent+BoxShadow.h in Headers */,
- B8F2C70F2133A83C00635B37 /* rax_parser.h in Headers */,
74B81AF11F73C3E900D3A61D /* WXJSASTParser.h in Headers */,
B8D66C0C21255730003960BD /* platform_bridge.h in Headers */,
B8D66C8C21255730003960BD /* render_list_factory.h in Headers */,
@@ -3398,7 +2935,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = ". \"${PROJECT_DIR}/buildScripts.sh\"\n\ngenerateSDKHeader 'WeexSDK'\ngenerateBuildTime \"${PROJECT_DIR}/WeexSDK/Sources/Utility/WXVersion.m\"\n";
+ shellScript = ". \"${PROJECT_DIR}/buildScripts.sh\"\n\ngenerateSDKHeader 'WeexSDK' 'eagle_bridge.h'\ngenerateBuildTime \"${PROJECT_DIR}/WeexSDK/Sources/Utility/WXVersion.m\"\n";
};
DCA445C81EFA584000D0CFA8 /* Generate WeexSDK.h */ = {
isa = PBXShellScriptBuildPhase;
@@ -3463,13 +3000,11 @@
747DF6831E31AEE4005C53A8 /* WXLength.m in Sources */,
17E5ACE2209211BD00EE81F1 /* WXTransition.mm in Sources */,
77E65A0E1C155E99008B8775 /* WXDivComponent.m in Sources */,
- B8D66BF92125572F003960BD /* exec_state.cc in Sources */,
B8D66CAB21255730003960BD /* wson_util.cpp in Sources */,
ED053502207F4DEB007B4568 /* JSContext+Weex.m in Sources */,
2A60CE9D1C91733E00857B9F /* WXSwitchComponent.mm in Sources */,
744D61111E49979000B624B3 /* WXFooterComponent.m in Sources */,
B8D66C0721255730003960BD /* core_environment.cpp in Sources */,
- 98399A9021916A9800D83CCE /* class_window.cc in Sources */,
745B2D6F1E5A8E1E0092D38A /* WXRecyclerUpdateController.m in Sources */,
745B2D6B1E5A8E1E0092D38A /* WXRecyclerComponent.mm in Sources */,
B8D66C0D21255730003960BD /* core_side_in_platform.cpp in Sources */,
@@ -3480,67 +3015,46 @@
747A787D1D1BAAC900DED9D0 /* WXComponent+ViewManagement.mm in Sources */,
C4E375371E5FCBD3009B2D9C /* WXComponent+BoxShadow.m in Sources */,
C43C03E91EC8ACA40044C7FF /* WXPrerenderManager.m in Sources */,
- B8D66BD12125572F003960BD /* statement.cc in Sources */,
- B8F2C6F82133A83C00635B37 /* class.cc in Sources */,
B8D66C4B21255730003960BD /* render_action_remove_event.cpp in Sources */,
- B8F2C6F22133A83C00635B37 /* class_factory.cc in Sources */,
- B8D66BD32125572F003960BD /* vm.cc in Sources */,
- 98399A9121916A9800D83CCE /* class_function.cc in Sources */,
2A837AB51CD9DE9200AEDF03 /* WXLoadingIndicator.m in Sources */,
- B8D66BBF2125572F003960BD /* vnode_render_manager.cc in Sources */,
B8D66C6321255730003960BD /* render_text.cpp in Sources */,
C4F012831E1502E9003378D0 /* WXWebSocketModule.m in Sources */,
DCF087621DCAE161005CD6EB /* WXInvocationConfig.m in Sources */,
C47B78CF1F2998EE001D3B0C /* WXExtendCallNativeManager.m in Sources */,
77D161311C02DE4E0010B15B /* WXComponent.mm in Sources */,
74CFDD461F459443007A1A66 /* WXRecycleListUpdateManager.m in Sources */,
- B8F2C7102133A83C00635B37 /* ast_builder.cc in Sources */,
- B8F2C7042133A83C00635B37 /* class_array.cc in Sources */,
74862F7A1E02B88D00B7A041 /* JSValue+Weex.m in Sources */,
- B8D66BC52125572F003960BD /* tokenizer.cc in Sources */,
33CE19102153443000CF9670 /* WXJSFrameworkLoadDefaultImpl.m in Sources */,
B8D66C7321255730003960BD /* render_list.cpp in Sources */,
- B8D66BC92125572F003960BD /* ast.cc in Sources */,
740451EB1E14BB26004157CB /* WXServiceFactory.m in Sources */,
B8D66C6521255730003960BD /* render_mask.cpp in Sources */,
- 4547FD0E215392FA00E79971 /* js_common_function.cc in Sources */,
77E659DB1C07F594008B8775 /* WXDomModule.m in Sources */,
D3FC0DF81C508B2A002B9E31 /* WXTimerModule.m in Sources */,
594C28921CF9E61A009793A4 /* WXAnimationModule.m in Sources */,
B8D66C6F21255730003960BD /* render_object.cpp in Sources */,
- B8D66BB92125572F003960BD /* vnode.cc in Sources */,
59A5961D1CB630F10012CD52 /* WXComponent+Navigation.m in Sources */,
- B8F2C6FC2133A83C00635B37 /* rax_parser_builder.cc in Sources */,
77D161631C02ED790010B15B /* WXLog.m in Sources */,
17C74F0D2072145100AB4CAB /* WXAnalyzerCenter.m in Sources */,
743933B51C7ED9AA00773BB7 /* WXSimulatorShortcutManager.m in Sources */,
BA5F00F21FC5AFFE00F76B5C /* WXLocaleModule.m in Sources */,
B8D66C9F21255730003960BD /* json11.cc in Sources */,
- B8D66BB72125572F003960BD /* vnode_exec_env.cc in Sources */,
74BB5FBA1DFEE81A004FC3DF /* WXMetaModule.m in Sources */,
741081201CED585A001BC6E5 /* WXComponentManager.mm in Sources */,
- 4547FD012152048700E79971 /* class_object.cc in Sources */,
1D3000F21D40B9AC004F3B4F /* WXClipboardModule.m in Sources */,
- B8F2C6EA2133A83C00635B37 /* rax_source_locator.cc in Sources */,
741DFE071DDD9B30009B020F /* UIBezierPath+Weex.m in Sources */,
D312CE3C1C730DEB00046D68 /* WXWebComponent.m in Sources */,
B8D66C4721255730003960BD /* render_action_add_event.cpp in Sources */,
- B8D66BAD2125572F003960BD /* code_generator.cc in Sources */,
+ BD9205FC223651D900EDF93D /* eagle_bridge.cpp in Sources */,
74AD99851D5B0E59008F0336 /* WXPolyfillSet.m in Sources */,
D317338D1C57257000BB7539 /* WXTransform.m in Sources */,
- B8D66BAF2125572F003960BD /* ast_factory.cc in Sources */,
7461F8A91CFC33A800F62D44 /* WXThreadSafeMutableArray.m in Sources */,
745B2D6D1E5A8E1E0092D38A /* WXRecyclerDataController.m in Sources */,
- 453F375F219A76FA00A03F1D /* vnode_on_event_listener.mm in Sources */,
- B8D66BF32125572F003960BD /* object.cc in Sources */,
2AC750251C7565690041D390 /* WXIndicatorComponent.m in Sources */,
591DD3311D23AD5800BE8709 /* WXErrorView.m in Sources */,
7715EB6421A69DD9001F1108 /* WXRichText.mm in Sources */,
B8D66C1121255730003960BD /* core_side_in_script.cpp in Sources */,
B8D66C032125572F003960BD /* css_value_getter.cpp in Sources */,
B8394F3921468AF100CA1EFF /* render_action_trigger_vsync.cpp in Sources */,
- B8F2C6F62133A83C00635B37 /* rax_parser_context.cc in Sources */,
- B8A72C9E213F8BAE0024E7BE /* class_json.cc in Sources */,
59D3CA4B1CFC3CE1008835DC /* NSTimer+Weex.m in Sources */,
59A596321CB632050012CD52 /* WXRootViewController.m in Sources */,
DCC77C131D770AE300CE7288 /* WXSliderNeighborComponent.mm in Sources */,
@@ -3551,21 +3065,16 @@
B87B9E7F21539B3300B6DC61 /* WXVersion.m in Sources */,
77E65A161C155EB5008B8775 /* WXTextComponent.mm in Sources */,
C4D872261E5DDF7500E39BC1 /* WXBoxShadow.m in Sources */,
- B8D66BB32125572F003960BD /* parser.cc in Sources */,
- 4505D11C219B1F720083A1A2 /* class_math.cc in Sources */,
746319031C60AFC100EFEBD4 /* WXThreadSafeCounter.m in Sources */,
B8D66C8321255730003960BD /* render_creator.cpp in Sources */,
74A4BAA71CB4F98300195969 /* WXStreamModule.m in Sources */,
744D610D1E49978200B624B3 /* WXHeaderComponent.mm in Sources */,
- 98399A8B21916A9800D83CCE /* exec_state_section.cc in Sources */,
- B8F2C7062133A83C00635B37 /* rax_parser_scope.cc in Sources */,
77E659F21C0C3612008B8775 /* WXModuleFactory.m in Sources */,
B8D66C5F21255730003960BD /* render_action_render_success.cpp in Sources */,
DCF343681E49CAEE00A2FB34 /* WXJSExceptionInfo.m in Sources */,
B863DF322107308000EA887D /* WXBridgeContext.m in Sources */,
59CE27E91CC387DB000BE37A /* WXEmbedComponent.m in Sources */,
DCA0EF651D6EED6F00CB18B9 /* WXGlobalEventModule.m in Sources */,
- 453267152140E38900DAA620 /* vcomponent.cc in Sources */,
2A919DA71E321F1F006EB6B5 /* WXBridgeMethod.m in Sources */,
453F3758219A76CA00A03F1D /* default_request_handler.mm in Sources */,
7423EB521F4ADE30001662D1 /* WXComponent+DataBinding.mm in Sources */,
@@ -3588,25 +3097,20 @@
59A596251CB6311F0012CD52 /* WXStorageModule.m in Sources */,
2AFEB17C1C747139000507FA /* WXInstanceWrap.m in Sources */,
74A4BA5C1CABBBD000195969 /* WXDebugTool.m in Sources */,
- 98399A9721916A9800D83CCE /* op_code.cc in Sources */,
742AD73B1DF98C8B007DC46C /* WXResourceLoader.m in Sources */,
453F3757219A76CA00A03F1D /* http_module.cc in Sources */,
- B8A72CA0213F8BAE0024E7BE /* class_string.cc in Sources */,
B8D66C6721255730003960BD /* render_scroller.cpp in Sources */,
B8D66C5321255730003960BD /* render_action_createbody.cpp in Sources */,
- B8D66BA92125572F003960BD /* table.cc in Sources */,
B8D66C5521255730003960BD /* render_action_createfinish.cpp in Sources */,
D334510D1D3E19B80083598A /* WXCanvasModule.m in Sources */,
B8D66C1D21255730003960BD /* style.cpp in Sources */,
B89543F520EB18B5006EAD63 /* WXJSCoreBridge.mm in Sources */,
- 98399A8C21916A9800D83CCE /* exec_state_binary.cc in Sources */,
741081241CED6756001BC6E5 /* WXComponentFactory.m in Sources */,
D362F9501C83EDA20003F546 /* WXWebViewModule.m in Sources */,
745B2D711E5A8E1E0092D38A /* WXSectionDataController.m in Sources */,
DCE2CF9A1F46D4220021BDC4 /* WXVoiceOverModule.m in Sources */,
2A1F57B81C75C6A600B58017 /* WXTextInputComponent.m in Sources */,
74CC7A1D1C2BC5F800829368 /* WXCellComponent.mm in Sources */,
- B8D66BA72125572F003960BD /* string_table.cc in Sources */,
74862F821E03A24500B7A041 /* WXComponentMethod.m in Sources */,
77E65A121C155EA8008B8775 /* WXImageComponent.m in Sources */,
74CFDD3E1F459400007A1A66 /* WXRecycleListDataManager.m in Sources */,
@@ -3614,12 +3118,10 @@
2A837AB31CD9DE9200AEDF03 /* WXLoadingComponent.mm in Sources */,
2AE5B7531CAB7DBD0082FDDB /* WXAComponent.m in Sources */,
B8D66C9521255730003960BD /* dom_wson.cpp in Sources */,
- B8F2C70C2133A83C00635B37 /* rax_parser.cc in Sources */,
176BE43C209172330086B6AF /* WXComponent+Layout.mm in Sources */,
74CFDD3A1F45939C007A1A66 /* WXRecycleListComponent.mm in Sources */,
741DFE031DDD7D18009B020F /* WXRoundedRect.mm in Sources */,
59A596301CB632050012CD52 /* WXBaseViewController.m in Sources */,
- 98399A8D21916A9800D83CCE /* class_regex.cc in Sources */,
74CC7A211C2BF9DC00829368 /* WXListComponent.mm in Sources */,
7423899C1C3174EB00D748CA /* WXWeakObjectWrapper.m in Sources */,
744BEA561D05178F00452B5D /* WXComponent+Display.m in Sources */,
@@ -3642,19 +3144,13 @@
17B122212090AA9300387E33 /* WXSDKInstance_performance.m in Sources */,
B8D66C3921255730003960BD /* render_action_layout.cpp in Sources */,
59A583091CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m in Sources */,
- B8D66BF52125572F003960BD /* token.cc in Sources */,
746B923C1F46BE36009AE86B /* WXCellSlotComponent.mm in Sources */,
7463192A1C71B92600EFEBD4 /* WXModalUIModule.m in Sources */,
77D161501C02E3880010B15B /* WXUtility.m in Sources */,
- 98399A8F21916A9800D83CCE /* class_console.cc in Sources */,
- B8F2C6F42133A83C00635B37 /* rax_parser_statistics.cc in Sources */,
1771795721416DF0006F39A9 /* WXApmForInstance.m in Sources */,
74A4BA9F1CB3C0A100195969 /* WXHandlerFactory.m in Sources */,
B8D66C3721255730003960BD /* render_action_update_attr.cpp in Sources */,
- B8F2C6F02133A83C00635B37 /* rax_jsx_ast.cc in Sources */,
- B8D66BBB2125572F003960BD /* vnode_render_context.cc in Sources */,
841CD1031F9739890081196D /* WXExceptionUtils.m in Sources */,
- 453F375E219A76FA00A03F1D /* vcomponent_lifecycle_listener.mm in Sources */,
742AD72F1DF98C45007DC46C /* WXResourceRequest.m in Sources */,
7461F8931CFB373100F62D44 /* WXLayer.m in Sources */,
74D205211E091B8000128F44 /* WXCallJSMethod.m in Sources */,
@@ -3675,19 +3171,6 @@
453F376F219A78D700A03F1D /* WXConvertUtility.mm in Sources */,
453F376E219A789A00A03F1D /* default_request_handler.mm in Sources */,
453F376A219A784F00A03F1D /* http_module.cc in Sources */,
- 453F3765219A77FF00A03F1D /* vnode_on_event_listener.mm in Sources */,
- 453F3764219A77EE00A03F1D /* vcomponent_lifecycle_listener.mm in Sources */,
- 4505D12E219B22630083A1A2 /* op_code.cc in Sources */,
- 4505D12C219B216D0083A1A2 /* class_window.cc in Sources */,
- 4505D12A219B213B0083A1A2 /* class_regex.cc in Sources */,
- 4505D128219B21110083A1A2 /* class_console.cc in Sources */,
- 4505D126219B20DA0083A1A2 /* class_function.cc in Sources */,
- 4505D124219B20A80083A1A2 /* exec_state_section.cc in Sources */,
- 4505D121219B206B0083A1A2 /* exec_state_binary.cc in Sources */,
- 4505D11F219B20290083A1A2 /* vcomponent.cc in Sources */,
- 4505D11D219B1F9E0083A1A2 /* class_math.cc in Sources */,
- 4547FD0F2153931000E79971 /* js_common_function.cc in Sources */,
- 4547FD04215204AB00E79971 /* class_object.cc in Sources */,
4532670D213FCFB400DAA620 /* WXDisplayLinkManager.m in Sources */,
B863DF332107313400EA887D /* WXBridgeContext.m in Sources */,
B82A159A20F857450098A509 /* WXWebSocketLoader.m in Sources */,
@@ -3699,7 +3182,6 @@
DCA445301EFA55B300D0CFA8 /* WXComponent+Events.m in Sources */,
DCA445311EFA55B300D0CFA8 /* WXComponent+BoxShadow.m in Sources */,
DCA445321EFA55B300D0CFA8 /* WXInnerLayer.m in Sources */,
- B8D66BFA2125572F003960BD /* exec_state.cc in Sources */,
B8D66CAC21255730003960BD /* wson_util.cpp in Sources */,
DCA445331EFA55B300D0CFA8 /* WXDisplayQueue.m in Sources */,
DCA445341EFA55B300D0CFA8 /* WXLayer.m in Sources */,
@@ -3715,13 +3197,8 @@
DCA4453B1EFA55B300D0CFA8 /* WXErrorView.m in Sources */,
74B81AEC1F73C3E900D3A61D /* WXRecycleListLayout.m in Sources */,
DCA4453C1EFA55B300D0CFA8 /* WXComponent+ViewManagement.mm in Sources */,
- B8D66BD22125572F003960BD /* statement.cc in Sources */,
- B8F2C6F92133A83C00635B37 /* class.cc in Sources */,
B8D66C4C21255730003960BD /* render_action_remove_event.cpp in Sources */,
- B8F2C6F32133A83C00635B37 /* class_factory.cc in Sources */,
- B8D66BD42125572F003960BD /* vm.cc in Sources */,
74B81AE41F73C3E500D3A61D /* WXRecycleListComponent.mm in Sources */,
- B8D66BC02125572F003960BD /* vnode_render_manager.cc in Sources */,
B8D66C6421255730003960BD /* render_text.cpp in Sources */,
DC7764951F3C685200B5727E /* WXRecyclerDragController.m in Sources */,
B89543F420EB18B5006EAD63 /* WXCoreBridge.mm in Sources */,
@@ -3729,48 +3206,35 @@
DCA4453E1EFA55B300D0CFA8 /* WXBaseViewController.m in Sources */,
B8394F3A21468AF100CA1EFF /* render_action_trigger_vsync.cpp in Sources */,
DCA4453F1EFA55B300D0CFA8 /* WXRootViewController.m in Sources */,
- B8F2C7112133A83C00635B37 /* ast_builder.cc in Sources */,
- B8F2C7052133A83C00635B37 /* class_array.cc in Sources */,
DCA445401EFA55B300D0CFA8 /* WXEditComponent.mm in Sources */,
- B8D66BC62125572F003960BD /* tokenizer.cc in Sources */,
B8D66C7421255730003960BD /* render_list.cpp in Sources */,
- B8D66BCA2125572F003960BD /* ast.cc in Sources */,
DCA445411EFA55B300D0CFA8 /* WXMultiColumnLayout.m in Sources */,
B8D66C6621255730003960BD /* render_mask.cpp in Sources */,
DCA445421EFA55B300D0CFA8 /* WXRecyclerComponent.mm in Sources */,
DCA445431EFA55B300D0CFA8 /* WXRecyclerDataController.m in Sources */,
DCA445441EFA55B300D0CFA8 /* WXRecyclerUpdateController.m in Sources */,
B8D66C7021255730003960BD /* render_object.cpp in Sources */,
- B8D66BBA2125572F003960BD /* vnode.cc in Sources */,
DCA445451EFA55B300D0CFA8 /* WXSectionDataController.m in Sources */,
- B8F2C6FD2133A83C00635B37 /* rax_parser_builder.cc in Sources */,
DCA445461EFA55B300D0CFA8 /* WXLoadingComponent.mm in Sources */,
DCA445471EFA55B300D0CFA8 /* WXSliderNeighborComponent.mm in Sources */,
DCA445481EFA55B300D0CFA8 /* WXLoadingIndicator.m in Sources */,
DCA445491EFA55B300D0CFA8 /* WXRefreshComponent.mm in Sources */,
B8D66CA021255730003960BD /* json11.cc in Sources */,
- B8D66BB82125572F003960BD /* vnode_exec_env.cc in Sources */,
DCA4454A1EFA55B300D0CFA8 /* WXEmbedComponent.m in Sources */,
74B81AE81F73C3E900D3A61D /* WXRecycleListTemplateManager.m in Sources */,
DCA4454B1EFA55B300D0CFA8 /* WXVideoComponent.m in Sources */,
- B8F2C6EB2133A83C00635B37 /* rax_source_locator.cc in Sources */,
74B81AE61F73C3E900D3A61D /* WXRecycleListDataManager.m in Sources */,
DCA4454C1EFA55B300D0CFA8 /* WXComponent.mm in Sources */,
B8D66C4821255730003960BD /* render_action_add_event.cpp in Sources */,
- B8D66BAE2125572F003960BD /* code_generator.cc in Sources */,
7715EB6521A69DD9001F1108 /* WXRichText.mm in Sources */,
DCA4454D1EFA55B300D0CFA8 /* WXDivComponent.m in Sources */,
DCA4454E1EFA55B300D0CFA8 /* WXImageComponent.m in Sources */,
- B8D66BB02125572F003960BD /* ast_factory.cc in Sources */,
DCA4454F1EFA55B300D0CFA8 /* WXTextComponent.mm in Sources */,
DCA445501EFA55B300D0CFA8 /* WXScrollerComponent.mm in Sources */,
- B8D66BF42125572F003960BD /* object.cc in Sources */,
DCA445511EFA55B300D0CFA8 /* WXCycleSliderComponent.mm in Sources */,
DCE2CF9D1F46D4370021BDC4 /* WXVoiceOverModule.m in Sources */,
B8D66C1221255730003960BD /* core_side_in_script.cpp in Sources */,
B8D66C042125572F003960BD /* css_value_getter.cpp in Sources */,
- B8F2C6F72133A83C00635B37 /* rax_parser_context.cc in Sources */,
- B8A72C9F213F8BAE0024E7BE /* class_json.cc in Sources */,
DCA445531EFA55B300D0CFA8 /* WXCellComponent.mm in Sources */,
DCA445541EFA55B300D0CFA8 /* WXListComponent.mm in Sources */,
DCA445551EFA55B300D0CFA8 /* WXIndicatorComponent.m in Sources */,
@@ -3780,11 +3244,9 @@
DCA445571EFA55B300D0CFA8 /* WXTextAreaComponent.mm in Sources */,
DCA445581EFA55B300D0CFA8 /* WXTransform.m in Sources */,
DCA445591EFA55B300D0CFA8 /* WXWebComponent.m in Sources */,
- B8D66BB42125572F003960BD /* parser.cc in Sources */,
DCA4455A1EFA55B300D0CFA8 /* WXSwitchComponent.mm in Sources */,
B8D66C8421255730003960BD /* render_creator.cpp in Sources */,
DCA4455B1EFA55B300D0CFA8 /* WXAComponent.m in Sources */,
- B8F2C7072133A83C00635B37 /* rax_parser_scope.cc in Sources */,
DCA4455C1EFA55B300D0CFA8 /* WXCanvasComponent.m in Sources */,
DCA4455D1EFA55B300D0CFA8 /* WXHeaderComponent.mm in Sources */,
33CE19112153443000CF9670 /* WXJSFrameworkLoadDefaultImpl.m in Sources */,
@@ -3814,11 +3276,9 @@
DCA4456B1EFA55B300D0CFA8 /* WXInstanceWrap.m in Sources */,
DCA4456C1EFA55B300D0CFA8 /* WXDomModule.m in Sources */,
DCA4456D1EFA55B300D0CFA8 /* WXTimerModule.m in Sources */,
- B8A72CA1213F8BAE0024E7BE /* class_string.cc in Sources */,
DCA4456E1EFA55B300D0CFA8 /* WXModalUIModule.m in Sources */,
B8D66C6821255730003960BD /* render_scroller.cpp in Sources */,
B8D66C5421255730003960BD /* render_action_createbody.cpp in Sources */,
- B8D66BAA2125572F003960BD /* table.cc in Sources */,
B8D66C5621255730003960BD /* render_action_createfinish.cpp in Sources */,
DCA4456F1EFA55B300D0CFA8 /* WXWebViewModule.m in Sources */,
B8D66C1E21255730003960BD /* style.cpp in Sources */,
@@ -3829,7 +3289,6 @@
DCA445731EFA55B300D0CFA8 /* NSTimer+Weex.m in Sources */,
74B81AEE1F73C3E900D3A61D /* WXCellSlotComponent.mm in Sources */,
DCA445741EFA55B300D0CFA8 /* WXConvert.m in Sources */,
- B8D66BA82125572F003960BD /* string_table.cc in Sources */,
DCA445751EFA55B300D0CFA8 /* WXUtility.m in Sources */,
74B81AEA1F73C3E900D3A61D /* WXRecycleListUpdateManager.m in Sources */,
74B81AF01F73C3E900D3A61D /* WXComponent+DataBinding.mm in Sources */,
@@ -3837,7 +3296,6 @@
DCA445761EFA55B300D0CFA8 /* WXLog.m in Sources */,
DCA445771EFA55B300D0CFA8 /* WXWeakObjectWrapper.m in Sources */,
B8D66C9621255730003960BD /* dom_wson.cpp in Sources */,
- B8F2C70D2133A83C00635B37 /* rax_parser.cc in Sources */,
DCA445781EFA55B300D0CFA8 /* NSArray+Weex.m in Sources */,
DCA445791EFA55B300D0CFA8 /* WXThreadSafeCounter.m in Sources */,
DCA4457A1EFA55B300D0CFA8 /* WXSimulatorShortcutManager.m in Sources */,
@@ -3863,15 +3321,11 @@
DCA4458B1EFA55B300D0CFA8 /* JSValue+Weex.m in Sources */,
B8D66C3A21255730003960BD /* render_action_layout.cpp in Sources */,
DCA4458C1EFA55B300D0CFA8 /* WXServiceFactory.m in Sources */,
- B8D66BF62125572F003960BD /* token.cc in Sources */,
DCA4458D1EFA55B300D0CFA8 /* WXInvocationConfig.m in Sources */,
DCA4458E1EFA55B300D0CFA8 /* WXDatePickerManager.m in Sources */,
DCA4458F1EFA55B300D0CFA8 /* WXSDKManager.m in Sources */,
- B8F2C6F52133A83C00635B37 /* rax_parser_statistics.cc in Sources */,
DCA445901EFA55B300D0CFA8 /* WXBridgeManager.m in Sources */,
B8D66C3821255730003960BD /* render_action_update_attr.cpp in Sources */,
- B8F2C6F12133A83C00635B37 /* rax_jsx_ast.cc in Sources */,
- B8D66BBC2125572F003960BD /* vnode_render_context.cc in Sources */,
DCA445911EFA55B300D0CFA8 /* WXModuleFactory.m in Sources */,
DCA445921EFA55B300D0CFA8 /* WXHandlerFactory.m in Sources */,
DCA445931EFA55B300D0CFA8 /* WXComponentManager.mm in Sources */,
@@ -4095,6 +3549,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_CODE_COVERAGE = NO;
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_COMMA = NO;
@@ -4143,10 +3598,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
- WARNING_CFLAGS = (
- "-Wno-documentation",
- "-Wno-c++14-extensions",
- );
+ WARNING_CFLAGS = "";
};
name = Debug;
};
@@ -4154,6 +3606,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_CODE_COVERAGE = NO;
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_COMMA = NO;
@@ -4201,10 +3654,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
- WARNING_CFLAGS = (
- "-Wno-documentation",
- "-Wno-c++14-extensions",
- );
+ WARNING_CFLAGS = "";
};
name = Release;
};
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index e56e076..f6a8f5a 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -51,6 +51,7 @@
#import "WXJSFrameworkLoadDefaultImpl.h"
#import "WXHandlerFactory.h"
#import "WXExtendCallNativeManager.h"
+#import "WXDataRenderHandler.h"
#define SuppressPerformSelectorLeakWarning(Stuff) \
do { \
@@ -76,9 +77,13 @@ _Pragma("clang diagnostic pop") \
// store service
@property (nonatomic, strong) NSMutableArray *jsServiceQueue;
+@property (nonatomic, readonly) id<WXDataRenderHandler> dataRenderHandler;
+
@end
@implementation WXBridgeContext
+
+@synthesize dataRenderHandler = _dataRenderHandler;
- (instancetype) init
{
@@ -87,6 +92,14 @@ _Pragma("clang diagnostic pop") \
_methodQueue = [NSMutableArray new];
_frameworkLoadFinished = NO;
_jsServiceQueue = [NSMutableArray new];
+ _dataRenderHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXDataRenderHandler)];
+ if (!_dataRenderHandler) {
+ Class handlerClass = NSClassFromString(@"WXEagleHandler");
+ if (handlerClass) {
+ _dataRenderHandler = [[handlerClass alloc] init];
+ [WXSDKEngine registerHandler:_dataRenderHandler withProtocol:@protocol(WXDataRenderHandler)];
+ }
+ }
}
return self;
}
@@ -134,10 +147,14 @@ _Pragma("clang diagnostic pop") \
[WXCoreBridge install];
[_jsBridge registerCallUpdateComponentData:^NSInteger(NSString *instanceId, NSString *componentId, NSString *jsonData) {
-
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData];
- });
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
return 0;
}];
@@ -403,12 +420,16 @@ _Pragma("clang diagnostic pop") \
if (sdkInstance.dataRender && ![options[@"EXEC_JS"] boolValue]) {
WX_MONITOR_INSTANCE_PERF_START(WXFirstScreenJSFExecuteTime, [WXSDKManager instanceForID:instanceIdString]);
WX_MONITOR_INSTANCE_PERF_START(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
-
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge createDataRenderInstance:instanceIdString template:jsBundleString options:options data:data];
- WX_MONITOR_INSTANCE_PERF_END(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
- [sdkInstance.apmInstance onStage:KEY_PAGE_STAGES_LOAD_BUNDLE_END];
- });
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler createPage:instanceIdString template:jsBundleString options:options data:data];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
+ WX_MONITOR_INSTANCE_PERF_END(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
+ [sdkInstance.apmInstance onStage:KEY_PAGE_STAGES_LOAD_BUNDLE_END];
return;
}
@@ -572,12 +593,16 @@ _Pragma("clang diagnostic pop") \
if (sdkInstance.dataRender) {
WX_MONITOR_INSTANCE_PERF_START(WXFirstScreenJSFExecuteTime, [WXSDKManager instanceForID:instanceIdString]);
WX_MONITOR_INSTANCE_PERF_START(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
-
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge createDataRenderInstance:instanceIdString contents:contents options:options data:data];
- WX_MONITOR_INSTANCE_PERF_END(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
- [sdkInstance.apmInstance onStage:KEY_PAGE_STAGES_LOAD_BUNDLE_END];
- });
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler createPage:instanceIdString contents:contents options:options data:data];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
+ WX_MONITOR_INSTANCE_PERF_END(WXPTJSCreateInstance, [WXSDKManager instanceForID:instanceIdString]);
+ [sdkInstance.apmInstance onStage:KEY_PAGE_STAGES_LOAD_BUNDLE_END];
return;
}
}
@@ -698,9 +723,14 @@ _Pragma("clang diagnostic pop") \
WXSDKInstance *sdkInstance = [WXSDKManager instanceForID:instance];
if (sdkInstance.dataRender) {
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge destroyDataRenderInstance:instance];
- });
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler destroyDataRenderInstance:instance];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
}
[self callJSMethod:@"destroyInstance" args:@[instance]];
}
@@ -722,13 +752,18 @@ _Pragma("clang diagnostic pop") \
WXSDKInstance *sdkInstance = [WXSDKManager instanceForID:instance];
if (sdkInstance.dataRender) {
+ if (!_dataRenderHandler) {
+ WXLogError(@"No data render handler found!");
+ return;
+ }
WXPerformBlockOnComponentThread(^{
if ([data isKindOfClass:[NSDictionary class]]) {
- [WXCoreBridge refreshDataRenderInstance:instance data:[WXUtility JSONString:data]];
+ [_dataRenderHandler refreshDataRenderInstance:instance data:[WXUtility JSONString:data]];
} else if ([data isKindOfClass:[NSString class]]) {
- [WXCoreBridge refreshDataRenderInstance:instance data:data];
+ [_dataRenderHandler refreshDataRenderInstance:instance data:data];
}
});
+ [[WXSDKManager bridgeMgr] callJSMethod:@"callJS" args:@[instance, @[@{@"method":@"fireEvent", @"args":@[@"", @"refresh", [WXUtility objectFromJSON:@"[]"], @"", @{@"params":@[@{@"data":data}]}]}]]];
} else {
[self callJSMethod:@"refreshInstance" args:@[instance, data]];
}
@@ -882,7 +917,7 @@ _Pragma("clang diagnostic pop") \
}];
}
}
-
+
- (void)registerModules:(NSDictionary *)modules
{
WXAssertBridgeThread();
@@ -890,9 +925,11 @@ _Pragma("clang diagnostic pop") \
if(!modules) return;
[self callJSMethod:@"registerModules" args:@[modules]];
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge registerModules:modules];
- });
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler registerModules:modules];
+ });
+ }
}
- (void)registerComponents:(NSArray *)components
@@ -902,6 +939,11 @@ _Pragma("clang diagnostic pop") \
if(!components) return;
[self callJSMethod:@"registerComponents" args:@[components]];
+ if (_dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [_dataRenderHandler registerComponents:components];
+ });
+ }
}
- (void)callJSMethod:(NSString *)method args:(NSArray *)args
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
index a90ad75..1b9223c 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
@@ -147,14 +147,6 @@ namespace WeexCore
+ (void)install;
-+ (void)createDataRenderInstance:(NSString *)pageId template:(NSString *)temp options:(NSDictionary *)options data:(id)data;
-
-+ (void)createDataRenderInstance:(NSString *)pageId contents:(NSData *)contents options:(NSDictionary *)options data:(id)data;
-
-+ (void)destroyDataRenderInstance:(NSString *)pageId;
-
-+ (void)refreshDataRenderInstance:(NSString *)pageId data:(NSString *)data;
-
+ (void)setDefaultDimensionIntoRoot:(NSString*)pageId width:(CGFloat)width height:(CGFloat)height
isWidthWrapContent:(BOOL)isWidthWrapContent
isHeightWrapContent:(BOOL)isHeightWrapContent;
@@ -177,8 +169,6 @@ namespace WeexCore
+ (void)removeRenderObjectFromMap:(NSString*)pageId object:(void*)object;
-+ (void)callUpdateComponentData:(NSString*)pageId componentId:(NSString*)componentId jsonData:(NSString*)jsonData;
-
+ (void)callAddElement:(NSString*)pageId parentRef:(NSString*)parentRef data:(NSDictionary*)data index:(int)index;
+ (void)callCreateBody:(NSString*)pageId data:(NSDictionary*)data;
@@ -201,10 +191,6 @@ namespace WeexCore
+ (void)callUpdateFinish:(NSString*)pageId;
-+ (void)fireEvent:(NSString *)pageId ref:(NSString *)ref event:(NSString *)event args:(NSDictionary *)args domChanges:(NSDictionary *)domChanges;
-
-+ (void)registerModules:(NSDictionary *)modules;
-
+ (void)registerComponentAffineType:(NSString *)type asType:(NSString *)baseType;
+ (BOOL)isComponentAffineType:(NSString *)type asType:(NSString *)baseType;
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
index 3446879..ad79980 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
@@ -17,6 +17,7 @@
* under the License.
*/
+#import "WXSDKError.h"
#import "WXCoreBridge.h"
#import "JSValue+Weex.h"
#import "WXSDKManager.h"
@@ -30,6 +31,8 @@
#import "WXConvertUtility.h"
#import "WXSDKEngine.h"
#import "WXAppMonitorProtocol.h"
+#import "WXComponentMethod.h"
+#import "WXExceptionUtils.h"
#include "base/core_constants.h"
#include "base/time_utils.h"
@@ -41,7 +44,6 @@
#include "core/render/node/factory/render_type.h"
#include "core/render/node/factory/render_creator.h"
#include "core/config/core_environment.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
#include "core/bridge/platform/core_side_in_platform.h"
#include "core/bridge/script/core_side_in_script.h"
#include "core/network/http_module.h"
@@ -122,18 +124,36 @@ namespace WeexCore
}
}
- void IOSSide::ReportException(const char* pageId, const char *func, const char *exception_string)
+ void IOSSide::ReportException(const char *page_id, const char *func, const char *exception)
{
- NSString* ns_instanceId = NSSTRING(pageId);
-
- WXComponentManager* manager = [WXSDKManager instanceForID:ns_instanceId].componentManager;
- if (!manager.isValid) {
- return;
- }
-
- int wxErrorCode = 9999;
- NSError * error = [NSError errorWithDomain:WX_ERROR_DOMAIN code:wxErrorCode userInfo:@{@"message":[NSString stringWithUTF8String:exception_string]}];
- [manager renderFailed:error];
+ do {
+ WXSDKInstance *instance = [WXSDKManager instanceForID:NSSTRING(page_id)];
+ if (!instance) {
+ break;
+ }
+ WXSDKErrCode errorCode = WX_KEY_EXCEPTION_DEGRADE;
+ BOOL is_render_failed = NO;
+ if (func && strcmp(func, "createInstance") == 0) {
+ errorCode = WX_KEY_EXCEPTION_EMPTY_SCREEN_JS;
+ WXComponentManager *manager = instance.componentManager;
+ if (manager.isValid) {
+ NSError *error = [NSError errorWithDomain:WX_ERROR_DOMAIN code:errorCode userInfo:@{@"message":[NSString stringWithUTF8String:exception]}];
+ [manager renderFailed:error];
+ }
+ is_render_failed = YES;
+ }
+ NSString *bundleUrl = instance.pageName ? : ([instance.scriptURL absoluteString] ? : @"WX_KEY_EXCEPTION_WXBRIDGE");
+ NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
+ [userInfo setObject:instance.userInfo[@"jsMainBundleStringContentLength"] ? : @"" forKey:@"jsMainBundleStringContentLength"];
+ [userInfo setObject:instance.userInfo[@"jsMainBundleStringContentMd5"] ? : @"" forKey:@"jsMainBundleStringContentMd5"];
+ WXJSExceptionInfo *jsException = [[WXJSExceptionInfo alloc] initWithInstanceId:instance.instanceId bundleUrl:bundleUrl errorCode: [NSString stringWithFormat:@"%d", errorCode] functionName:func ? [NSString stringWithUTF8String:func] :@"exceptionHandler" exception:exception ? [NSString stringWithUTF8String:exception] : @"unkown" userInfo:userInfo];
+ [WXExceptionUtils commitCriticalExceptionRT:jsException.instanceId errCode:jsException.errorCode function:jsException.functionName exception:jsException.exception extParams:jsException.userInfo];
+ if (!is_render_failed && instance.onJSRuntimeException) {
+ instance.onJSRuntimeException(jsException);
+ }
+
+ } while (0);
+
}
int IOSSide::CallNative(const char* pageId, const char *task, const char *callback)
@@ -142,8 +162,27 @@ namespace WeexCore
assert(false);
}
+ static WeexByteArray *generator_bytes_array(const char *str, size_t len) {
+ auto *result = (WeexByteArray *)malloc(len + sizeof(WeexByteArray));
+ do {
+ if (!result) {
+ break;
+ }
+ memset(result, 0, len + sizeof(WeexByteArray));
+ result->length = static_cast<uint32_t>(len);
+ memcpy(result->content, str, len);
+ result->content[len] = '\0';
+
+ } while (0);
+
+ return result;
+ }
+
std::unique_ptr<ValueWithType> IOSSide::CallNativeModule(const char *page_id, const char *module, const char *method, const char *args, int args_length, const char *options, int options_length)
{
+ ValueWithType *returnValue = new ValueWithType();
+ memset(returnValue, 0, sizeof(ValueWithType));
+ returnValue->type = ParamsType::VOID;
// should not enter this function
do {
NSString *instanceId = NSSTRING(page_id);
@@ -160,21 +199,118 @@ namespace WeexCore
}
LOGD("CallNativeModule:[%s]:[%s]=>%s \n", module, method, args);
WXModuleMethod *method = [[WXModuleMethod alloc] initWithModuleName:moduleName methodName:methodName arguments:newArguments options:nil instance:instance];
- [method invoke];
+ NSInvocation *invocation = [method invoke];
+ if (!invocation) {
+ break;
+ }
+ const char *returnType = [invocation.methodSignature methodReturnType];
+ switch (returnType[0] == _C_CONST ? returnType[1] : returnType[0]) {
+ case _C_VOID: {
+ // 1.void
+ returnValue->type = ParamsType::VOID;
+ break;
+ }
+ case _C_ID: {
+ // 2.id
+ void *value;
+ [invocation getReturnValue:&value];
+ id object = (__bridge id)value;
+ if ([object isKindOfClass:[NSString class]]) {
+ returnValue->type = ParamsType::BYTEARRAYSTRING;
+ const char *pcstr_utf8 = [(NSString *)object UTF8String];
+ returnValue->value.byteArray = generator_bytes_array(pcstr_utf8, ((NSString *)object).length);
+ }
+ if ([object isKindOfClass:[NSDictionary class]] || [object isKindOfClass:[NSArray class]]) {
+ NSString *jsonString = [WXUtility JSONString:object];
+ returnValue->type = ParamsType::BYTEARRAYJSONSTRING;
+ returnValue->value.byteArray = generator_bytes_array(jsonString.UTF8String, jsonString.length);
+ }
+ break;
+ }
+#define WX_MODULE_INT32_VALUE_RET_CASE(ctype, ttype) \
+case ctype: { \
+ttype value; \
+[invocation getReturnValue:&value]; \
+returnValue->type = ParamsType::INT32; \
+returnValue->value.int32Value = value; \
+break; \
+}
+#define WX_MODULE_INT64_VALUE_RET_CASE(ctype, ttype) \
+case ctype: { \
+ttype value; \
+[invocation getReturnValue:&value]; \
+returnValue->type = ParamsType::INT64; \
+returnValue->value.int64Value = value; \
+break; \
+}
+ // 3.number
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_CHR, char)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_UCHR, unsigned char)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_SHT, short)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_USHT, unsigned short)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_INT, int)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_UINT, unsigned int)
+ WX_MODULE_INT32_VALUE_RET_CASE(_C_BOOL, BOOL)
+ WX_MODULE_INT64_VALUE_RET_CASE(_C_LNG, long)
+ WX_MODULE_INT64_VALUE_RET_CASE(_C_ULNG, unsigned long)
+ WX_MODULE_INT64_VALUE_RET_CASE(_C_LNG_LNG, long long)
+ WX_MODULE_INT64_VALUE_RET_CASE(_C_ULNG_LNG, unsigned long long)
+ case _C_FLT:
+ {
+ float value;
+ [invocation getReturnValue:&value];
+ returnValue->type = ParamsType::FLOAT;
+ returnValue->value.floatValue = value;
+ break;
+ }
+ case _C_DBL:
+ {
+ double value;
+ [invocation getReturnValue:&value];
+ returnValue->type = ParamsType::DOUBLE;
+ returnValue->value.doubleValue = value;
+ break;
+ }
+ case _C_STRUCT_B:
+ case _C_CHARPTR:
+ case _C_PTR:
+ case _C_CLASS: {
+ returnValue->type = ParamsType::JSUNDEFINED;
+ break;
+ }
+ }
} while (0);
- return std::unique_ptr<ValueWithType>();
+ return std::unique_ptr<ValueWithType>(returnValue);
}
- void IOSSide::CallNativeComponent(const char* pageId, const char* ref, const char *method,
- const char *arguments, int argumentsLength,
- const char *options, int optionsLength)
+ void IOSSide::CallNativeComponent(const char *page_id, const char *ref, const char *method,
+ const char *args, int args_length,
+ const char *options, int options_length)
{
- // should not enter this function
- assert(false);
+ do {
+ NSString *instanceId = NSSTRING(page_id);
+ WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId];
+ if (!instance) {
+ break;
+ }
+ if (!ref || !method) {
+ break;
+ }
+ NSString *componentRef = [NSString stringWithUTF8String:ref];
+ NSString *methodName = [NSString stringWithUTF8String:method];
+ NSArray *newArguments;
+ if (args && args_length > 0) {
+ NSString *arguments = [NSString stringWithUTF8String:args];
+ newArguments = [WXUtility objectFromJSON:arguments];
+ }
+ WXComponentMethod *method = [[WXComponentMethod alloc] initWithComponentRef:componentRef methodName:methodName arguments:newArguments instance:instance];
+ [method invoke];
+
+ } while (0);
}
-
+
void IOSSide::SetTimeout(const char* callbackID, const char* time)
{
// should not enter this function
@@ -280,7 +416,7 @@ namespace WeexCore
WXLogDebug(@"flexLayout -> action: addEvent ref:%@", ns_ref);
#endif
- WXComponentManager* manager = [WXSDKManager instanceForID:ns_instanceId].componentManager;
+ WXComponentManager *manager = [WXSDKManager instanceForID:ns_instanceId].componentManager;
if (!manager.isValid) {
return -1;
}
@@ -750,60 +886,6 @@ static WeexCore::ScriptBridge* jsBridge = nullptr;
});
}
-+ (void)createDataRenderInstance:(NSString *)pageId template:(NSString *)jsBundleString options:(NSDictionary *)options data:(id)data
-{
- auto node_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
- NSString *optionsString = [WXUtility JSONString:options];
- NSString *dataString = [WXUtility JSONString:data];
-
- node_manager->CreatePage([jsBundleString UTF8String] ?: "", [pageId UTF8String] ?: "", [optionsString UTF8String] ?: "", [dataString UTF8String] ?: "", [=](const char* javascript){
- if (!javascript) {
- return;
- }
- [[WXSDKManager bridgeMgr] createInstanceForJS:pageId template:NSSTRING(javascript) options:options data:data];
- });
-}
-
-+ (void)createDataRenderInstance:(NSString *)pageId contents:(NSData *)contents options:(NSDictionary *)options data:(id)data
-{
- auto node_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
- NSString *optionsString = [WXUtility JSONString:options];
- NSString *dataString = [WXUtility JSONString:data];
- node_manager->CreatePage(static_cast<const char *>(contents.bytes), contents.length, [pageId UTF8String], [optionsString UTF8String], dataString ? [dataString UTF8String] : "", [=](const char* javascript) {
- if (!javascript) {
- return;
- }
- [[WXSDKManager bridgeMgr] createInstanceForJS:pageId template:NSSTRING(javascript) options:options data:data];
- });
-}
-
-+ (void)destroyDataRenderInstance:(NSString *)pageId
-{
- auto node_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
- node_manager->ClosePage([pageId UTF8String] ?: "");
-}
-
-+ (void)refreshDataRenderInstance:(NSString *)pageId data:(NSString *)data;
-{
- auto node_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
- node_manager->RefreshPage([pageId UTF8String] ?: "", [data UTF8String] ?: "");
-}
-
-+ (void)fireEvent:(NSString *)pageId ref:(NSString *)ref event:(NSString *)event args:(NSDictionary *)args domChanges:(NSDictionary *)domChanges
-{
- NSString *params = [WXUtility JSONString:args];
- NSString* nsDomChanges = [WXUtility JSONString:domChanges];
- auto vnode_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
- vnode_manager->FireEvent([pageId UTF8String] ? : "", [ref UTF8String] ? : "", [event UTF8String] ? : "", [params UTF8String] ? : "", [nsDomChanges UTF8String] ? : "");
-}
-
-+ (void)registerModules:(NSDictionary *)modules {
- NSString *setting = [WXUtility JSONString:modules];
- if (setting.length > 0) {
- weex::core::data_render::VNodeRenderManager::GetInstance()->RegisterModules([setting UTF8String] ? : "");
- }
-}
-
+ (void)registerComponentAffineType:(NSString *)type asType:(NSString *)baseType
{
WeexCore::RenderCreator::GetInstance()->RegisterAffineType([type UTF8String] ?: "", [baseType UTF8String] ?: "");
@@ -1038,12 +1120,6 @@ static WeexCore::ScriptBridge* jsBridge = nullptr;
return result;
}
-+ (void)callUpdateComponentData:(NSString*)pageId componentId:(NSString*)componentId jsonData:(NSString*)jsonData
-{
- weex::core::data_render::VNodeRenderManager::GetInstance()
- ->UpdateComponentData([pageId UTF8String] ?: "", [componentId UTF8String] ?: "", [jsonData UTF8String] ?: "");
-}
-
+ (void)callAddElement:(NSString*)pageId parentRef:(NSString*)parentRef data:(NSDictionary*)data index:(int)index
{
using namespace WeexCore;
diff --git a/ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h b/ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h
new file mode 100644
index 0000000..08bb818
--- /dev/null
+++ b/ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@protocol WXDataRenderHandler <NSObject>
+
+- (void)createPage:(NSString *)pageId template:(NSString *)jsBundleString options:(NSDictionary *)options data:(id)data;
+
+- (void)createPage:(NSString *)pageId contents:(NSData *)contents options:(NSDictionary *)options data:(id)data;
+
+- (void)callUpdateComponentData:(NSString*)pageId componentId:(NSString*)componentId jsonData:(NSString*)jsonData;
+
+- (void)destroyDataRenderInstance:(NSString *)pageId;
+
+- (void)refreshDataRenderInstance:(NSString *)pageId data:(NSString *)data;
+
+- (void)fireEvent:(NSString *)pageId ref:(NSString *)ref event:(NSString *)event args:(NSDictionary *)args domChanges:(NSDictionary *)domChanges;
+
+- (void)registerModules:(NSDictionary *)modules;
+
+- (void)registerComponents:(NSArray *)components;
+
+- (void)invokeCallBack:(NSString *)pageId function:(NSString *)funcId args:(NSDictionary *)args keepAlive:(BOOL)keepAlive;
+
+- (void)DispatchPageLifecycle:(NSString *)pageId;
+
+@end
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
index afd1f3d..1f531b1 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
@@ -33,6 +33,8 @@
#import "WXThreadSafeMutableArray.h"
#import "WXComponentManager.h"
#import "WXCoreBridge.h"
+#import "WXDataRenderHandler.h"
+#import "WXHandlerFactory.h"
@interface WXBridgeManager ()
@@ -300,7 +302,7 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
- (void)DownloadJS:(NSURL *)scriptUrl completion:(void (^)(NSString *script))complection;
{
- if (!scriptUrl) {
+ if (!scriptUrl || ![scriptUrl.absoluteString length]) {
complection(nil);
return;
}
@@ -415,9 +417,15 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
{
WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId];
if (instance.dataRender) {
- WXPerformBlockOnComponentThread(^{
- [WXCoreBridge fireEvent:instanceId ref:ref event:type args:params?:@{} domChanges:domChanges?:@{}];
- });
+ id<WXDataRenderHandler> dataRenderHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXDataRenderHandler)];
+ if (dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [dataRenderHandler fireEvent:instanceId ref:ref event:type args:params?:@{} domChanges:domChanges?:@{}];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
return;
}
@@ -476,14 +484,25 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
NSArray *args = nil;
if (keepAlive) {
args = @[[funcId copy], params? [params copy]:@"\"{}\"", @true];
- }else {
+ } else {
args = @[[funcId copy], params? [params copy]:@"\"{}\""];
}
WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId];
-
- WXCallJSMethod *method = [[WXCallJSMethod alloc] initWithModuleName:@"jsBridge" methodName:@"callback" arguments:args instance:instance];
- [self callJsMethod:method];
-}
+ if (instance.wlasmRender) {
+ id<WXDataRenderHandler> dataRenderHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXDataRenderHandler)];
+ if (dataRenderHandler) {
+ WXPerformBlockOnComponentThread(^{
+ [dataRenderHandler invokeCallBack:instanceId function:funcId args:params ? [params copy]:@"\"{}\"" keepAlive:keepAlive];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
+ }
+ else {
+ WXCallJSMethod *method = [[WXCallJSMethod alloc] initWithModuleName:@"jsBridge" methodName:@"callback" arguments:args instance:instance];
+ [self callJsMethod:method];
+ }}
- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(id)params
{
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
index 6127745..3ed65c4 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h
@@ -155,6 +155,11 @@ typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code
@property (nonatomic, assign, readonly) BOOL dataRender;
/**
+ * Which decide whether to use binary code render, default value is false
+ */
+@property (nonatomic, assign, readonly) BOOL wlasmRender;
+
+/**
* The callback triggered when the instance fails to render.
*
* @return A block that takes a NSError argument, which is the error occured
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 807ac55..096f155 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -50,6 +50,7 @@
#import "WXSDKInstance_performance.h"
#import "WXPageEventNotifyEvent.h"
#import "WXCoreBridge.h"
+#import <WeexSDK/WXDataRenderHandler.h>
#define WEEX_LITE_URL_SUFFIX @"wlasm"
@@ -246,6 +247,9 @@ typedef enum : NSUInteger {
self.needValidate = [[WXHandlerFactory handlerForProtocol:@protocol(WXValidateProtocol)] needValidate:url];
WXResourceRequest *request = [WXResourceRequest requestWithURL:url resourceType:WXResourceTypeMainBundle referrer:@"" cachePolicy:NSURLRequestUseProtocolCachePolicy];
[self _renderWithRequest:request options:options data:data];
+
+ NSURL* nsURL = [NSURL URLWithString:options[@"DATA_RENDER_JS"]];
+ [self _downloadAndExecScript:nsURL];
}
- (void)renderView:(id)source options:(NSDictionary *)options data:(id)data
@@ -261,6 +265,31 @@ typedef enum : NSUInteger {
} else if ([source isKindOfClass:[NSData class]]) {
[self _renderWithData:source];
}
+ NSURL* nsURL = [NSURL URLWithString:options[@"DATA_RENDER_JS"]];
+ [self _downloadAndExecScript:nsURL];
+}
+
+- (void)_downloadAndExecScript:(NSURL *)url {
+ [[WXSDKManager bridgeMgr] DownloadJS:url completion:^(NSString *script) {
+ if (!script) {
+ return;
+ }
+ if (self.dataRender) {
+ id<WXDataRenderHandler> dataRenderHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXDataRenderHandler)];
+ if (dataRenderHandler) {
+ [[WXSDKManager bridgeMgr] createInstanceForJS:_instanceId template:script options:_options data:_jsData];
+
+ NSString* instanceId = self.instanceId;
+ WXPerformBlockOnComponentThread(^{
+ [dataRenderHandler DispatchPageLifecycle:instanceId];
+ });
+ }
+ else {
+ WXLogError(@"No data render handler found!");
+ }
+ return;
+ }
+ }];
}
- (NSString *) bundleTemplate
@@ -763,6 +792,13 @@ typedef enum : NSUInteger {
return _defaultPixelScaleFactor;
}
}
+
+- (BOOL)wlasmRender {
+ if ([_options[@"WLASM_RENDER"] boolValue]) {
+ return YES;
+ }
+ return NO;
+}
- (BOOL)dataRender
{
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h b/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h
index 25d6f3b..33b5f59 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h
@@ -24,13 +24,13 @@
#define __WX_CONVERT_UTILITY_H__
#if defined __cplusplus
-#include "core/data_render/vnode/vnode_render_manager.h"
+#include <map>
+#include <unordered_map>
+#include <set>
#define NSSTRING(cstr) ((__bridge_transfer NSString*)(CFStringCreateWithCString(NULL, (const char *)(cstr), kCFStringEncodingUTF8)))
#define NSSTRING_NO_COPY(cstr) ((__bridge_transfer NSString*)(CFStringCreateWithCStringNoCopy(NULL, (const char *)(cstr), kCFStringEncodingUTF8, kCFAllocatorNull)))
-id _Nonnull GenValue(weex::core::data_render::Value* _Nonnull value);
-
NSString* _Nullable TO_JSON(id _Nullable object);
id _Nonnull TO_OBJECT(NSString* _Nonnull s);
@@ -41,18 +41,10 @@ NSMutableDictionary* _Nonnull NSDICTIONARY(std::unordered_map<std::string, std::
NSMutableDictionary* _Nonnull NSDICTIONARY(std::vector<std::pair<std::string, std::string>>* _Nullable vec);
-NSMutableDictionary* _Nonnull NSDICTIONARY(const std::unordered_map<std::string, weex::core::data_render::VComponent::VNodeRefs>& ref_map);
-
-NSMutableDictionary* _Nonnull NSDICTIONARY(weex::core::data_render::Table* _Nullable table);
-
NSMutableArray* _Nonnull NSARRAY(std::set<std::string>* _Nullable set);
-NSMutableArray* _Nonnull NSARRAY(weex::core::data_render::Array* _Nullable array);
-
NSMutableArray* _Nonnull NSARRAY(std::vector<std::unordered_map<std::string, std::string>> refs);
-NSMutableArray* _Nonnull NSARRAY(const std::vector<weex::core::data_render::Value>& params);
-
void ConvertToCString(id _Nonnull obj, void (^ _Nonnull callback)(const char* _Nullable));
#endif
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.mm b/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.mm
index 4f6fb9b..36346eb 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.mm
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.mm
@@ -20,6 +20,8 @@
#import "WXConvertUtility.h"
#import "WXLog.h"
#import "WXAssert.h"
+#include <vector>
+#include <string>
NSString* const JSONSTRING_SUFFIX = @"\t\n\t\r";
@@ -172,36 +174,6 @@ NSMutableDictionary* NSDICTIONARY(std::vector<std::pair<std::string, std::string
return result;
}
-NSMutableDictionary* NSDICTIONARY(const std::unordered_map<std::string, weex::core::data_render::VComponent::VNodeRefs>& ref_map)
-{
- if (ref_map.size() == 0) {
- return [[NSMutableDictionary alloc] init];
- }
- NSMutableDictionary* dic = [[NSMutableDictionary alloc] initWithCapacity:ref_map.size()];
- for (auto it : ref_map) {
- if (it.first.empty()) {
- continue;
- }
- [dic setObject:NSARRAY(it.second) forKey:NSSTRING(it.first.c_str())];
- }
- return dic;
-}
-
-NSMutableDictionary* NSDICTIONARY(weex::core::data_render::Table* table)
-{
- if (table == nullptr || table->map.size() == 0)
- return [[NSMutableDictionary alloc] init];
-
- NSMutableDictionary* dic = [[NSMutableDictionary alloc] initWithCapacity:table->map.size()];
- for (auto it=table->map.begin(); it!=table->map.end(); ++it) {
- if (it->first.empty()) {
- continue;
- };
- [dic setObject:GenValue(&it->second) forKey:NSSTRING(it->first.c_str())];
- }
- return dic;
-}
-
NSMutableArray* NSARRAY(std::set<std::string>* set)
{
if (set == nullptr || set->size() == 0)
@@ -217,18 +189,6 @@ NSMutableArray* NSARRAY(std::set<std::string>* set)
return result;
}
-NSMutableArray* NSARRAY(weex::core::data_render::Array* array)
-{
- if (array == nullptr || array->items.size() == 0)
- return [[NSMutableArray alloc] init];
-
- NSMutableArray* ns_array = [[NSMutableArray alloc] initWithCapacity:array->items.size()];
- for (auto it=array->items.begin(); it!=array->items.end(); ++it) {
- [ns_array addObject:GenValue(&*it)];
- }
- return ns_array;
-}
-
NSMutableArray* NSARRAY(std::vector<std::unordered_map<std::string, std::string>> refs)
{
if (refs.size() == 0)
@@ -241,39 +201,6 @@ NSMutableArray* NSARRAY(std::vector<std::unordered_map<std::string, std::string>
return ns_array;
}
-NSMutableArray* NSARRAY(const std::vector<weex::core::data_render::Value>& params)
-{
- if (params.size() == 0) {
- return [[NSMutableArray alloc] init];
- }
- NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity:params.size()];
- for (auto it : params) {
- [array addObject:GenValue(&it)];
- }
- return array;
-}
-
-id GenValue(weex::core::data_render::Value* value)
-{
- switch (value->type) {
- case weex::core::data_render::Value::Type::ARRAY:
- return NSARRAY( weex::core::data_render::ValueTo<weex::core::data_render::Array>(value));
- case weex::core::data_render::Value::Type::TABLE:
- return NSDICTIONARY( weex::core::data_render::ValueTo<weex::core::data_render::Table>(value));
- case weex::core::data_render::Value::Type::INT:
- return [NSNumber numberWithLong:
- static_cast<long>(value->i)];
- case weex::core::data_render::Value::Type::NUMBER:
- return [NSNumber numberWithDouble:value->n];
- case weex::core::data_render::Value::Type::STRING:
- return NSSTRING(value->str->c_str());
- case weex::core::data_render::Value::Type::BOOL:
- return [NSNumber numberWithBool:value->b];
- default:
- return [NSNull null];
- }
-}
-
void ConvertToCString(id _Nonnull obj, void (^callback)(const char*))
{
if ([obj isKindOfClass:[NSString class]]) {
diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h
index 0e02d3a..bb97707 100644
--- a/ios/sdk/WeexSDK/Sources/WeexSDK.h
+++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h
@@ -63,6 +63,8 @@
#import "WXErrorView.h"
#import "WXDefine.h"
#import "WXDebugTool.h"
+#import "WXDataRenderHandler.h"
+#import "WXConvertUtility.h"
#import "WXConvert.h"
#import "WXConfigCenterProtocol.h"
#import "WXComponentManager.h"
diff --git a/ios/sdk/buildScripts.sh b/ios/sdk/buildScripts.sh
index 905dbbe..0167336 100644
--- a/ios/sdk/buildScripts.sh
+++ b/ios/sdk/buildScripts.sh
@@ -52,13 +52,16 @@ function findHeaders() {
# param 1:projectFilePath
# param 2:searchPattern
# param 3:headerFilePath
-# param 4:externalHeader
+# param 4:sdkName
+# param 5:excludeHeaders
+# param 6:externalHeader
function generateImport() {
projectFilePath=$1
searchPattern=$2
headerFilePath=$3
sdkName=$4
- externalHeader=$5
+ excludeHeaders=$5
+ externalHeader=$6
if [[ $externalHeader ]]; then
if [ "$searchPattern" = 'Private' ]; then
@@ -78,6 +81,17 @@ function generateImport() {
if [ "$header" = "${sdkName}.h" ];then
continue
fi
+
+ exclude="no"
+ for excludeHeader in ${excludeHeaders[@]}; do
+ if [ "$excludeHeader" = "$header" ]; then
+ exclude='yes'
+ break
+ fi
+ done
+ if [ "$exclude" = "yes" ]; then
+ continue
+ fi
echo "#import \"$header\"" >> $headerFilePath
fi
done
@@ -88,32 +102,37 @@ function generateImport() {
# param 1:projectPath
# param 2:headerFilePath
# param 3:searchPattern
-# param 4:externalHeader
+# param 4:sdkName
+# param 5:excludeHeaders
+# param 6:externalHeader
function generateHeader() {
projectPath=$1
headerFilePath=$2
searchPattern=$3
sdkName=$4
- externalHeader=$5
+ excludeHeaders=$5
+ externalHeader=$6
generateFileHeader $headerFilePath
- generateImport $projectPath $searchPattern $headerFilePath $sdkName $externalHeader
+ generateImport $projectPath $searchPattern $headerFilePath $sdkName "${excludeHeaders}" $externalHeader
generateFileFooter $headerFilePath
return 0
}
# generateSDKHeader
# param 1: sdkName
-# param 2:supportPrivate
+# param 2:excludeHeaders
+# param 3:supportPrivate
function generateSDKHeader() {
sdkName=$1
- supportPrivate=$2
+ excludeHeaders=$2
+ supportPrivate=$3
headerFilePath="${PROJECT_DIR}/${sdkName}/Sources"
publicHeaderFilePath="${headerFilePath}/${sdkName}.h"
if [ -f "$publicHeaderFilePath" ]; then
rm $publicHeaderFilePath
fi
- generateHeader "${PROJECT_DIR}/${PROJECT_NAME}.xcodeproj" "${publicHeaderFilePath}" 'Public' $sdkName
+ generateHeader "${PROJECT_DIR}/${PROJECT_NAME}.xcodeproj" "${publicHeaderFilePath}" 'Public' $sdkName "${excludeHeaders}"
}
# generateBuildTime
diff --git a/weex_core/Source/CMakeLists.txt b/weex_core/Source/CMakeLists.txt
index c535fc7..1efaf07 100644
--- a/weex_core/Source/CMakeLists.txt
+++ b/weex_core/Source/CMakeLists.txt
@@ -71,47 +71,6 @@ set(COMMON_SRCS
./core/bridge/script/core_side_in_script.cpp
./core/parser/dom_wson.cpp
- ./core/data_render/ast.cc
- ./core/data_render/ast_builder.cc
- ./core/data_render/ast_factory.cc
- ./core/data_render/class.cc
- ./core/data_render/class_array.cc
- ./core/data_render/class_json.cc
- ./core/data_render/class_string.cc
- ./core/data_render/class_factory.cc
- ./core/data_render/class_object.cc
- ./core/data_render/code_generator.cc
- ./core/data_render/exec_state.cc
- ./core/data_render/object.cc
- ./core/data_render/parser.cc
- ./core/data_render/rax_jsx_ast.cc
- ./core/data_render/js_common_function.cc
- ./core/data_render/rax_parser.cc
- ./core/data_render/rax_parser_builder.cc
- ./core/data_render/rax_parser_context.cc
- ./core/data_render/rax_parser_scope.cc
- ./core/data_render/rax_parser_statistics.cc
- ./core/data_render/rax_source_locator.cc
- ./core/data_render/statement.cc
- ./core/data_render/string_table.cc
- ./core/data_render/table.cc
- ./core/data_render/token.cc
- ./core/data_render/tokenizer.cc
- ./core/data_render/vm.cc
- ./core/data_render/binary_file.cc
- ./core/data_render/class_console.cc
- ./core/data_render/class_function.cc
- ./core/data_render/class_math.cc
- ./core/data_render/class_regex.cc
- ./core/data_render/class_window.cc
- ./core/data_render/exec_state_binary.cc
- ./core/data_render/exec_state_section.cc
- ./core/data_render/op_code.cc
- ./core/data_render/vnode/vnode.cc
- ./core/data_render/vnode/vcomponent.cc
- ./core/data_render/vnode/vnode_exec_env.cc
- ./core/data_render/vnode/vnode_render_manager.cc
- ./core/data_render/vnode/vnode_render_context.cc
./core/network/http_module.cc
)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/base)
@@ -164,10 +123,7 @@ if(ANDROID)
./android/wrap/wx_params.cpp
./android/multiprocess/weex_js_connection.cpp
./android/utils/jni_load.cc
-
- ./core/data_render/vnode/android/vcomponent_lifecycle_listener.cc
- ./core/data_render/vnode/android/vnode_on_event_listener.cc
- ./core/data_render/vnode/android/conversion.cc
+ ./core/bridge/eagle_bridge.cpp
./core/network/android/default_request_handler.cc
)
SET(FINAL_ADD_LIBRARY
@@ -196,3 +152,5 @@ endif(ANDROID)
add_library(${WEEXCORE_LIBRARY_NAME} SHARED ${FINAL_ADD_LIBRARY})
target_include_directories(${WEEXCORE_LIBRARY_NAME} PUBLIC .)
target_link_libraries(${WEEXCORE_LIBRARY_NAME} ${FINAL_TARGET_LINK_LIBRARIES})
+# Enable it for smaller so.
+# set_target_properties(${WEEXCORE_LIBRARY_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
diff --git a/weex_core/Source/android/wrap/wx_bridge.cpp b/weex_core/Source/android/wrap/wx_bridge.cpp
index 54ffffc..0d13a0c 100644
--- a/weex_core/Source/android/wrap/wx_bridge.cpp
+++ b/weex_core/Source/android/wrap/wx_bridge.cpp
@@ -36,13 +36,12 @@
#include "base/android/jni/jbytearray_ref.h"
#include "base/android/jniprebuild/jniheader/WXBridge_jni.h"
#include "base/log_defines.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
#include "core/config/core_environment.h"
#include "core/layout/layout.h"
#include "core/layout/measure_func_adapter_impl_android.h"
#include "core/manager/weex_core_manager.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
+#include "core/bridge/eagle_bridge.h"
+#include "third_party/json11/json11.hpp"
using namespace WeexCore;
jlongArray jFirstScreenRenderTime = nullptr;
@@ -616,18 +615,25 @@ static void FireEventOnDataRenderNode(JNIEnv* env, jobject jcaller,
ScopedJStringUTF8 dataChar(env, data);
ScopedJStringUTF8 domChangesChar(env, domChanges);
- try {
- weex::core::data_render::VNodeRenderManager::GetInstance()->FireEvent(
- idChar.getChars(), refChar.getChars(), typeChar.getChars(),
- dataChar.getChars(), domChangesChar.getChars()
- );
- } catch (std::exception &e) {
- auto error = static_cast<weex::core::data_render::Error *>(&e);
- if (error) {
- LOGE("Error on FireEventOnDataRenderNode %s", error->what());
- }
+ WeexCore::EagleBridge::GetInstance()->data_render_handler()->FireEvent(
+ idChar.getChars(), refChar.getChars(), typeChar.getChars(),
+ dataChar.getChars(), domChangesChar.getChars()
+ );
+}
+
+static void InvokeCallbackOnDataRender(JNIEnv* env, jobject jcaller,
+ jstring instanceId, jstring callbackId,
+ jstring data, jboolean keepAlive) {
+ if (instanceId == NULL || callbackId == NULL || data == NULL) {
return;
}
+
+ ScopedJStringUTF8 idChar(env, instanceId);
+ ScopedJStringUTF8 callbackChar(env, callbackId);
+ ScopedJStringUTF8 dataChar(env, data);
+
+ WeexCore::EagleBridge::GetInstance()->data_render_handler()->InvokeCallback(
+ idChar.getChars(), callbackChar.getChars(), dataChar.getChars(),keepAlive);
}
static void RegisterModuleOnDataRenderNode(JNIEnv* env, jobject jcaller,
@@ -638,16 +644,24 @@ static void RegisterModuleOnDataRenderNode(JNIEnv* env, jobject jcaller,
ScopedJStringUTF8 dataChar(env, data);
- try {
- weex::core::data_render::VNodeRenderManager::GetInstance()->RegisterModules(dataChar.getChars());
- } catch (std::exception &e) {
- auto error = static_cast<weex::core::data_render::Error *>(&e);
- if (error) {
- LOGE("Error on RegisterModuleOnDataRenderNode %s", error->what());
+ auto data_render_handler = WeexCore::EagleBridge::GetInstance()->data_render_handler();
+ if(data_render_handler){
+ data_render_handler->RegisterModules(
+ dataChar.getChars());
+ }
+}
- }
+static void RegisterComponentOnDataRenderNode(JNIEnv* env, jobject jcaller,
+ jstring data) {
+ if (data == NULL) {
return;
}
+
+ ScopedJStringUTF8 dataChar(env, data);
+ auto data_render_handler = WeexCore::EagleBridge::GetInstance()->data_render_handler();
+ if(data_render_handler) {
+ data_render_handler->RegisterComponent(dataChar.getChars());
+ }
}
namespace WeexCore {
diff --git a/weex_core/Source/base/android/jniprebuild/jniheader/WXBridge_jni.h b/weex_core/Source/base/android/jniprebuild/jniheader/WXBridge_jni.h
index 637055f..58beb18 100644
--- a/weex_core/Source/base/android/jniprebuild/jniheader/WXBridge_jni.h
+++ b/weex_core/Source/base/android/jniprebuild/jniheader/WXBridge_jni.h
@@ -98,9 +98,17 @@ static void FireEventOnDataRenderNode(JNIEnv* env, jobject jcaller,
jstring data,
jstring domChanges);
+static void InvokeCallbackOnDataRender(JNIEnv* env, jobject jcaller,
+ jstring instanceId,
+ jstring callbackId,
+ jstring data,
+ jboolean keepAlive);
+
static void RegisterModuleOnDataRenderNode(JNIEnv* env, jobject jcaller,
jstring data);
+static void RegisterComponentOnDataRenderNode(JNIEnv* env, jobject jcaller,
+ jstring data);
static void TakeHeapSnapshot(JNIEnv* env, jobject jcaller,
jstring filename);
@@ -1006,20 +1014,33 @@ static const JNINativeMethod kMethodsWXBridge[] = {
"I"
")"
"Ljava/lang/String;", reinterpret_cast<void*>(ExecJSOnInstance) },
- { "nativeFireEventOnDataRenderNode",
-"("
-"Ljava/lang/String;"
-"Ljava/lang/String;"
-"Ljava/lang/String;"
-"Ljava/lang/String;"
-"Ljava/lang/String;"
-")"
-"V", reinterpret_cast<void*>(FireEventOnDataRenderNode) },
- { "nativeRegisterModuleOnDataRenderNode",
-"("
-"Ljava/lang/String;"
-")"
-"V", reinterpret_cast<void*>(RegisterModuleOnDataRenderNode) },
+{ "nativeFireEventOnDataRenderNode",
+ "("
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ ")"
+ "V", reinterpret_cast<void*>(FireEventOnDataRenderNode) },
+{ "nativeInvokeCallbackOnDataRender",
+ "("
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Z"
+ ")"
+ "V", reinterpret_cast<void*>(InvokeCallbackOnDataRender) },
+{ "nativeRegisterModuleOnDataRenderNode",
+ "("
+ "Ljava/lang/String;"
+ ")"
+ "V", reinterpret_cast<void*>(RegisterModuleOnDataRenderNode) },
+{ "nativeRegisterComponentOnDataRenderNode",
+ "("
+ "Ljava/lang/String;"
+ ")"
+ "V", reinterpret_cast<void*>(RegisterComponentOnDataRenderNode) },
{ "nativeTakeHeapSnapshot",
"("
"Ljava/lang/String;"
diff --git a/weex_core/Source/core/bridge/eagle_bridge.cpp b/weex_core/Source/core/bridge/eagle_bridge.cpp
new file mode 100644
index 0000000..8fae64c
--- /dev/null
+++ b/weex_core/Source/core/bridge/eagle_bridge.cpp
@@ -0,0 +1,232 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "core/bridge/eagle_bridge.h"
+#include "base/closure.h"
+#include "core/render/node/render_object.h"
+#include "core/render/node/factory/render_creator.h"
+#include "core/render/manager/render_manager.h"
+#include "core/manager/weex_core_manager.h"
+#include "core/network/http_module.h"
+#include "eagle_bridge.h"
+
+
+namespace WeexCore {
+ EagleBridge *EagleBridge::g_instance = nullptr;
+
+ EagleRenderObject::EagleRenderObject():render_object_impl_(nullptr) {}
+
+ EagleRenderObject::EagleRenderObject(RenderObject* render_object):render_object_impl_(render_object) {}
+
+ void EagleRenderObject::AddAttr(std::string key, std::string value) {
+ render_object_impl_->AddAttr(key, value);
+ }
+
+ void EagleRenderObject::AddStyle(std::string key, std::string value) {
+ render_object_impl_->AddStyle(key, value);
+ }
+
+ void EagleRenderObject::UpdateAttr(std::string key, std::string value) {
+ render_object_impl_->UpdateAttr(key, value);
+ }
+
+ void EagleRenderObject::UpdateStyle(std::string key, std::string value) {
+ render_object_impl_->UpdateStyle(key, value);
+ }
+
+ void EagleRenderObject::AddEvent(std::string event) {
+ render_object_impl_->AddEvent(event);
+ }
+
+ void EagleRenderObject::RemoveEvent(std::string event) {
+ render_object_impl_->RemoveEvent(event);
+ }
+
+ std::set<std::string>* EagleRenderObject::events() {
+ return render_object_impl_->events();
+ }
+
+ void EagleRenderObject::set_page_id(const std::string& page_id) {
+ render_object_impl_->set_page_id(page_id);
+ }
+
+ void EagleRenderObject::ApplyDefaultAttr() {
+ render_object_impl_->ApplyDefaultAttr();
+ }
+
+ void EagleRenderObject::ApplyDefaultStyle() {
+ render_object_impl_->ApplyDefaultStyle();
+ }
+
+ int EagleRenderObject::AddRenderObject(int index, EagleRenderObject child) {
+ if (!render_object_impl_) {
+ return -1;
+ }
+ return render_object_impl_->AddRenderObject(index, child.render_object_impl_);
+ }
+
+ int EagleRenderObject::getChildCount() {
+ return static_cast<int>(render_object_impl_->getChildCount());
+ }
+
+ int EagleRenderObject::getChildIndex(EagleRenderObject child) {
+ return static_cast<int>(render_object_impl_->IndexOf(child.render_object_impl_));
+ }
+
+ EagleRenderObject EagleRenderObject::GetChild(int index) {
+ return render_object_impl_->GetChild(index);
+ }
+
+ EagleRenderObject EagleRenderObject::parent_render(){
+ return render_object_impl_->parent_render();
+ }
+
+ const std::string& EagleRenderObject::page_id(){
+ return render_object_impl_->page_id();
+ }
+
+ const std::string& EagleRenderObject::ref(){
+ return render_object_impl_->ref();
+ }
+
+ void EagleRenderObject::RemoveRenderObject(EagleRenderObject child) {
+ render_object_impl_->RemoveRenderObject(child.render_object_impl_);
+ }
+
+ EagleRenderObject EagleBridge::WeexCoreHandler::GetEagleRenderObject(const std::string &type, const std::string &ref) {
+ return EagleRenderObject(static_cast<WeexCore::RenderObject*>(WeexCore::RenderCreator::GetInstance()->CreateRender(type, ref)));
+ }
+
+ bool EagleBridge::WeexCoreHandler::CreatePage(const std::string& page_id, EagleRenderObject root) {
+ return RenderManager::GetInstance()->CreatePage(page_id, root.render_object_impl_);
+ }
+
+ bool EagleBridge::WeexCoreHandler::HavePage(const std::string& page_id) {
+ return RenderManager::GetInstance()->GetPage(page_id) ? true : false;
+ }
+
+ bool EagleBridge::WeexCoreHandler::CreateFinish(const std::string &page_id) {
+ return RenderManager::GetInstance()->CreateFinish(page_id);
+ }
+
+ bool EagleBridge::WeexCoreHandler::ClosePage(const std::string &page_id) {
+ return RenderManager::GetInstance()->ClosePage(page_id);
+ }
+
+ void EagleBridge::WeexCoreHandler::ReportException(const char* page_id, const char* func, const char* exception_string) {
+ WeexCore::WeexCoreManager::Instance()->getPlatformBridge()->platform_side()->ReportException(page_id, nullptr, exception_string);
+ }
+
+ void EagleBridge::WeexCoreHandler::Send(const char* instance_id, const char* url, std::function<void(const std::string&)> callback) {
+ weex::core::network::HttpModule http_module;
+ http_module.Send(instance_id, url, callback);
+ }
+
+ int EagleBridge::WeexCoreHandler::RefreshFinish(const char* page_id, const char* task, const char* callback) {
+ return WeexCore::WeexCoreManager::Instance()
+ ->getPlatformBridge()
+ ->platform_side()
+ ->RefreshFinish(page_id, task, callback);
+ }
+
+ std::unique_ptr<ValueWithType> EagleBridge::WeexCoreHandler::CallNativeModule(const char* page_id, const char* module, const char* method,const char* arguments, int arguments_length, const char* options, int options_length) {
+ return WeexCoreManager::Instance()
+ ->getPlatformBridge()
+ ->platform_side()
+ ->CallNativeModule(page_id, module, method, arguments, arguments_length, options, options_length);
+ }
+
+ void EagleBridge::WeexCoreHandler::CallNativeComponent(const char* page_id, const char* module, const char* method,const char* arguments, int arguments_length, const char* options, int options_length) {
+ WeexCoreManager::Instance()
+ ->getPlatformBridge()
+ ->platform_side()
+ ->CallNativeComponent(page_id, module, method, arguments, arguments_length, options, options_length);
+ }
+
+ void EagleBridge::WeexCoreHandler::NativeLog(const char* str_array) {
+ WeexCoreManager::Instance()->getPlatformBridge()->platform_side()->NativeLog(str_array);
+ }
+
+ bool EagleBridge::WeexCoreHandler::RemoveRenderObject(const std::string &page_id, const std::string &ref) {
+ return RenderManager::GetInstance()->RemoveRenderObject(page_id, ref);
+ }
+
+ bool EagleBridge::WeexCoreHandler::AddRenderObject(const std::string &page_id, const std::string &parent_ref, int index, EagleRenderObject root) {
+ return RenderManager::GetInstance()->AddRenderObject(page_id, parent_ref, index, root.render_object_impl_);
+ }
+
+ bool EagleBridge::WeexCoreHandler::MoveRenderObject(const std::string &page_id, const std::string &ref,const std::string &parent_ref, int index) {
+ return RenderManager::GetInstance()->MoveRenderObject(page_id, ref, parent_ref, index);
+ }
+
+ bool EagleBridge::WeexCoreHandler::RemoveEvent(const std::string &page_id, const std::string &ref,
+ const std::string &event) {
+ return RenderManager::GetInstance()->RemoveEvent(page_id, ref, event);
+ }
+
+ bool EagleBridge::WeexCoreHandler::AddEvent(const std::string &page_id, const std::string &ref,
+ const std::string &event) {
+ return RenderManager::GetInstance()->AddEvent(page_id, ref, event);
+ }
+
+ bool EagleBridge::WeexCoreHandler::UpdateAttr(const std::string &page_id, const std::string &ref,
+ const char *data) {
+ return RenderManager::GetInstance()->UpdateAttr(page_id, ref, data);
+ }
+
+ bool EagleBridge::WeexCoreHandler::UpdateAttr(const std::string &page_id, const std::string &ref,
+ std::vector<std::pair<std::string, std::string>> *attrPair) {
+ return RenderManager::GetInstance()->UpdateAttr(page_id, ref, attrPair);
+ }
+
+ bool EagleBridge::WeexCoreHandler::UpdateStyle(const std::string &page_id, const std::string &ref,
+ const char *data) {
+ return RenderManager::GetInstance()->UpdateStyle(page_id, ref, data);
+ }
+
+ bool EagleBridge::WeexCoreHandler::UpdateStyle(const std::string &page_id, const std::string &ref,
+ std::vector<std::pair<std::string, std::string>> *stylePair) {
+ return RenderManager::GetInstance()->UpdateStyle(page_id, ref, stylePair);
+ }
+
+ int EagleBridge::WeexCoreHandler::ExecJS(const char *instanceId, const char *nameSpace,
+ const char *func,
+ std::vector<VALUE_WITH_TYPE *> ¶ms){
+ return WeexCore::WeexCoreManager::Instance()->script_bridge()->script_side()->ExecJS(
+ instanceId,
+ nameSpace,
+ func,
+ params
+ );
+ }
+
+ void EagleBridge::WeexCoreHandler::PostTaskToMsgLoop(const weex::base::Closure& closure){
+#ifdef OS_ANDROID
+ WeexCoreManager::Instance()->script_thread()->message_loop()->PostTask(closure);
+#endif
+ }
+
+ int EagleBridge::DataRenderHandler::DestroyInstance(const char *instanceId) {
+ return WeexCoreManager::Instance()
+ ->script_bridge()
+ ->script_side()
+ ->DestroyInstance(instanceId);
+ }
+}
+
diff --git a/weex_core/Source/core/bridge/eagle_bridge.h b/weex_core/Source/core/bridge/eagle_bridge.h
new file mode 100644
index 0000000..a4829f5
--- /dev/null
+++ b/weex_core/Source/core/bridge/eagle_bridge.h
@@ -0,0 +1,149 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef CORE_BRIDGE_EAGLE_BRIDGE_H
+#define CORE_BRIDGE_EAGLE_BRIDGE_H
+
+#if defined __cplusplus
+#include <string>
+#include <functional>
+#include "include/WeexApiHeader.h"
+#include "base/closure.h"
+
+namespace WeexCore {
+ class RenderObject;
+ class DataRenderHandler;
+
+ class EagleRenderObject {
+ public:
+ friend class EagleBridge;
+ EagleRenderObject();
+ EagleRenderObject(RenderObject* render_object);
+ void AddAttr(std::string key, std::string value);
+ void AddStyle(std::string key, std::string value);
+ void UpdateAttr(std::string key, std::string value);
+ void UpdateStyle(std::string key, std::string value);
+ void AddEvent(std::string event);
+ void RemoveEvent(std::string event);
+ std::set<std::string> *events();
+
+ void set_page_id(const std::string& page_id);
+ void ApplyDefaultStyle();
+ void ApplyDefaultAttr();
+ int getChildCount();
+ int getChildIndex(EagleRenderObject child);
+ EagleRenderObject GetChild(int index);
+ EagleRenderObject parent_render();
+ int AddRenderObject(int index, EagleRenderObject child);
+ void RemoveRenderObject(EagleRenderObject child);
+ const std::string& page_id();
+ const std::string& ref();
+
+ bool operator ==(const EagleRenderObject& object) const {
+ return render_object_impl_ == object.render_object_impl_;
+ }
+ explicit operator bool() const
+ {
+ return static_cast<bool>(render_object_impl_);
+ }
+
+ private:
+ RenderObject* render_object_impl_;
+ };
+
+ class EagleBridge {
+ public:
+ class WeexCoreHandler {
+ public:
+ EagleRenderObject GetEagleRenderObject(const std::string &type, const std::string &ref);
+ bool CreatePage(const std::string& page_id, EagleRenderObject root);
+ bool HavePage(const std::string& page_id);
+ bool CreateFinish(const std::string &page_id);
+ bool ClosePage(const std::string &page_id);
+ void ReportException(const char* page_id, const char* func, const char* exception_string);
+ void Send(const char* instance_id, const char* url, std::function<void(const std::string&)> callback);
+ int RefreshFinish(const char* page_id, const char* task, const char* callback);
+ std::unique_ptr<ValueWithType> CallNativeModule (const char* page_id, const char* module, const char* method,const char* arguments, int arguments_length, const char* options, int options_length);
+ void CallNativeComponent (const char* page_id, const char* module, const char* method,const char* arguments, int arguments_length, const char* options, int options_length);
+ void NativeLog(const char* str_array);
+ bool RemoveRenderObject(const std::string &page_id, const std::string &ref);
+ bool AddRenderObject(const std::string &page_id, const std::string &parent_ref, int index,EagleRenderObject root);
+ bool MoveRenderObject(const std::string &page_id, const std::string &ref,const std::string &parent_ref, int index);
+ bool RemoveEvent(const std::string &page_id, const std::string &ref,
+ const std::string &event);
+ bool AddEvent(const std::string &page_id, const std::string &ref,
+ const std::string &event);
+ bool UpdateAttr(const std::string &page_id, const std::string &ref,
+ const char *data);
+
+ bool UpdateAttr(const std::string &page_id, const std::string &ref,
+ std::vector<std::pair<std::string, std::string>> *attrPair);
+
+ bool UpdateStyle(const std::string &page_id, const std::string &ref,
+ const char *data);
+
+ bool UpdateStyle(const std::string &page_id, const std::string &ref,
+ std::vector<std::pair<std::string, std::string>> *stylePair);
+
+ int ExecJS(const char *instanceId, const char *nameSpace,
+ const char *func,
+ std::vector<VALUE_WITH_TYPE *> ¶ms);
+ void PostTaskToMsgLoop(const weex::base::Closure& closure);
+ };
+
+ class DataRenderHandler {
+ public:
+ virtual int DestroyInstance(const char *instanceId);
+ virtual void CreatePage(const std::string &input, const std::string &page_id, const std::string &options, const std::string &init_data, std::function<void(const char*)> exec_js) {}
+
+ virtual void CreatePage(const char *contents, size_t length, const std::string& page_id, const std::string& options, const std::string& env, const std::string& init_data, std::function<void(const char*)> exec_js) {}
+ virtual bool RefreshPage(const std::string &page_id, const std::string &init_data) {return false;}
+ virtual void UpdateComponentData(const std::string& page_id, const char* cid, const std::string& json_data) {}
+ virtual void FireEvent(const std::string &page_id, const std::string &ref, const std::string &event,const std::string &args,const std::string &dom_changes) {}
+ virtual void InvokeCallback(const std::string& page_id,
+ const std::string& callback_id,
+ const std::string& data,
+ bool keep_alive) {}
+ virtual void RegisterModules(const std::string &modules) {}
+ virtual void RegisterComponent(const std::string &str) {};
+ virtual void DispatchPageLifecycle(const std::string &page_id) {};
+ };
+
+ static EagleBridge* GetInstance() {
+ if (!g_instance) {
+ g_instance = new EagleBridge();
+ }
+ return g_instance;
+ }
+ DataRenderHandler *data_render_handler() const {return data_render_handler_.get();}
+ void set_data_render_handler(DataRenderHandler *data_render_handler) {data_render_handler_.reset(data_render_handler);}
+ WeexCoreHandler* weex_core_handler() const {return weex_core_handler_.get();}
+
+
+ private:
+ EagleBridge() : weex_core_handler_(new WeexCoreHandler()) {}
+ static EagleBridge *g_instance;
+ std::unique_ptr<DataRenderHandler> data_render_handler_;
+ std::unique_ptr<WeexCoreHandler> weex_core_handler_;
+ };
+
+}
+
+#endif
+#endif
diff --git a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
index 022dffc..833b3a0 100644
--- a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
+++ b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
@@ -21,7 +21,6 @@
#include "base/string_util.h"
#include "base/log_defines.h"
#include "core/config/core_environment.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
#include "core/manager/weex_core_manager.h"
#include "core/render/manager/render_manager.h"
#include "core/render/node/factory/render_creator.h"
@@ -29,6 +28,8 @@
#include "core/render/node/render_list.h"
#include "core/render/node/render_object.h"
#include "core/render/page/render_page.h"
+#include "core/bridge/eagle_bridge.h"
+#include "third_party/json11/json11.hpp"
namespace WeexCore {
@@ -311,10 +312,6 @@ void CoreSideInPlatform::AddOption(const std::string &key,
int CoreSideInPlatform::RefreshInstance(
const char *instanceId, const char *nameSpace, const char *func,
std::vector<VALUE_WITH_TYPE *> ¶ms) {
- auto node_manager =
- weex::core::data_render::VNodeRenderManager::GetInstance();
- // First check if page is rendered with data render strategy.
-
if(params.size() < 2)
return false;
@@ -324,7 +321,7 @@ int CoreSideInPlatform::RefreshInstance(
std::string init_data = weex::base::to_utf8(params[1]->value.string->content,
params[1]->value.string->length);
- if (node_manager->RefreshPage(instanceId, init_data)) {
+ if (EagleBridge::GetInstance()->data_render_handler()->RefreshPage(instanceId, init_data)) {
return true;
}
return ExecJS(instanceId, nameSpace, func, params);
@@ -446,18 +443,39 @@ int CoreSideInPlatform::CreateInstance(const char *instanceId, const char *func,
extendsApi.c_str(),params);
};
if (strcmp(render_strategy, "DATA_RENDER") == 0) {
- auto node_manager =
- weex::core::data_render::VNodeRenderManager::GetInstance();
- node_manager->CreatePage(script, instanceId, render_strategy, initData,
- exec_js);
+ EagleBridge::GetInstance()->data_render_handler()->CreatePage(script, instanceId, render_strategy, initData, exec_js);
return true;
} else if (strcmp(render_strategy, "DATA_RENDER_BINARY") == 0) {
- auto node_manager =
- weex::core::data_render::VNodeRenderManager::GetInstance();
- node_manager->CreatePage(script, script_length, instanceId,
- render_strategy, initData, exec_js);
-
+ std::string error;
+ std::string env_str;
+ std::string option = "{}";
+ auto opts_json_value = json11::Json::parse(opts, error);
+ if (error.empty()) {
+ auto env_obj = opts_json_value["env"];
+ auto bundleUrl = opts_json_value["bundleUrl"];
+ env_str = "";
+ if (env_obj.is_object()) {
+ const json11::Json& options = env_obj["options"];
+ const json11::Json::object& options_obj = options.object_items();
+ json11::Json::object new_env{
+ env_obj.object_items()
+ };
+ for(auto &it :options_obj){
+ new_env[it.first] = it.second;
+ }
+ env_str = json11::Json(new_env).dump();
+ }
+
+ json11::Json::object new_option{
+ {"bundleUrl", bundleUrl},
+ {"weex", json11::Json::object{
+ {"config",opts_json_value}
+ }}
+ };
+ option = json11::Json(new_option).dump();
+ }
+ EagleBridge::GetInstance()->data_render_handler()->CreatePage(script, static_cast<size_t>(script_length), instanceId, option, env_str, initData, exec_js);
return true;
}
}
@@ -477,15 +495,11 @@ std::unique_ptr<WeexJSResult> CoreSideInPlatform::ExecJSOnInstance(const char *i
}
int CoreSideInPlatform::DestroyInstance(const char *instanceId) {
- auto node_manager =
- weex::core::data_render::VNodeRenderManager::GetInstance();
- if (node_manager->ClosePage(instanceId)) {
- return true;
- }
- return WeexCoreManager::Instance()
- ->script_bridge()
- ->script_side()
- ->DestroyInstance(instanceId);
+ auto handler = EagleBridge::GetInstance()->data_render_handler();
+ if(handler!=nullptr){
+ handler->DestroyInstance(instanceId);
+ }
+ return WeexCoreManager::Instance()->script_bridge()->script_side()->DestroyInstance(instanceId);
}
int CoreSideInPlatform::UpdateGlobalConfig(const char *config) {
diff --git a/weex_core/Source/core/bridge/script/core_side_in_script.cpp b/weex_core/Source/core/bridge/script/core_side_in_script.cpp
index e0bbd40..4bd4694 100644
--- a/weex_core/Source/core/bridge/script/core_side_in_script.cpp
+++ b/weex_core/Source/core/bridge/script/core_side_in_script.cpp
@@ -23,9 +23,9 @@
#include "base/log_defines.h"
#include "base/make_copyable.h"
#include "base/thread/waitable_event.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
#include "core/manager/weex_core_manager.h"
#include "core/render/manager/render_manager.h"
+#include "core/bridge/eagle_bridge.h"
#include "wson/wson_parser.h"
#ifdef OS_ANDROID
#include <base/time_calculator.h>
@@ -469,8 +469,7 @@ void CoreSideInScript::OnReceivedResult(long callback_id,
void CoreSideInScript::UpdateComponentData(const char* page_id,
const char* cid,
const char* json_data) {
- weex::core::data_render::VNodeRenderManager::GetInstance()
- ->UpdateComponentData(page_id, cid, json_data);
+ EagleBridge::GetInstance()->data_render_handler()->UpdateComponentData(page_id, cid, json_data);
}
} // namespace WeexCore
diff --git a/weex_core/Source/core/data_render/ast.cc b/weex_core/Source/core/data_render/ast.cc
deleted file mode 100644
index 64790db..0000000
--- a/weex_core/Source/core/data_render/ast.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include "core/data_render/ast.h"
-#include "core/data_render/ast_visitor.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-#define DEFINE_ACCEPT(type) \
- void type::Accept(ASTVisitor *v, void *data) { v->Visit(this, data); }
-
-AST_NODE_LIST(DEFINE_ACCEPT)
-#undef DEFINE_ACCEPT
-
-const char *type_as_string[(int)ASTNodeType::kNrType] = {
- "kUnknownType",
-#define AS_STRING(type) #type,
- AST_NODE_LIST(AS_STRING)
-#undef AS_STRING
-};
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/ast.h b/weex_core/Source/core/data_render/ast.h
deleted file mode 100644
index c8509f7..0000000
--- a/weex_core/Source/core/data_render/ast.h
+++ /dev/null
@@ -1,695 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef CORE_DATA_RENDER_AST_H_
-#define CORE_DATA_RENDER_AST_H_
-
-#include <assert.h>
-#include <memory>
-#include <vector>
-#include "core/data_render/handle.h"
-#include "core/data_render/rax_parser_scope.h"
-#include "core/data_render/token.h"
-#include "third_party/json11/json11.hpp"
-
-using namespace json11;
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-#ifdef NO_EMIT_FUNCTION
-#define EMIT_FUNCTION
-#else
-#define EMIT_FUNCTION
-#endif
-
-#define DEFINE_NODE_TYPE(Type, Inheritor) \
- public: \
- friend class ASTVisitor; \
- friend class Expression; \
- friend class ASTFactory; \
- Type(const Position &pos, Scope *scope) : Inheritor(pos, scope) {} \
- Type() : Inheritor() {} \
- virtual ~Type() = default; \
- bool Is##Type() const override { return true; } \
- Handle<Type> As##Type() override { \
- return Handle<Type>(dynamic_cast<Type*>(this)); \
- } \
- ASTNodeType type() const override { return ASTNodeType::k##Type; } \
- void Accept(ASTVisitor* visitor, void* data) override; \
- \
- protected: \
- static Handle<Type> Create() { return MakeHandle<Type>(); } \
- static Handle<Type> Create(const Position &pos, Scope *scope) \
- { return MakeHandle<Type>(pos, scope); }
-
-#define AST_NODE_LIST(M) \
- M(ArgumentList) \
- M(IfStatement) \
- M(IfElseStatement) \
- M(ForStatement) \
- M(ContinueStatement) \
- M(BreakStatement) \
- M(CaseStatement) \
- M(SwitchStatement) \
- M(TryCatchStatement) \
- M(BlockStatement) \
- M(FunctionPrototype) \
- M(FunctionStatement) \
- M(StringConstant) \
- M(RegexConstant) \
- M(BinaryExpression) \
- M(TernaryExpression) \
- M(AssignExpression) \
- M(Declaration) \
- M(DeclarationList) \
- M(IntegralConstant) \
- M(DoubleConstant) \
- M(BooleanConstant) \
- M(NullConstant) \
- M(CallExpression) \
- M(MemberExpression) \
- M(Identifier) \
- M(PrefixExpression) \
- M(PostfixExpression) \
- M(ObjectConstant) \
- M(ArrayConstant) \
- M(UndefinedConstant) \
- M(ChunkStatement) \
- M(ReturnStatement) \
- M(LabelledStatement) \
- M(ClassStatement) \
- M(MethodStatement) \
- M(ThisExpression) \
- M(CommaExpression) \
- M(JSXNodeExpression) \
- M(NewExpression) \
- M(ArrowFunctionStatement) \
- M(ClassBody) \
- M(ClassProperty) \
- M(ExpressionList)
-
-class ASTVisitor;
-
-#define FORWARD_DECLARE(Type) class Type;
-
-AST_NODE_LIST(FORWARD_DECLARE)
-
-#undef FORWARD_DECLARE
-
-enum class ASTNodeType {
- kUnknownType,
-#define AST_NODE_TYPE(type) k##type,
- AST_NODE_LIST(AST_NODE_TYPE)
-#undef AST_NODE_TYPE
- kNrType
-};
-
-extern const char *type_as_string[(int)ASTNodeType::kNrType];
-
-class Expression : public RefCountObject {
- protected:
- Expression(const Position &loc, Scope *scope) : locator_{ loc }, scope_{ scope }
- { }
- Expression() {};
-
- public:
- virtual ~Expression() {}
- virtual void Accept(ASTVisitor* visitor, void* data) = 0;
- virtual bool ProduceRValue() { return true; }
- virtual ASTNodeType type() const = 0;
- virtual void SetScope(Scope *scope) { scope_ = scope; }
- virtual Scope *GetScope() { return scope_; }
-
- // helper conversion functions
-#define AS_EXPRESSION_FUNCTION(Type) \
- virtual Handle<Type> As##Type() { assert(0 && "Expression is not " #Type); }
- AST_NODE_LIST(AS_EXPRESSION_FUNCTION)
-#undef AS_EXPRESSION_FUNCTION
-
- // helpful for constant folding
-#define IS_EXPRESSION_FUNCTION(Type) \
- virtual bool Is##Type() const { return false; }
- AST_NODE_LIST(IS_EXPRESSION_FUNCTION)
-#undef IS_EXPRESSION_FUNCTION
-
- private:
- Scope *scope_;
- Position locator_;
-};
-
-using ProxyArray = std::vector<Handle<Expression>>;
-using ProxyObject = std::map<std::string, Handle<Expression>>;
-
-// ExpressionList ::= helper class representing a list of expressions
-class ExpressionList : public Expression {
- public:
- ExpressionList(const std::vector<Handle<Expression>> &exprs)
- : Expression(), exprs_{std::move(exprs)} {}
- using iterator = std::vector<Handle<Expression>>::iterator;
-
- void Insert(Handle<Expression> expr) { exprs_.push_back(expr); }
-
- void Insert(iterator position, Handle<Expression> expr) { exprs_.insert(position, expr); }
-
- size_t Size() { return exprs_.size(); }
-
- std::vector<Handle<Expression>>& raw_list() { return exprs_; }
-
- iterator begin() { return exprs_.begin(); }
- iterator end() { return exprs_.end(); }
-
- DEFINE_NODE_TYPE(ExpressionList, Expression);
-
- private:
- std::vector<Handle<Expression>> exprs_;
-};
-
-class ClassBody : public Expression {
-public:
- using iterator = std::vector<Handle<Expression>>::iterator;
-
- void Insert(Handle<Expression> expr) { body_.push_back(expr); }
-
- size_t Size() { return body_.size(); }
-
- std::vector<Handle<Expression>>& raw_list() { return body_; }
-
- iterator begin() { return body_.begin(); }
- iterator end() { return body_.end(); }
- DEFINE_NODE_TYPE(ClassBody, Expression);
-private:
- std::vector<Handle<Expression>> body_;
-};
-
-class ArgumentList : public Expression {
- public:
- ArgumentList(Handle<ExpressionList> args)
- : Expression(), args_{std::move(args)} {}
- ArgumentList(Position &loc, Scope *scope, Handle<ExpressionList> args)
- : Expression(loc, scope), args_{ std::move(args) } { }
- Handle<ExpressionList> args() { return args_; }
- size_t length() { return args() ? args()->Size() : 0; }
-
- DEFINE_NODE_TYPE(ArgumentList, Expression);
-
- private:
- Handle<ExpressionList> args_;
-};
-
-class Identifier : public Expression {
- private:
- std::string name_;
-
- public:
- Identifier(const std::string& name)
- : Expression(), name_(name) {}
- Identifier(Position &loc, Scope *scope, const std::string &name)
- : Expression(loc, scope), name_(name) { }
- const std::string& GetName() const { return name_; }
- bool ProduceRValue() override { return false; }
- DEFINE_NODE_TYPE(Identifier, Expression);
-};
-
-class StringConstant : public Expression {
- private:
- std::string str_;
-
- public:
- StringConstant(Position &loc, Scope *scope, const std::string &str)
- : Expression(loc, scope), str_(str)
- { }
- StringConstant(const std::string& str)
- : Expression(), str_(str) {}
- std::string& string() { return str_; }
- DEFINE_NODE_TYPE(StringConstant, Expression);
-};
-
-class RegexConstant : public Expression {
- private:
- std::string str_;
- std::string str_flag_;
-
- public:
- RegexConstant(Position &loc, Scope *scope, const std::string &str)
- : Expression(loc, scope)
- {
- auto p = str.find_last_of('$');
- if (p==std::string::npos){
- str_ = str;
- } else {
- str_ = str.substr(0,p);
- str_flag_ = str.substr(p+1);
- }
- }
- RegexConstant(const std::string& str)
- : Expression() {
- auto p = str.find_last_of('$');
- if (p==std::string::npos){
- str_ = str;
- } else {
- str_ = str.substr(0,p);
- str_flag_ = str.substr(p+1);
- }
- }
- std::string& reg() { return str_; }
- std::string& flag() { return str_flag_; }
- DEFINE_NODE_TYPE(RegexConstant, Expression);
-};
-
-class TernaryExpression : public Expression {
- public:
- TernaryExpression(Position &loc, Scope *scope, Handle<Expression> first,
- Handle<Expression> second, Handle<Expression> third)
- : Expression(loc, scope), first_(first), second_(second),
- third_(third) { }
- TernaryExpression(Handle<Expression> first,
- Handle<Expression> second, Handle<Expression> third)
- : Expression(), first_(first), second_(second),
- third_(third) {}
-
- Handle<Expression> first() { return first_; }
- Handle<Expression> second() { return second_; }
- Handle<Expression> third() { return third_; }
- DEFINE_NODE_TYPE(TernaryExpression, Expression);
-
- private:
- Handle<Expression> first_;
- Handle<Expression> second_;
- Handle<Expression> third_;
-};
-
-enum class BinaryOperation {
- kUnknown,
- kAddition,
- kSubtraction,
- kMultiplication,
- kDivision,
- kMod,
- kShiftRight,
- kShiftLeft,
- kShiftZeroRight,
- kLessThan,
- kGreaterThan,
- kLessThanEqual,
- kGreaterThanEqual,
- kEqual,
- kNotEqual,
- kStrictEqual,
- kStrictNotEqual,
- kAnd,
- kOr,
- kBitAnd,
- kBitOr,
- kBitXor,
- kInstanceOf,
- kIn
-};
-
-class BinaryExpression : public Expression {
- DEFINE_NODE_TYPE(BinaryExpression, Expression);
-
- public:
- BinaryExpression(Position &loc, Scope *scope, BinaryOperation op,
- Handle<Expression> lhs, Handle<Expression> rhs)
- : Expression(loc, scope), op_(op), lhs_(lhs), rhs_(rhs) { }
- BinaryExpression(BinaryOperation op, Handle<Expression> lhs,
- Handle<Expression> rhs)
- : Expression(), op_(op), lhs_(lhs), rhs_(rhs) {}
-
-
- BinaryOperation op() { return op_; }
- Handle<Expression> lhs() { return lhs_; }
- Handle<Expression> rhs() { return rhs_; }
-
- private:
- BinaryOperation op_;
- Handle<Expression> lhs_;
- Handle<Expression> rhs_;
-};
-
-enum class DeclarationKind {
- kConst,
-};
-
-class Declaration : public Expression {
- public:
- Declaration(Position &loc, Scope *scope, std::string name, Handle<Expression> init)
- : Expression(loc, scope), name_{ name }, init_{ init } { }
- Declaration(Position &loc, Scope *scope, Handle<Expression> expr, Handle<Expression> init)
- : Expression(loc, scope), expr_{ expr }, init_{ init } { }
- Declaration(std::string name, Handle<Expression> init)
- : Expression(), name_{name}, init_{init} {}
- std::string& name() { return name_; }
- void SetKind(DeclarationKind kind) { kind_ = kind; }
- Handle<Expression> expr() { return init_; }
- DEFINE_NODE_TYPE(Declaration, Expression);
-
- private:
- Handle<Expression> expr_;
- std::string name_;
- Handle<Expression> init_;
- DeclarationKind kind_;
-};
-
-class DeclarationList : public Expression {
- public:
- DeclarationList(Position &loc, Scope *scope,
- std::vector<Handle<Declaration>> exprs)
- : Expression(loc, scope), exprs_{ std::move(exprs) } { }
- DeclarationList(std::vector<Handle<Declaration>> exprs)
- : Expression(), exprs_{std::move(exprs)} {}
-
- std::vector<Handle<Declaration>>& exprs() { return exprs_; }
-
- void Append(Handle<Declaration> decl) {
- exprs_.push_back(Handle<Declaration>(decl));
- }
- DEFINE_NODE_TYPE(DeclarationList, Expression);
-
- private:
- std::vector<Handle<Declaration>> exprs_;
-};
-
-class IntegralConstant : public Expression {
- public:
- IntegralConstant(Position &loc, Scope *scope, int value)
- : Expression(loc, scope), value_(value)
- { }
- IntegralConstant(int value) : Expression(), value_(value) {}
-
- int value() { return value_; }
- DEFINE_NODE_TYPE(IntegralConstant, Expression);
-
- private:
- int value_;
-};
-
-class DoubleConstant : public Expression {
- public:
- DoubleConstant(Position &loc, Scope *scope, double value)
- : Expression(loc, scope), value_(value)
- { }
- DoubleConstant(double value) : Expression(), value_(value) {}
- double value() { return value_; }
- DEFINE_NODE_TYPE(DoubleConstant, Expression);
-
- private:
- double value_;
-};
-
-class BooleanConstant : public Expression {
- bool pred_;
-
- public:
- BooleanConstant(Position &loc, Scope *scope, bool val)
- : Expression(loc, scope), pred_(val) { }
- BooleanConstant(bool val)
- : Expression(), pred_(val) {}
-
- bool pred() { return pred_; }
- DEFINE_NODE_TYPE(BooleanConstant, Expression);
-};
-
-class NullConstant : public Expression {
- public:
- DEFINE_NODE_TYPE(NullConstant, Expression);
-};
-
-enum class MemberAccessKind {
- kCall,
- kClass,
- kDot,
- kIndex,
-};
-
-class MemberExpression : public Expression {
- public:
- MemberExpression(Position &loc, Scope *scope, MemberAccessKind kind,
- Handle<Expression> expr, Handle<Expression> member)
- : Expression(loc, scope), kind_{ kind }, expr_(expr), member_(member) { }
- MemberExpression(MemberAccessKind kind, Handle<Expression> expr,
- Handle<Expression> member)
- : Expression(), kind_{kind}, expr_(expr), member_(member) {}
-
- Handle<Expression> member() { return member_; }
- MemberAccessKind kind() { return kind_; }
- void setKind(MemberAccessKind kind) { kind_ = kind; }
- Handle<Expression> expr() { return expr_; }
- inline bool& is_assignment() { return is_assignment_; }
- bool ProduceRValue() override { return !is_assignment_; }
- DEFINE_NODE_TYPE(MemberExpression, Expression);
-
- private:
- MemberAccessKind kind_;
- Handle<Expression> expr_;
- Handle<Expression> member_;
- bool is_assignment_{false};
-};
-
-class CallExpression : public Expression {
- public:
- CallExpression(Position &loc, Scope *scope, MemberAccessKind kind,
- Handle<Expression> expr, Handle<Expression> args_expr)
- : Expression(loc, scope), kind_{ kind }, expr_(expr), args_expr_(args_expr)
- { }
- CallExpression(Position &loc, Scope *scope, Handle<Expression> callee, Handle<Expression> args_expr)
- : Expression(loc, scope), kind_{MemberAccessKind::kCall}, callee_(callee), args_expr_(args_expr)
- { }
- CallExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> member, std::vector<Handle<Expression>> args)
- : Expression(), kind_{kind}, expr_(expr), member_(member), args_{std::move(args)} {}
- CallExpression(Handle<Expression> callee, std::vector<Handle<Expression>> args)
- : Expression(), kind_{MemberAccessKind::kCall}, callee_(callee), args_{std::move(args)} {}
- Handle<Expression> member() { return member_; }
- Handle<Expression> callee() { return callee_; }
- Handle<Expression> args_expr() { return args_expr_; }
- std::vector<Handle<Expression>>& args() { return args_; }
- MemberAccessKind kind() { return kind_; }
- Handle<Expression> expr() { return expr_; }
- bool ProduceRValue() override { return false; }
- void InsertArgument(Handle<Expression> arg) { args_.push_back(arg); }
- DEFINE_NODE_TYPE(CallExpression, Expression);
-
- private:
- MemberAccessKind kind_;
- Handle<Expression> expr_{nullptr};
- Handle<Expression> member_{nullptr};
- Handle<Expression> callee_{nullptr};
- Handle<Expression> args_expr_{nullptr};
- std::vector<Handle<Expression>> args_;
-};
-
-enum class PrefixOperation {
- kUnknown,
- kIncrement,
- kDecrement,
- kNot,
- kUnfold,
- kTypeof,
-};
-
-class PrefixExpression : public Expression {
- public:
- PrefixExpression(Position &loc, Scope *scope, PrefixOperation op, Handle<Expression> expr)
- : Expression(loc, scope), op_{ op }, expr_{ expr } { }
- PrefixExpression(PrefixOperation op, Handle<Expression> expr)
- : Expression(), op_{op}, expr_{expr} {}
- PrefixOperation op() { return op_; }
- Handle<Expression> expr() { return expr_; }
- DEFINE_NODE_TYPE(PrefixExpression, Expression);
-
- private:
- PrefixOperation op_;
- Handle<Expression> expr_;
-};
-
-enum class PostfixOperation { kIncrement, kDecrement };
-
-class PostfixExpression : public Expression {
- public:
- PostfixExpression(Position &loc, Scope *scope, PostfixOperation op, Handle<Expression> expr)
- : Expression(loc, scope), op_{ op }, expr_{ expr } { }
- PostfixExpression(PostfixOperation op, Handle<Expression> expr)
- : Expression(), op_{op}, expr_{expr} {}
-
- PostfixOperation op() { return op_; }
- Handle<Expression> expr() { return expr_; }
- DEFINE_NODE_TYPE(PostfixExpression, Expression);
-
- private:
- PostfixOperation op_;
- Handle<Expression> expr_;
-};
-
-enum class ProxyOrder { ProxyArray, ProxyObject };
-
-class ObjectConstant : public Expression {
- public:
- ObjectConstant(Position &loc, Scope *scope, ProxyObject props)
- : Expression(loc, scope), Props{ std::move(props) }
- { }
- ObjectConstant(ProxyObject props)
- : Expression(), Props{std::move(props)} {}
-
- ProxyObject& proxy() { return Props; }
- bool IsEmpty() { return Props.empty(); }
- ProxyArray &SpreadProperty() { return spread_property_; };
- std::vector<std::pair<ProxyOrder, std::string>> &Orders() { return orders_; } ;
- ProxyObject::size_type GetPropertyCount() { return Props.size(); }
-
- DEFINE_NODE_TYPE(ObjectConstant, Expression);
-
- private:
- ProxyObject Props;
- ProxyArray spread_property_;
- std::vector<std::pair<ProxyOrder, std::string>> orders_;
-};
-
-class ArrayConstant : public Expression {
- public:
- ArrayConstant(Position &loc, Scope *scope, ProxyArray exprs)
- : Expression(loc, scope), exprs_{ std::move(exprs) } { }
- ArrayConstant(ProxyArray exprs)
- : Expression(), exprs_{std::move(exprs)} {}
-
- ProxyArray& exprs() { return exprs_; }
-
- typename ProxyArray::size_type length() { return exprs_.size(); }
-
- DEFINE_NODE_TYPE(ArrayConstant, Expression);
-
- private:
- ProxyArray exprs_;
-};
-
-enum class AssignOperation {
- kAssign,
- kAssignAdd,
- kAssignSub
-};
-
-class AssignExpression : public Expression {
- public:
- AssignExpression(Position &loc, Scope *scope, Handle<Expression> lhs, Handle<Expression> rhs)
- : Expression(loc, scope), lhs_(lhs), rhs_(rhs) { }
- AssignExpression(Handle<Expression> lhs, Handle<Expression> rhs)
- : Expression(), lhs_(lhs), rhs_(rhs) {}
- Handle<Expression> lhs() { return lhs_; }
- Handle<Expression> rhs() { return rhs_; }
- AssignOperation& op() { return op_; }
- DEFINE_NODE_TYPE(AssignExpression, Expression);
-
- private:
- Handle<Expression> lhs_;
- Handle<Expression> rhs_;
- AssignOperation op_{AssignOperation::kAssign};
-};
-
-class UndefinedConstant : public Expression {
-public:
- UndefinedConstant(Position &loc, Scope *scope)
- : Expression(loc, scope)
- { }
-
- DEFINE_NODE_TYPE(UndefinedConstant, Expression);
-};
-
-class NewExpression : public Expression {
-public:
- NewExpression(Position &loc, Scope *scope, Handle<Expression> name, Handle<ExpressionList> args = nullptr)
- : Expression(loc, scope), name_(name), args_(args) { }
- NewExpression(Handle<Expression> name, Handle<ExpressionList> args = nullptr)
- : Expression(), name_(name), args_(args) { }
-
- Handle<Expression> name() { return name_; }
- Handle<ExpressionList> args() { return args_; }
- bool ProduceRValue() override { return false; }
- DEFINE_NODE_TYPE(NewExpression, Expression);
-private:
- Handle<Expression> name_;
- Handle<ExpressionList> args_;
-};
-
-class ThisExpression : public Expression {
-public:
- ThisExpression(Position &loc, Scope *scope)
- : Expression(loc, scope)
- { }
-
- bool ProduceRValue() override { return false; }
- DEFINE_NODE_TYPE(ThisExpression, Expression);
-};
-
-class CommaExpression : public Expression {
-public:
- CommaExpression(Handle<ExpressionList> exprs)
- : Expression(), exprs_(exprs) {}
- CommaExpression(Position &loc, Scope *scope, Handle<ExpressionList> exprs)
- : Expression(loc, scope), exprs_{ exprs }
- { }
-
- Handle<ExpressionList> exprs() { return exprs_; }
- DEFINE_NODE_TYPE(CommaExpression, Expression);
-private:
- Handle<ExpressionList> exprs_;
-};
-
-class ClassProperty : public Expression {
-public:
- ClassProperty(Position &loc, Scope *scope, std::string name, Handle<Expression> init)
- : Expression(loc, scope), name_(name), init_{init} { }
- inline void set_is_static(bool is_static) { is_static_ = is_static; }
- inline bool is_static() { return is_static_; }
- inline std::string &name() { return name_; }
- inline Handle<Expression>& init() { return init_; }
- DEFINE_NODE_TYPE(ClassProperty, Expression);
-private:
- std::string name_;
- Handle<Expression> init_;
- bool is_static_{false};
-};
-
-class TryCatchStatement : public Expression {
- public:
- TryCatchStatement(Handle<Expression> try_block,
- Handle<Expression> catch_expr, Handle<Expression> catch_block, Handle<Expression> finally)
- : Expression(), try_block_{ try_block }, catch_expr_{ catch_expr },
- catch_block_{ catch_block }, finally_{ finally }
- { }
-
-
- Handle<Expression> try_block() { return try_block_; }
- Handle<Expression> catch_expr() { return catch_expr_; }
- Handle<Expression> catch_block() { return catch_block_; }
- Handle<Expression> finally() { return finally_; }
- DEFINE_NODE_TYPE(TryCatchStatement,Expression);
- private:
- Handle<Expression> try_block_;
- Handle<Expression> catch_expr_;
- Handle<Expression> catch_block_;
- Handle<Expression> finally_;
-};
-
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // CORE_DATA_RENDER_AST_H_
diff --git a/weex_core/Source/core/data_render/ast_builder.cc b/weex_core/Source/core/data_render/ast_builder.cc
deleted file mode 100644
index b3d62dc..0000000
--- a/weex_core/Source/core/data_render/ast_builder.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// Created by pengtao.pt on 2018/7/25.
-//
-
-#include "core/data_render/ast_builder.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-#ifndef DISABLE_COUNTERS
-#define COUNT() ctx_->Counters().Expression()++
-#else
-#define COUNT()
-#endif
-
-Handle<ExpressionList> ASTBuilder::NewExpressionList()
-{
- return (factory()->NewExpressionList());
-}
-
-Handle<ClassBody> ASTBuilder::NewClassBody() {
- return (factory()->NewClassBody());
-}
-
-Handle<ExpressionList> ASTBuilder::NewChunkStatement(Handle<ExpressionList> list) {
- COUNT();
- return save(factory()->NewChunkStatement(locator()->location(), manager()->current(), list));
-}
-
-Handle<Expression> ASTBuilder::NewUndefinedConstant()
-{
- COUNT();
- return save(factory()->NewUndefinedConstant(locator()->location(), manager()->current()));
-}
-
-Handle<Expression> ASTBuilder::NewLabelledStatement(std::string label, Handle<Expression> expr)
-{
- COUNT();
- return save(factory()->NewLabelledStatement(locator()->location(), manager()->current(), label, expr));
-}
-
-Handle<Expression> ASTBuilder::NewTernaryExpression(Handle<Expression> first,
- Handle<Expression> second, Handle<Expression> third)
-{
- COUNT();
- return save(factory()->NewTernaryExpression(locator()->location(), manager()->current(), first, second, third));
-}
-
-Handle<Expression> ASTBuilder::NewDeclaration(std::string name, Handle<Expression> init) {
- COUNT();
- return save(factory()->NewDeclaration(locator()->location(), manager()->current(), name, init));
-}
-
-Handle<Expression> ASTBuilder::NewDeclaration(Handle<Expression> expr, Handle<Expression> init) {
- COUNT();
- return save(factory()->NewDeclaration(locator()->location(), manager()->current(), expr, init));
-}
-
-Handle<Expression> ASTBuilder::NewBinaryExpression(BinaryOperation op,
- Handle<Expression> lhs, Handle<Expression> rhs)
-{
- COUNT();
- return save(factory()->NewBinaryExpression(locator()->location(), manager()->current(), op, lhs, rhs));
-}
-
-Handle<Expression> ASTBuilder::NewAssignExpression(Handle<Expression> lhs, Handle<Expression> rhs)
-{
- COUNT();
- return save(factory()->NewAssignExpression(locator()->location(), manager()->current(), lhs, rhs));
-}
-
-Handle<Expression> ASTBuilder::NewIntegralConstant(int value)
-{
- COUNT();
- return save(factory()->NewIntegralConstant(locator()->location(), manager()->current(), value));
-}
-
-Handle<Expression> ASTBuilder::NewDoubleConstant(double value)
-{
- COUNT();
- return save(factory()->NewDoubleConstant(locator()->location(), manager()->current(), value));
-}
-
-Handle<Expression> ASTBuilder::NewPrefixExpression(PrefixOperation op, Handle<Expression> expr)
-{
- COUNT();
- return save(factory()->NewPrefixExpression(locator()->location(), manager()->current(), op, expr));
-}
-
-Handle<Expression> ASTBuilder::NewNewExpression(Handle<Expression> expr, Handle<ExpressionList> args)
-{
- COUNT();
- return save(factory()->NewNewExpression(locator()->location(), manager()->current(), expr, args));
-}
-
-Handle<Expression> ASTBuilder::NewPostfixExpression(PostfixOperation op,
- Handle<Expression> expr)
-{
- COUNT();
- return save(factory()->NewPostfixExpression(locator()->location(), manager()->current(), op, expr));
-}
-
-Handle<Expression> ASTBuilder::NewIdentifier(std::string name)
-{
- COUNT();
- return save(factory()->NewIdentifier(locator()->location(), manager()->current(), name));
-}
-
-Handle<Expression> ASTBuilder::NewArgumentList(Handle<ExpressionList> args)
-{
- COUNT();
- return save(factory()->NewArgumentList(locator()->location(), manager()->current(), args));
-}
-
-Handle<Expression> ASTBuilder::NewCallExpression(MemberAccessKind kind, Handle<Expression> func, Handle<Expression> args)
-{
- COUNT();
- return save(factory()->NewCallExpression(locator()->location(), manager()->current(), kind, func, args));
-}
-
-Handle<Expression> ASTBuilder::NewCallExpression(Handle<Expression> callee, Handle<Expression> args_expr) {
- COUNT();
- return save(factory()->NewCallExpression(locator()->location(), manager()->current(), callee, args_expr));
-}
-
-Handle<Expression> ASTBuilder::NewMemberExpression(MemberAccessKind kind,
- Handle<Expression> func, Handle<Expression> args)
-{
- COUNT();
- return save(factory()->NewMemberExpression(locator()->location(), manager()->current(), kind, func, args));
-}
-
-Handle<Expression> ASTBuilder::NewCommaExpression(Handle<ExpressionList> list)
-{
- COUNT();
- return save(factory()->NewCommaExpression(locator()->location(), manager()->current(), list));
-}
-
-Handle<Expression> ASTBuilder::NewNullConstant()
-{
- COUNT();
- return save(factory()->NewNullConstant(locator()->location(), manager()->current()));
-}
-
-Handle<Expression> ASTBuilder::NewStringConstant(const std::string &str)
-{
- COUNT();
- return save(factory()->NewStringConstant(locator()->location(), manager()->current(), str));
-}
-
-Handle<Expression> ASTBuilder::NewRegexConstant(const std::string &str)
-{
- COUNT();
- return save(factory()->NewRegexConstant(locator()->location(), manager()->current(), str));
-}
-
-Handle<Expression> ASTBuilder::NewThisExpression()
-{
- COUNT();
- return save(factory()->NewThisExpression(locator()->location(), manager()->current()));
-}
-
-Handle<Expression> ASTBuilder::NewBooleanConstant(bool value)
-{
- COUNT();
- return save(factory()->NewBooleanConstant(locator()->location(), manager()->current(), value));
-}
-
-Handle<Expression> ASTBuilder::NewArrayConstant(ProxyArray arr)
-{
- COUNT();
- return save(factory()->NewArrayConstant(locator()->location(), manager()->current(), std::move(arr)));
-}
-
-Handle<Expression> ASTBuilder::NewObjectConstant(ProxyObject obj)
-{
- COUNT();
- return save(factory()->NewObjectConstant(locator()->location(), manager()->current(), std::move(obj)));
-}
-
-Handle<Expression> ASTBuilder::NewFunctionPrototype(std::string name, std::vector<std::string> args)
-{
- COUNT();
- return save(factory()->NewFunctionPrototype(locator()->location(), manager()->current(), name, std::move(args)));
-}
-
-Handle<Expression> ASTBuilder::NewFunctionStatement(Handle<FunctionPrototype> proto, Handle<Expression> body)
-{
- COUNT();
- return save(factory()->NewFunctionStatement(locator()->location(), manager()->current(), proto, body));
-}
-
-Handle<Expression> ASTBuilder::NewBlockStatement(Handle<ExpressionList> stmts)
-{
- COUNT();
- return save(factory()->NewBlockStatement(locator()->location(), manager()->current(), stmts));
-}
-
-Handle<Expression> ASTBuilder::NewForStatement(ForKind kind, Handle<Expression> init, Handle<Expression> cond, Handle<Expression> update, Handle<Expression> body)
-{
- COUNT();
- return save(factory()->NewForStatement(locator()->location(), manager()->current(), kind, init, cond, update, body));
-}
-
-Handle<Expression> ASTBuilder::NewBreakStatement(Handle<Expression> label)
-{
- COUNT();
- return save(factory()->NewBreakStatement(locator()->location(), manager()->current(), label));
-}
-
-Handle<Expression> ASTBuilder::NewContinueStatement(Handle<Expression> label)
-{
- COUNT();
- return save(factory()->NewContinueStatement(locator()->location(), manager()->current(), label));
-}
-
-Handle<Expression> ASTBuilder::NewIfStatement(Handle<Expression> condition, Handle<Expression> then)
-{
- COUNT();
- return save(factory()->NewIfStatement(locator()->location(), manager()->current(), condition, then));
-}
-
-Handle<Expression> ASTBuilder::NewIfElseStatement(Handle<Expression> condition, Handle<Expression> then, Handle<Expression> els)
-{
- COUNT();
- return save(factory()->NewIfElseStatement(locator()->location(), manager()->current(), condition, then, els));
-}
-
-Handle<Expression> ASTBuilder::NewReturnStatement(Handle<Expression> expr)
-{
- COUNT();
- return save(factory()->NewReturnStatement(locator()->location(), manager()->current(), expr));
-}
-
-Handle<Expression> ASTBuilder::NewArrowFunctionStatement(Handle<Expression> body, std::vector<Handle<Expression>> args)
-{
- COUNT();
- return save(factory()->NewArrowFunctionStatement(locator()->location(), manager()->current(), body, args));
-}
-
-Handle<Expression> ASTBuilder::NewJSXNodeExpression(Handle<Expression> identifier, Handle<Expression> props, Handle<Expression> parent, std::vector<Handle<Expression>> childrens) {
- COUNT();
- return save(factory()->NewJSXNodeExpression(locator()->location(), manager()->current(), identifier, props, parent, childrens));
-}
-
-Handle<Expression> ASTBuilder::NewClassStatement(Handle<Expression> identifier, Handle<Expression> superClass, Handle<Expression> body) {
- COUNT();
- return save(factory()->NewClassStatement(locator()->location(), manager()->current(), identifier, superClass, body));
-}
-
-Handle<Expression> ASTBuilder::NewClassProperty(std::string name, Handle<Expression> init) {
- COUNT();
- return save(factory()->NewClassProperty(locator()->location(), manager()->current(), name, init));
-}
-
-Handle<Expression> ASTBuilder::NewCaseStatement(Handle<Expression> test_case,Handle<ExpressionList> expr) {
- COUNT();
- return save(factory()->NewCaseStatement(locator()->location(), manager()->current(), test_case, expr));
-}
-
-Handle<Expression> ASTBuilder::NewSwitchStatement(Handle<Expression> test_value,
- std::vector<Handle<weex::core::data_render::Expression>> cases) {
- COUNT();
- return save(factory()->NewSwitchStatement(locator()->location(), manager()->current(), test_value, cases));
-}
-Handle<Expression> ASTBuilder::NewTryCatchStatement(Handle<Expression> try_block,
- Handle<weex::core::data_render::Expression> catch_expr,
- Handle<weex::core::data_render::Expression> catch_block,
- Handle<weex::core::data_render::Expression> finally) {
- COUNT();
- return save(factory()->NewTryCatchStatement(locator()->location(), manager()->current(),try_block,catch_expr,catch_block,finally));
-}
-
-}
-}
-}
diff --git a/weex_core/Source/core/data_render/ast_builder.h b/weex_core/Source/core/data_render/ast_builder.h
deleted file mode 100644
index d72961a..0000000
--- a/weex_core/Source/core/data_render/ast_builder.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_RAX_AST_BUILDER_
-#define DATA_RENDER_RAX_AST_BUILDER_
-
-#include "core/data_render/ast_factory.h"
-#include "core/data_render/rax_source_locator.h"
-#include "core/data_render/rax_parser_context.h"
-#include "core/data_render/ast.h"
-#include "core/data_render/rax_parser_scope.h"
-#include <list>
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-class ASTBuilder {
-public:
- ASTBuilder(ParserContext *ctx, ASTFactory *factory,
- SourceLocator *locator, ScopeManager *manager)
- : factory_{ factory }, locator_{ locator }, ctx_{ ctx }, manager_{manager}
- { }
- // creates a heap allocated expression list and return a pointer to it.
- // Helpful for expression which requires list of expression
- Handle<ExpressionList> NewExpressionList();
- Handle<ExpressionList> NewChunkStatement(Handle<ExpressionList> list);
- // create a new node representing undefined
- Handle<Expression> NewUndefinedConstant();
- // create a new node representing JavaScript label statement
- Handle<Expression> NewLabelledStatement(std::string label, Handle<Expression> expr);
- // create a new node representing JavaScript ternary expression
- Handle<Expression> NewTernaryExpression(Handle<Expression> first, Handle<Expression> second, Handle<Expression> third);
- // create a new node representing JavaScript binary expression
- Handle<Expression> NewBinaryExpression(BinaryOperation op, Handle<Expression> lhs, Handle<Expression> rhs);
- // create a new node representing JavaScript assign expression
- Handle<Expression> NewAssignExpression(Handle<Expression> lhs, Handle<Expression> rhs);
- Handle<Expression> NewDeclaration(std::string name, Handle<Expression> init = nullptr);
- Handle<Expression> NewDeclaration(Handle<Expression> expr, Handle<Expression> init = nullptr);
- Handle<Expression> NewIntegralConstant(int value);
- Handle<Expression> NewDoubleConstant(double value);
- // create a new node representing JavaScript prefix operation
- Handle<Expression> NewPrefixExpression(PrefixOperation op, Handle<Expression> expr);
- // create a new node representing JavaScript postfix operation
- Handle<Expression> NewPostfixExpression(PostfixOperation op, Handle<Expression> expr);
- // create a new node representing JavaScript `new` expression
- Handle<Expression> NewNewExpression(Handle<Expression> expr, Handle<ExpressionList> args = nullptr);
- // create a new node representing JavaScript Identifier
- Handle<Expression> NewIdentifier(std::string name);
- // create a new node representing JavaScript argument list
- Handle<Expression> NewArgumentList(Handle<ExpressionList> arg);
- // create a new node representing JavaScript member call
- Handle<Expression> NewCallExpression(MemberAccessKind kind, Handle<Expression> func, Handle<Expression> args);
- // create a new node representing JavaScript member call
- Handle<Expression> NewCallExpression(Handle<Expression> callee, Handle<Expression> args_expr);
- // create a new node representing JavaScript member expression
- Handle<Expression> NewMemberExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> args);
- // create a new node representing JavaScript Comma Expression
- Handle<Expression> NewCommaExpression(Handle<ExpressionList> list);
- // create a new node representing JavaScript 'null'
- Handle<Expression> NewNullConstant();
- // create a new node representing JavaScript string
- Handle<Expression> NewStringConstant(const std::string &str);
-
- Handle<Expression> NewRegexConstant(const std::string &str);
- // create a new node representing JavaScript boolean
- Handle<Expression> NewBooleanConstant(bool value);
- // create a new node representing JavaScript 'this'
- Handle<Expression> NewThisExpression();
- // create a new node representing JavaScript array
- // after passing `arr` to this function, your arr becomes unusable
- Handle<Expression> NewArrayConstant(ProxyArray arr);
- // create a new node representing JavaScript object
- Handle<Expression> NewObjectConstant(ProxyObject obj);
- // create a new node representing JavaScript FunctionPrototype
- Handle<Expression> NewFunctionPrototype(std::string name, std::vector<std::string> args);
- // create a new node representing JavaScript function statement
- // and fuunction expression
- Handle<Expression> NewFunctionStatement(Handle<FunctionPrototype> proto, Handle<Expression> body);
- // create a new node representing JavaScript block statement
- Handle<Expression> NewBlockStatement(Handle<ExpressionList> stmts);
- // create a new node representing JavaScript return statement
- Handle<Expression> NewReturnStatement(Handle<Expression> ret);
- // create a new node representing JavaScript if statement
- Handle<Expression> NewIfStatement(Handle<Expression> condition, Handle<Expression> then);
- // create a new node representing JavaScript if else statement
- Handle<Expression> NewIfElseStatement(Handle<Expression> cond, Handle<Expression> then, Handle<Expression> els);
- // create a new node representing JavaScript for loop
- Handle<Expression> NewForStatement(ForKind kind, Handle<Expression> init, Handle<Expression> cond, Handle<Expression> update, Handle<Expression> body);
- // create a new node representing JavaScript break statement
- Handle<Expression> NewCaseStatement(Handle<Expression> test_case,Handle<ExpressionList> expr);
- Handle<Expression> NewSwitchStatement(Handle<Expression> test_value,std::vector<Handle<Expression>> cases);
- Handle<Expression> NewTryCatchStatement(Handle<Expression> try_block,
- Handle<Expression> catch_expr, Handle<Expression> catch_block, Handle<Expression> finally);
- Handle<Expression> NewBreakStatement(Handle<Expression> label = nullptr);
-
- // create a new node representing JavaScript continue statement
- Handle<Expression> NewContinueStatement(Handle<Expression> label = nullptr);
- Handle<Expression> NewArrowFunctionStatement(Handle<Expression> body, std::vector<Handle<Expression>> args);
- Handle<Expression> NewJSXNodeExpression(Handle<Expression> identifier, Handle<Expression> props, Handle<Expression> parent, std::vector<Handle<Expression>> childrens);
- Handle<Expression> NewClassStatement(Handle<Expression> identifier, Handle<Expression> superClass, Handle<Expression> body);
- Handle<Expression> NewClassProperty(std::string name, Handle<Expression> init = nullptr);
-
- Handle<ClassBody> NewClassBody();
-
- ASTFactory *factory() { return factory_; }
- SourceLocator *locator() { return locator_; }
- ScopeManager *manager() { return manager_; }
-
- template <typename T>
- inline Handle<Expression> save(Handle<T> handle) {
- exprs_.push_back(handle);
- return handle;
- }
-private:
- ASTFactory *factory_;
- SourceLocator *locator_;
- ParserContext *ctx_;
- ScopeManager *manager_;
- std::list<Handle<Expression>> exprs_;
-};
-
-}
-}
-}
-
-#endif
diff --git a/weex_core/Source/core/data_render/ast_factory.cc b/weex_core/Source/core/data_render/ast_factory.cc
deleted file mode 100644
index 3f87e78..0000000
--- a/weex_core/Source/core/data_render/ast_factory.cc
+++ /dev/null
@@ -1,395 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/ast.h"
-#include "core/data_render/ast_factory.h"
-#include "core/data_render/statement.h"
-#include "core/data_render/rax_jsx_ast.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ASTFactory* ASTFactory::GetFactoryInstance() {
- static std::unique_ptr<ASTFactory> factory_instance;
-
- if (!factory_instance) {
- factory_instance.reset(new ASTFactory());
- }
- return factory_instance.get();
-}
-
-Handle<ExpressionList> ASTFactory::NewExpressionList() {
- return MakeHandle<ExpressionList>();
-}
-
-Handle<ExpressionList> ASTFactory::NewExpressionList(const std::vector<Handle<Expression>>& list) {
- return MakeHandle<ExpressionList>(list);
-}
-
-Handle<ClassBody> ASTFactory::NewClassBody() {
- return MakeHandle<ClassBody>();
-}
-
-Handle<Expression> ASTFactory::NewThisExpression() {
- return MakeHandle<ThisExpression>();
-}
-
-Handle<Expression> ASTFactory::NewNewExpression(Handle<Expression> expr, Handle<ExpressionList> args) {
- return MakeHandle<NewExpression>(expr, args);
-}
-
-Handle<Expression> ASTFactory::NewIdentifier(std::string name) {
- return MakeHandle<Identifier>(name);
-}
-
-Handle<Expression> ASTFactory::NewStringConstant(std::string str) {
- return MakeHandle<StringConstant>(str);
-}
-
-Handle<Expression> ASTFactory::NewArgumentList(Handle<ExpressionList> args) {
- return MakeHandle<ArgumentList>(std::move(args));
-}
-
-Handle<Expression> ASTFactory::NewBlockStatement(Handle<ExpressionList> list) {
- Handle<Expression> expr = MakeHandle<BlockStatement>(list);
- return expr;
-}
-Handle<ChunkStatement> ASTFactory::NewChunkStatement(Handle<ExpressionList> list) {
- Handle<ChunkStatement> expr = MakeHandle<ChunkStatement>(list);
- return expr;
-}
-
-Handle<ChunkStatement> ASTFactory::NewChunkStatement(Position &loc, Scope *scope, Handle<ExpressionList> list) {
- Handle<ChunkStatement> expr = MakeHandle<ChunkStatement>(loc, scope, list);
- return expr;
-}
-
-Handle<Expression> ASTFactory::NewFunctionPrototype(std::string name, std::vector<std::string> args) {
- return MakeHandle<FunctionPrototype>(name, std::move(args));
-}
-
-Handle<Expression> ASTFactory::NewFunctionStatement(Handle<FunctionPrototype> proto, Handle<Expression> body) {
- return MakeHandle<FunctionStatement>(proto, body);
-}
-
-Handle<Expression> ASTFactory::NewReturnStatement(Handle<Expression> expr) {
- return MakeHandle<ReturnStatement>(expr);
-}
-
-Handle<Expression> ASTFactory::NewDeclaration(std::string name, Handle<Expression> init) {
- return MakeHandle<Declaration>(name, init);
-}
-
-Handle<Expression> ASTFactory::NewDeclarationList() {
- return MakeHandle<DeclarationList>();
-}
-
-Handle<Expression> ASTFactory::NewDeclarationList(std::vector<Handle<Declaration>> decls) {
- return MakeHandle<DeclarationList>(std::move(decls));
-}
-
-Handle<Expression> ASTFactory::NewCommaExpression(const std::vector<Handle<Expression>>& list) {
- return MakeHandle<CommaExpression>(NewExpressionList(list));
-}
-
-Handle<Expression> ASTFactory::NewBinaryExpression(BinaryOperation op, Handle<Expression> lhs, Handle<Expression> rhs) {
- return MakeHandle<BinaryExpression>(op, lhs, rhs);
-}
-
-Handle<Expression> ASTFactory::NewIntegralConstant(int value) {
- return MakeHandle<IntegralConstant>(value);
-}
-
-Handle<Expression> ASTFactory::NewDoubleConstant(double value) {
- return MakeHandle<DoubleConstant>(value);
-}
-
-Handle<Expression> ASTFactory::NewBooleanConstant(bool value) {
- return MakeHandle<BooleanConstant>(value);
-}
-
-Handle<Expression> ASTFactory::NewNullConstant() {
- return MakeHandle<NullConstant>();
-}
-
-Handle<Expression> ASTFactory::NewCallExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> member, std::vector<Handle<Expression>> args) {
- return MakeHandle<CallExpression>(kind, expr, member, args);
-}
-
-Handle<Expression> ASTFactory::NewCallExpression(Handle<Expression> func, std::vector<Handle<Expression>> args) {
- return MakeHandle<CallExpression>(func, args);
-}
-
-Handle<Expression> ASTFactory::NewMemberExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> mem) {
- return MakeHandle<MemberExpression>(kind, expr, mem);
-}
-
-Handle<Expression> ASTFactory::NewPrefixExpression(PrefixOperation op, Handle<Expression> expr) {
- return MakeHandle<PrefixExpression>(op, expr);
-}
-
-Handle<Expression> ASTFactory::NewPostfixExpression(PostfixOperation op, Handle<Expression> expr) {
- return MakeHandle<PostfixExpression>(op, expr);
-}
-
-Handle<Expression> ASTFactory::NewForStatement(ForKind kind, Handle<Expression> init, Handle<Expression> condition,
- Handle<Expression> update, Handle<Expression> body) {
- return MakeHandle<ForStatement>(kind, init, condition, update, body);
-}
-
-Handle<Expression> ASTFactory::NewObjectConstant(ProxyObject obj) {
- return MakeHandle<ObjectConstant>(std::move(obj));
-}
-
-Handle<Expression> ASTFactory::NewAssignExpression(Handle<Expression> lhs, Handle<Expression> rhs) {
- return MakeHandle<AssignExpression>(lhs, rhs);
-}
-
-Handle<Expression> ASTFactory::NewIfStatement(Handle<Expression> condition, Handle<Expression> then) {
- return MakeHandle<IfStatement>(condition, then);
-}
-
-Handle<Expression> ASTFactory::NewIfElseStatement(Handle<Expression> condition, Handle<Expression> then, Handle<Expression> els)
-{
- return MakeHandle<IfElseStatement>(condition, then, els);
-}
-
-Handle<Expression> ASTFactory::NewUndefinedConstant(Position &loc, Scope *scope)
-{
- return MakeHandle<UndefinedConstant>(loc, scope);
-}
-
-Handle<Expression> ASTFactory::NewLabelledStatement(Position &loc, Scope *scope,
- std::string label, Handle<Expression> stmt)
-{
- return MakeHandle<LabelledStatement>(loc, scope, label, stmt);
-}
-
-Handle<Expression> ASTFactory::NewTernaryExpression(Position &loc, Scope *scope,
- Handle<Expression> first, Handle<Expression> second, Handle<Expression> third)
-{
- return MakeHandle<TernaryExpression>(loc, scope, first, second, third);
-}
-
-Handle<Expression> ASTFactory::NewAssignExpression(Position &loc, Scope *scope,
- Handle<Expression> lhs, Handle<Expression> rhs)
-{
- return MakeHandle<AssignExpression>(loc, scope, lhs, rhs);
-}
-
-Handle<Expression> ASTFactory::NewPrefixExpression(Position &loc, Scope *scope,
- PrefixOperation op, Handle<Expression> expr)
-{
- return MakeHandle<PrefixExpression>(loc, scope, op, expr);
-}
-
-Handle<Expression> ASTFactory::NewPostfixExpression(Position &loc, Scope *scope,
- PostfixOperation op, Handle<Expression> expr)
-{
- return MakeHandle<PostfixExpression>(loc, scope, op, expr);
-}
-
-Handle<Expression> ASTFactory::NewIntegralConstant(Position &loc, Scope *scope, int value)
-{
- return MakeHandle<IntegralConstant>(loc, scope, value);
-}
-Handle<Expression> ASTFactory::NewDoubleConstant(Position &loc, Scope *scope, double value)
-{
- return MakeHandle<DoubleConstant>(loc, scope, value);
-}
-
-Handle<Expression> ASTFactory::NewNewExpression(Position &loc, Scope *scope, Handle<Expression> expr, Handle<ExpressionList> args)
-{
- return MakeHandle<NewExpression>(loc, scope, expr, args);
-}
-
-Handle<Expression> ASTFactory::NewIdentifier(Position &loc, Scope *scope, std::string name)
-{
- return MakeHandle<Identifier>(loc, scope, name);
-}
-
-Handle<Expression> ASTFactory::NewArgumentList(Position &loc, Scope *scope, Handle<ExpressionList> args)
-{
- return MakeHandle<ArgumentList>(loc, scope, std::move(args));
-}
-
-Handle<Expression> ASTFactory::NewCallExpression(Position &loc, Scope *scope, MemberAccessKind kind, Handle<Expression> func, Handle<Expression> args)
-{
- return MakeHandle<CallExpression>(loc, scope, kind, func, args);
-}
-
-Handle<Expression> ASTFactory::NewCallExpression(Position &loc, Scope *scope, Handle<Expression>func, Handle<Expression> args) {
- return MakeHandle<CallExpression>(loc, scope, func, args);
-}
-
-Handle<Expression> ASTFactory::NewNullConstant(Position &loc, Scope *scope)
-{
- return MakeHandle<NullConstant>(loc, scope);
-}
-
-Handle<Expression> ASTFactory::NewStringConstant(Position &loc, Scope *scope, std::string str)
-{
- return MakeHandle<StringConstant>(loc, scope, str);
-}
-
-Handle<Expression> ASTFactory::NewRegexConstant(Position &loc, Scope *scope, std::string str)
-{
- return MakeHandle<RegexConstant>(loc, scope, str);
-}
-
-Handle<Expression> ASTFactory::NewBooleanConstant(Position &loc, Scope *scope, bool val)
-{
- return MakeHandle<BooleanConstant>(loc, scope, val);
-}
-
-Handle<Expression> ASTFactory::NewThisExpression(Position &loc, Scope *scope)
-{
- return MakeHandle<ThisExpression>(loc, scope);
-}
-
-Handle<Expression> ASTFactory::NewArrayConstant(Position &loc, Scope *scope, ProxyArray arr)
-{
- return MakeHandle<ArrayConstant>(loc, scope, std::move(arr));
-}
-
-Handle<Expression> ASTFactory::NewObjectConstant(Position &loc, Scope *scope,
- ProxyObject obj)
-{
- return MakeHandle<ObjectConstant>(loc, scope, std::move(obj));
-}
-
-Handle<Expression> ASTFactory::NewFunctionPrototype(Position &loc, Scope *scope, std::string name, std::vector<std::string> args)
-{
- return MakeHandle<FunctionPrototype>(loc, scope, name, std::move(args));
-}
-
-Handle<Expression> ASTFactory::NewFunctionStatement(Position &loc, Scope *scope, Handle<FunctionPrototype> proto, Handle<Expression> body)
-{
- return MakeHandle<FunctionStatement>(loc, scope, proto, body);
-}
-
-Handle<Expression> ASTFactory::NewBlockStatement(Position &loc, Scope *scope, Handle<ExpressionList> list)
-{
- return MakeHandle<BlockStatement>(loc, scope, list);
-}
-
-Handle<Expression> ASTFactory::NewForStatement(Position &loc, Scope *scope, ForKind kind, Handle<Expression> init, Handle<Expression> condition, Handle<Expression> update, Handle<Expression> body)
-{
- return MakeHandle<ForStatement>(loc, scope, kind, init, condition, update, body);
-}
-
-Handle<Expression> ASTFactory::NewBreakStatement(Position &loc, Scope *scope, Handle<Expression> label)
-{
- return MakeHandle<BreakStatement>(loc, scope, label);
-}
-
-Handle<Expression> ASTFactory::NewContinueStatement(Position &loc, Scope *scope, Handle<Expression> label)
-{
- return MakeHandle<ContinueStatement>(loc, scope, label);
-}
-
-Handle<Expression> ASTFactory::NewIfStatement(Position &loc, Scope *scope, Handle<Expression> condition, Handle<Expression> then)
-{
- return MakeHandle<IfStatement>(loc, scope, condition, then);
-}
-
-Handle<Expression> ASTFactory::NewIfElseStatement(Position &loc, Scope *scope, Handle<Expression> condition, Handle<Expression> then, Handle<Expression> els)
-{
- return MakeHandle<IfElseStatement>(loc, scope, condition, then, els);
-}
-
-Handle<Expression> ASTFactory::NewReturnStatement(Position &loc, Scope *scope, Handle<Expression> expr)
-{
- return MakeHandle<ReturnStatement>(loc, scope, expr);
-}
-
-Handle<Expression> ASTFactory::NewMemberExpression(Position &loc, Scope *scope, MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> mem)
-{
- return MakeHandle<MemberExpression>(loc, scope, kind, expr, mem);
-}
-
-Handle<Expression> ASTFactory::NewCommaExpression(Position &loc, Scope *scope, Handle<ExpressionList> l)
-{
- return MakeHandle<CommaExpression>(loc, scope, l);
-}
-
-Handle<Expression> ASTFactory::NewBinaryExpression(Position &loc, Scope *scope, BinaryOperation op, Handle<Expression> lhs, Handle<Expression> rhs)
-{
- return MakeHandle<BinaryExpression>(loc, scope, op, lhs, rhs);
-}
-
-Handle<Declaration> ASTFactory::NewDeclaration(Position &loc, Scope *scope, std::string name, Handle<Expression> init)
-{
- return MakeHandle<Declaration>(loc, scope, name, init);
-}
-
-Handle<Declaration> ASTFactory::NewDeclaration(Position &loc, Scope *scope, Handle<Expression> expr, Handle<Expression> init)
-{
- return MakeHandle<Declaration>(loc, scope, expr, init);
-}
-
-Handle<Expression> ASTFactory::NewDeclarationList(Position &loc, Scope *scope, std::vector<Handle<Declaration>> decls)
-{
- return MakeHandle<DeclarationList>(loc, scope, std::move(decls));
-}
-
-Handle<Expression> ASTFactory::NewArrowFunctionStatement(Position &loc, Scope *scope, Handle<Expression> body, std::vector<Handle<Expression>> args)
-{
- return MakeHandle<ArrowFunctionStatement>(loc, scope, body, std::move(args));
-}
-
-Handle<Expression> ASTFactory::NewJSXNodeExpression(Position &loc, Scope *scope, Handle<Expression> identifier, Handle<Expression> props, Handle<Expression> parent, std::vector<Handle<Expression>> childrens) {
- return MakeHandle<JSXNodeExpression>(loc, scope, identifier, props, parent, std::move(childrens));
-}
-
-Handle<Expression> ASTFactory::NewClassStatement(Position &loc, Scope *scope, Handle<Expression> identifier, Handle<Expression> superClass, Handle<Expression> body) {
- return MakeHandle<ClassStatement>(loc, scope, identifier, superClass, body);
-}
-
-Handle<Expression> ASTFactory::NewCaseStatement(Position& loc,
- Scope* scope,
- Handle<Expression> test_value,Handle<ExpressionList> expr) {
- return MakeHandle<CaseStatement>(test_value,expr);
-}
-
-Handle<Expression> ASTFactory::NewSwitchStatement(Position& loc,
- Scope* scope,
- Handle<Expression> test_case,
- std::vector<Handle<weex::core::data_render::Expression>> cases) {
- return MakeHandle<SwitchStatement>(test_case,cases);
-}
-
-Handle<Expression> ASTFactory::NewClassProperty(Position &loc, Scope *scope, std::string name, Handle<Expression> init)
-{
- return MakeHandle<ClassProperty>(loc, scope, name, init);
-}
-
-Handle<Expression> ASTFactory::NewTryCatchStatement(Position& loc,
- Scope* scope,
- Handle<Expression> try_block,
- Handle<Expression> catch_expr,
- Handle<Expression> catch_block,
- Handle<Expression> finally) {
- return MakeHandle<TryCatchStatement>(try_block,catch_expr,catch_block,finally);
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/ast_factory.h b/weex_core/Source/core/data_render/ast_factory.h
deleted file mode 100644
index 20bdc2e..0000000
--- a/weex_core/Source/core/data_render/ast_factory.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef CORE_DATA_RENDER_AST_FACTORY_H_
-#define CORE_DATA_RENDER_AST_FACTORY_H_
-
-#include <memory>
-#include <vector>
-#include "core/data_render/ast.h"
-#include "core/data_render/handle.h"
-#include "core/data_render/statement.h"
-#include "core/data_render/rax_jsx_ast.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-class ASTFactory {
- ASTFactory() { }
-public:
- // GetFactoryInstance ::= returns singleton instance of ASTFactory
- static ASTFactory *GetFactoryInstance();
- virtual Handle<ExpressionList> NewExpressionList();
- virtual Handle<ExpressionList> NewExpressionList(const std::vector<Handle<Expression>>& list);
- virtual Handle<ClassBody> NewClassBody();
- virtual Handle<Expression> NewThisExpression();
- virtual Handle<Expression> NewNewExpression(Handle<Expression> expr, Handle<ExpressionList> args = nullptr);
- virtual Handle<Expression> NewIdentifier(std::string name);
- virtual Handle<ChunkStatement> NewChunkStatement(Handle<ExpressionList> list);
- virtual Handle<Expression> NewBlockStatement(Handle<ExpressionList> list);
- virtual Handle<Expression> NewReturnStatement(Handle<Expression> expr);
- virtual Handle<Expression> NewFunctionStatement(Handle<FunctionPrototype> proto, Handle<Expression> body);
- virtual Handle<Expression> NewFunctionPrototype(std::string name, std::vector<std::string> args);
- virtual Handle<Expression> NewArgumentList(Handle<ExpressionList>);
- virtual Handle<Expression> NewStringConstant(std::string str);
- virtual Handle<Expression> NewBinaryExpression(BinaryOperation op, Handle<Expression> lhs, Handle<Expression> rhs);
- virtual Handle<Expression> NewDeclaration(std::string name, Handle<Expression> init = nullptr);
- virtual Handle<Expression> NewDeclarationList(std::vector<Handle<Declaration>> decls);
- virtual Handle<Expression> NewDeclarationList();
- virtual Handle<Expression> NewIntegralConstant(int value);
- virtual Handle<Expression> NewDoubleConstant(double value);
- virtual Handle<Expression> NewBooleanConstant(bool value);
- virtual Handle<Expression> NewNullConstant();
- virtual Handle<Expression> NewCallExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> member, std::vector<Handle<Expression>> args);
- virtual Handle<Expression> NewCommaExpression(const std::vector<Handle<Expression>>& list);
- virtual Handle<Expression> NewCallExpression(Handle<Expression>func, std::vector<Handle<Expression>> args);
- virtual Handle<Expression> NewMemberExpression(MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> mem);
- virtual Handle<Expression> NewPrefixExpression(PrefixOperation op, Handle<Expression> expr);
- virtual Handle<Expression> NewPostfixExpression(PostfixOperation op, Handle<Expression> expr);
- virtual Handle<Expression> NewForStatement(ForKind kind, Handle<Expression> init, Handle<Expression> condition, Handle<Expression> update, Handle<Expression> body);
- virtual Handle<Expression> NewObjectConstant(ProxyObject obj);
- virtual Handle<Expression> NewAssignExpression(Handle<Expression> lhs, Handle<Expression> rhs);
- virtual Handle<Expression> NewIfStatement(Handle<Expression> condition, Handle<Expression> then);
- virtual Handle<Expression> NewIfElseStatement(Handle<Expression> condition, Handle<Expression> then, Handle<Expression> els);
- virtual Handle<ChunkStatement> NewChunkStatement(Position &loc, Scope *scope, Handle<ExpressionList> list);
- virtual Handle<Expression> NewLabelledStatement(Position &loc, Scope *scope, std::string label, Handle<Expression> expr);
- // create a new node representing undefined
- virtual Handle<Expression> NewUndefinedConstant(Position &loc, Scope *scope);
- virtual Handle<Expression> NewTernaryExpression(Position &loc, Scope *scope, Handle<Expression> first, Handle<Expression> second, Handle<Expression> third);
- virtual Handle<Expression> NewBinaryExpression(Position &loc, Scope *scope, BinaryOperation op, Handle<Expression> lhs, Handle<Expression> rhs);
- virtual Handle<Expression> NewAssignExpression(Position &loc, Scope *scope, Handle<Expression> lhs, Handle<Expression> rhs);
- virtual Handle<Expression> NewPrefixExpression(Position &loc, Scope *scope, PrefixOperation op, Handle<Expression> expr);
-
- virtual Handle<Expression> NewPostfixExpression(Position &loc, Scope *scope, PostfixOperation op, Handle<Expression> expr);
- virtual Handle<Expression> NewIntegralConstant(Position &loc, Scope *scope, int value);
- virtual Handle<Expression> NewDoubleConstant(Position &loc, Scope *scope, double value);
- virtual Handle<Expression> NewNewExpression(Position &loc, Scope *scope, Handle<Expression> expr, Handle<ExpressionList> args = nullptr);
- virtual Handle<Expression> NewIdentifier(Position &loc, Scope *scope, std::string name);
- virtual Handle<Expression> NewArgumentList(Position &loc, Scope *scope, Handle<ExpressionList>);
- virtual Handle<Expression> NewCallExpression(Position &loc, Scope *scope, MemberAccessKind kind, Handle<Expression> func, Handle<Expression> args);
- virtual Handle<Expression> NewCallExpression(Position &loc, Scope *scope, Handle<Expression>func, Handle<Expression> args);
- virtual Handle<Expression> NewMemberExpression(Position &loc, Scope *scope, MemberAccessKind kind, Handle<Expression> expr, Handle<Expression> mem);
- virtual Handle<Expression> NewNullConstant(Position &loc, Scope *scope);
- virtual Handle<Expression> NewStringConstant(Position &loc, Scope *scope, std::string str);
- virtual Handle<Expression> NewRegexConstant(Position &loc, Scope *scope, std::string str);
- virtual Handle<Expression> NewThisExpression(Position &loc, Scope *scope);
- virtual Handle<Expression> NewBooleanConstant(Position &loc, Scope *scope, bool val);
- virtual Handle<Expression> NewArrayConstant(Position &loc, Scope *scope, ProxyArray arr);
- virtual Handle<Expression> NewObjectConstant(Position &loc, Scope *scope, ProxyObject obj);
- virtual Handle<Expression> NewFunctionPrototype(Position &loc, Scope *scope, std::string name, std::vector<std::string> args);
- virtual Handle<Expression> NewFunctionStatement(Position &loc, Scope *scope, Handle<FunctionPrototype> proto, Handle<Expression> body);
- virtual Handle<Expression> NewBlockStatement(Position &loc, Scope *scope, Handle<ExpressionList> list);
- virtual Handle<Expression> NewForStatement(Position &loc, Scope *scope, ForKind kind, Handle<Expression> init, Handle<Expression> condition, Handle<Expression> update, Handle<Expression> body);
- virtual Handle<Expression> NewBreakStatement(Position &loc, Scope *scope, Handle<Expression> label = nullptr);
- virtual Handle<Expression> NewCaseStatement(Position &loc, Scope *scope, Handle<Expression> test_value,Handle<ExpressionList> expr);
- virtual Handle<Expression> NewSwitchStatement(Position &loc, Scope *scope, Handle<Expression> test_case, std::vector<Handle<Expression>> cases);
- virtual Handle<Expression> NewTryCatchStatement(Position &loc, Scope *scope,
- Handle<Expression> try_block,
- Handle<Expression> catch_expr,
- Handle<Expression> catch_block,
- Handle<Expression> finally );
- virtual Handle<Expression> NewContinueStatement(Position &loc, Scope *scope, Handle<Expression> label = nullptr);
- virtual Handle<Expression> NewIfStatement(Position &loc, Scope *scope, Handle<Expression> condition, Handle<Expression> then);
- virtual Handle<Expression> NewIfElseStatement(Position &loc, Scope *scope, Handle<Expression> condition, Handle<Expression> then, Handle<Expression> els);
- virtual Handle<Expression> NewReturnStatement(Position &loc, Scope *scope, Handle<Expression> expr);
- virtual Handle<Expression> NewCommaExpression(Position &loc, Scope *scope, Handle<ExpressionList> l);
- virtual Handle<Declaration> NewDeclaration(Position &loc, Scope *scope, std::string name, Handle<Expression> init = nullptr);
- virtual Handle<Declaration> NewDeclaration(Position &loc, Scope *scope, Handle<Expression> expr, Handle<Expression> init = nullptr);
- virtual Handle<Expression> NewDeclarationList(Position &loc, Scope *scope, std::vector<Handle<Declaration>> decls);
- virtual Handle<Expression> NewArrowFunctionStatement(Position &loc, Scope *scope, Handle<Expression> body, std::vector<Handle<Expression>> args);
- virtual Handle<Expression> NewJSXNodeExpression(Position &loc, Scope *scope, Handle<Expression> identifier, Handle<Expression> props, Handle<Expression> parent, std::vector<Handle<Expression>> childrens);
- virtual Handle<Expression> NewClassStatement(Position &loc, Scope *scope, Handle<Expression> identifier, Handle<Expression> superClass, Handle<Expression> body);
- virtual Handle<Expression> NewClassProperty(Position &loc, Scope *scope, std::string name, Handle<Expression> init = nullptr);
-
-};
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // CORE_DATA_RENDER_AST_FACTORY_H_
diff --git a/weex_core/Source/core/data_render/ast_visitor.h b/weex_core/Source/core/data_render/ast_visitor.h
deleted file mode 100644
index 7305645..0000000
--- a/weex_core/Source/core/data_render/ast_visitor.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef CORE_DATA_RENDER_AST_VISITOR_H_
-#define CORE_DATA_RENDER_AST_VISITOR_H_
-
-#include "ast.h"
-#include "core/data_render/statement.h"
-#include "core/data_render/rax_jsx_ast.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-// More strict visitor which wants you to override every visit member
-class BasicASTVisitor {
- public:
- BasicASTVisitor() = default;
- virtual ~BasicASTVisitor() = default;
-
- protected:
-#define DECLARE_VISITOR_METHOD(type) virtual void Visit(type *, void *data) = 0;
- AST_NODE_LIST(DECLARE_VISITOR_METHOD)
-#undef DECLARE_VISITOR_METHOD
-};
-
-// Lesser strict version of above visitor
-class ASTVisitor : public BasicASTVisitor {
- public:
- void visit(Handle<Expression> expr, void *data) { expr->Accept(this, data); }
-#define DECLARE_VISITOR_METHOD(type) \
- void Visit(type *, void *data) override { \
- throw std::runtime_error("Not implemented walker for " #type); \
- }
- AST_NODE_LIST(DECLARE_VISITOR_METHOD)
-#undef DECLARE_VISITOR_METHOD
-};
-
-template <typename NodeType>
-class SingleNodeVisitor {
- public:
- void Visit(NodeType *node){};
-};
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // CORE_DATA_RENDER_AST_VISITOR_H_
diff --git a/weex_core/Source/core/data_render/binary_file.cc b/weex_core/Source/core/data_render/binary_file.cc
deleted file mode 100644
index 549a669..0000000
--- a/weex_core/Source/core/data_render/binary_file.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/binary_file.h"
-#include "core/data_render/common_error.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
- BinaryFile* BinaryFile::g_instance_ = nullptr;
-
- BinaryFile::BinaryFile():fout_(nullptr), position_(0), length_(0) {
- int32_t i=1;
- char *b=(char *)&i;
- if (*b == 1) {
- little_endian_ = true;
- } else {
- little_endian_ = false;
- }
- }
-
- BinaryFile* BinaryFile::instance() {
- if (!g_instance_) {
- g_instance_ = new BinaryFile();
- }
- return g_instance_;
- }
-
- void BinaryFile::set_input(const char* input) {
- input_ = input;
- }
-
- void BinaryFile::set_length(unsigned long length) {
- length_ = length;
- }
-
- void BinaryFile::setWriteFileUrl(const std::string& url) {
- fout_.reset(new std::ofstream(url, std::ios::binary));
- }
-
- void BinaryFile::write(const char *stream, unsigned count) {
- fout_->write(stream, count);
- }
-
- void BinaryFile::read(char *stream, unsigned count) {
- if (position_ + count > length_) {
- throw OpcodeDecodeError("Read data is error");
- }
- if (!little_endian_ && count > 1) {
- for (int i=count-1; i>=0; i--) {
- stream[i] = input_[position_++];
- }
- } else {
- for (int i=0; i<count; i++) {
- stream[i] = input_[position_++];
- }
- }
- }
-
- void BinaryFile::writeFinish() {
- fout_->close();
- }
-
- void BinaryFile::readFinish() {
- position_ = 0;
- length_ = 0;
- input_ = nullptr;
- }
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/binary_file.h b/weex_core/Source/core/data_render/binary_file.h
deleted file mode 100644
index e8a31ac..0000000
--- a/weex_core/Source/core/data_render/binary_file.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef CORE_DATA_RENDER_BINARY_FILE_H_
-#define CORE_DATA_RENDER_BINARY_FILE_H_
-
-#include <fstream>
-#include <memory>
-
-namespace weex {
-namespace core {
-namespace data_render {
- enum Section {
- NULL_SECTION,
- STRING_SECTION,
- TABLE_SECTION,
- FUNCTION_SECTION,
- START_SECTION,
- GLOBAL_SECTION,
- GLOBAL_VARIABLE_SECTION,
- STYLE_SECTION,
- ARRAY_SECTION,
- REF_SECTION,
- CLASS_SECTION
- };
-
- class BinaryFile {
- public:
- static BinaryFile* instance();
- void set_input(const char* input);
- void set_length(unsigned long length);
- void setWriteFileUrl(const std::string& url);
- void write(const char *stream, unsigned count);
- void read(char *stream, unsigned count);
- void writeFinish();
- void readFinish();
- bool eof() {return length_ == position_;}
- private:
- BinaryFile();
-
- static BinaryFile* g_instance_;
- std::unique_ptr<std::ofstream> fout_;
- const char* input_;
- unsigned long position_;
- unsigned long length_;
- bool little_endian_;
- };
-} // namespace data_render
-} // namespace core
-} // namespace weex
-#endif //CORE_DATA_RENDER_BINARY_FILE_H_
diff --git a/weex_core/Source/core/data_render/class.cc b/weex_core/Source/core/data_render/class.cc
deleted file mode 100644
index 24d39a2..0000000
--- a/weex_core/Source/core/data_render/class.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <algorithm>
-#include "core/data_render/class.h"
-#include "core/data_render/rax_jsx_ast.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassDescriptor(ClassDescriptor *p_super) {
- return new ClassDescriptor(p_super);
-}
-
-void AddClassStaticCFunc(ClassDescriptor *p_desc, const std::string& name, CFunction function) {
- Value func;
- func.type = Value::Type::CFUNC;
- func.cf = reinterpret_cast<void *>(function);
- p_desc->statics_->Add(name, func);
-}
-
-void AddClassCFunc(ClassDescriptor *p_desc, const std::string& name, CFunction function) {
- Value func;
- func.type = Value::Type::CFUNC;
- func.cf = reinterpret_cast<void *>(function);
- p_desc->funcs_->Add(name, func);
-}
-
-ClassInstance *NewClassInstance(ClassDescriptor *p_desc) {
- return new ClassInstance(p_desc);
-}
-
-bool FindConstructor(ClassInstance *p_inst, Value *caller, Value *caller_inst) {
- bool constructor = false;
- while (p_inst) {
- int index = p_inst->p_desc_->funcs_->IndexOf(JS_GLOBAL_CONSTRUCTOR);
- if (index >= 0) {
- *caller = *p_inst->p_desc_->funcs_->Find(index);
- SetCIValue(caller_inst, reinterpret_cast<GCObject *>(p_inst));
- constructor = true;
- break;
- }
- p_inst = p_inst->p_super_;
- }
- return constructor;
-}
-
-Value *GetClassMember(ClassInstance *inst,const std::string &name) {
- Value *ret = nullptr;
- do {
- ClassInstance *inst_current = inst;
- while (inst_current) {
- Variables *funcs = inst_current->p_desc_->funcs_.get();
- int index = funcs->IndexOf(name);
- if (index < 0) {
- Variables *vars = inst_current->vars_.get();
- index = vars->IndexOf(name);
- if (index >= 0) {
- ret = vars->Find(index);
- }
- }
- else {
- ret = funcs->Find(index);
- }
- if (ret) {
- break;
- }
- // 构造函数不找super
- if (name == "constructor") {
- break;
- }
- inst_current = inst_current->p_super_;
- }
-
- } while (0);
-
- return ret;
-}
-
-Value *GetClassMemberVar(ClassInstance *inst,const std::string &name) {
- Value *ret = nullptr;
- do {
- Variables *funcs = inst->p_desc_->funcs_.get();
- int index = funcs->IndexOf(name);
- if (index < 0) {
- Variables *vars = inst->vars_.get();
- index = vars->IndexOf(name);
- if (index < 0) {
- Value var;
- SetNil(&var);
- index = vars->Add(name, var);
- }
- ret = vars->Find(index);
- }
- else {
- ret = funcs->Find(index);
- }
-
- } while (0);
-
- return ret;
-}
-
-Value *GetClassStaticMemberVar(ClassDescriptor *desc, const std::string &name) {
- Value *ret = nullptr;
- do {
- Variables *static_vars = desc->statics_.get();
- int index = static_vars->IndexOf(name);
- if (index < 0) {
- Value var;
- index = static_vars->Add(name, var);
- ret = static_vars->Find(index);
- }
- else {
- ret = static_vars->Find(index);
- }
-
- } while (0);
-
- return ret;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class.h b/weex_core/Source/core/data_render/class.h
deleted file mode 100644
index 8118b5f..0000000
--- a/weex_core/Source/core/data_render/class.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_CLASS_H
-#define DATA_RENDER_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassDescriptor(ClassDescriptor *p_super = nullptr);
-
-void AddClassStaticCFunc(ClassDescriptor *p_desc, const std::string& name, CFunction function);
-
-void AddClassCFunc(ClassDescriptor *p_desc, const std::string& name, CFunction function);
-
-bool FindConstructor(ClassInstance *p_inst, Value *caller, Value *caller_inst);
-
-ClassInstance *NewClassInstance(ClassDescriptor *p_desc);
-
-Value *GetClassMember(ClassInstance *inst, const std::string &name);
-Value *GetClassMemberVar(ClassInstance *inst, const std::string &name);
-Value *GetClassStaticMemberVar(ClassDescriptor *desc, const std::string &name);
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_array.cc b/weex_core/Source/core/data_render/class_array.cc
deleted file mode 100644
index 03c32d5..0000000
--- a/weex_core/Source/core/data_render/class_array.cc
+++ /dev/null
@@ -1,302 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <algorithm>
-
-#include "base/log_defines.h"
-#include "core/data_render/object.h"
-#include "core/data_render/class.h"
-#include "core/data_render/class_array.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/table.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value isArray(ExecState *exec_state);
-static Value push(ExecState *exec_state);
-static Value slice(ExecState *exec_state);
-static Value forEach(ExecState *exec_state);
-static Value indexOf(ExecState *exec_state);
-static Value map(ExecState *exec_state);
-
-ClassDescriptor *NewClassArray() {
- ClassDescriptor *array_desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(array_desc, "isArray", isArray);
- AddClassCFunc(array_desc, "push", push);
- AddClassCFunc(array_desc, "slice", slice);
- AddClassCFunc(array_desc, "forEach", forEach);
- AddClassCFunc(array_desc, "indexOf", indexOf);
- AddClassCFunc(array_desc, "map", map);
- return array_desc;
-}
-
-int SetArray(Array *array, Value *index, const Value &val) {
- int ret = 0;
- do {
- if (!IsInt(index)) {
- break;
- }
- int64_t index_of = index->i;
- if (index_of > (int)array->items.size()) {
- break;
- }
- array->items.insert(array->items.begin()+ static_cast<int>(index_of), val);
- GCRetain((Value *)&val);
- ret = true;
-
- } while (0);
-
- return ret;
-}
-
-void ClearArray(Array *array) {
- array->items.clear();
-}
-
-void PushArray(Array *array, Value val) {
- array->items.push_back(val);
-}
-
-int SetArray(Array *array, int index, const Value &val) {
- int ret = 0;
- do {
- if (index >= (int)array->items.size()) {
- array->items.push_back(val);
- }
- else {
- array->items.insert(array->items.begin() + index, val);
- }
- GCRetain((Value *)&val);
- ret = true;
-
- } while (0);
-
- return ret;
-}
-
-Value* GetArrayVar(Array *array, const Value &index) {
- Value *ret = nullptr;
- do {
- if (!IsInt(&index)) {
- break;
- }
- int indexValue = (int)IntValue(&index);
- int size = (int)array->items.size();
- if (indexValue < size) {
- ret = &array->items.at(indexValue);
- }
- else {
- int inserts = indexValue - size + 1;
- for (int i = 0; i < inserts; i++) {
- array->items.push_back(Value());
- }
- ret = &array->items.at(indexValue);
- }
-
- } while (0);
-
- return ret;
-}
-
-Value GetArrayValue(Array *array, const Value &index) {
- Value ret;
- do {
- if (!IsInt(&index)) {
- break;
- }
- int indexValue = (int)IntValue(&index);
- if (indexValue < array->items.size()) {
- ret = array->items.at(indexValue);
- }
-
- } while (0);
-
- return ret;
-}
-
-Value GetArraySizeValue(Array *array) {
- return Value((int)array->items.size());
-}
-
-size_t GetArraySize(Array *array) {
- return array->items.size();
-}
-
-static Value forEach(ExecState *exec_state) {
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 2) {
- break;
- }
- Value *array = exec_state->GetArgument(0);
- if (!IsArray(array)) {
- throw VMExecError("forEach caller isn't a Array");
- }
- Value *func = exec_state->GetArgument(1);
- if (!IsFunction(func)) {
- throw VMExecError("forEach => isn't a function");
- }
- std::vector<Value> items = ValueTo<Array>(array)->items;
- for (int i = 0; i < items.size(); i++) {
- Value item = items[i];
- Value index = Value(i);
- std::vector<Value> args = { item, index };
- exec_state->Call(func, args);
- }
-
- } while (0);
-
- return Value();
-}
-
-static Value map(ExecState *exec_state) {
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 2) {
- break;
- }
- Value *array = exec_state->GetArgument(0);
- if (!IsArray(array)) {
- throw VMExecError("map caller isn't a Array");
- }
- Value *func = exec_state->GetArgument(1);
- if (!IsFunction(func)) {
- throw VMExecError("map callback isn't a function");
- }
- std::vector<Value> items = ValueTo<Array>(array)->items;
- for (int i = 0; i < items.size(); i++) {
- Value item = items[i];
- Value index = Value(i);
- std::vector<Value> args = { item, index };
- exec_state->Call(func, args);
- }
-
- } while (0);
-
- return Value();
-}
-
-static Value indexOf(ExecState *exec_state) {
- int index = -1;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 2) {
- break;
- }
- Value *array = exec_state->GetArgument(0);
- if (!IsArray(array)) {
- throw VMExecError("indexOf caller isn't a Array");
- }
- Value *item = exec_state->GetArgument(1);
- std::vector<Value> items = ValueTo<Array>(array)->items;
- for (int i = 0; i < items.size(); i++) {
- if (ObjectEquals(item, &items[i])) {
- index = i;
- break;
- }
- }
-
- } while (0);
-
- return Value(index);
-}
-
-static Value push(ExecState *exec_state) {
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("argument count error for Array.push");
- }
- Value *array = exec_state->GetArgument(0);
- Value *item = exec_state->GetArgument(1);
- if (!IsArray(array)) {
- throw VMExecError("caller isn't a Array");
- }
- if (IsNil(item)) {
- throw VMExecError("Array.push item can't be nil");
- }
- ValueTo<Array>(array)->items.push_back(*item);
- GCRetain(item);
- return Value();
-}
-
-static Value isArray(ExecState *exec_state) {
- size_t length = exec_state->GetArgumentCount();
- if (length != 1) {
- throw VMExecError("argument count error for Array.isArray");
- }
- Value *array = exec_state->GetArgument(0);
- if (array->type == Value::Type::ARRAY) {
- return Value(true);
- }
- else {
- return Value(false);
- }
-}
-
-static Value slice(ExecState *exec_state) {
- Value ret;
- do {
- size_t argc = exec_state->GetArgumentCount();
- if (argc < 2) {
- throw VMExecError("argument count error for Array.slice");
- break;
- }
- Value *array = exec_state->GetArgument(0);
- if (!IsArray(array)) {
- throw VMExecError("Array.slice caller isn't a Array");
- }
- Value *start = exec_state->GetArgument(1);
- if (!IsInt(start)) {
- throw VMExecError("Array.slice start isn't a int");
- }
- int start_index = (int)IntValue(start);
- std::vector<Value> items = ValueTo<Array>(array)->items;
- int end_index = (int)items.size();
- Value *end = nullptr;
- if (argc > 2) {
- end = exec_state->GetArgument(2);
- if (!IsInt(end)) {
- throw VMExecError("Array.slice end isn't a int");
- }
- end_index = (int)IntValue(end);
- if (end_index < 0) {
- end_index = (int)items.size() + end_index;
- }
- if (end_index > items.size()) {
- end_index = (int)items.size();
- }
- }
- ret = exec_state->class_factory()->CreateArray();
- if (start_index >= 0 && start_index < items.size()) {
- for (int i = start_index; i < end_index; i++) {
- GCRetain(&items[i]);
- ValueTo<Array>(&ret)->items.push_back(items[i]);
- }
- }
-
- } while (0);
-
- return ret;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_array.h b/weex_core/Source/core/data_render/class_array.h
deleted file mode 100644
index 5eaa288..0000000
--- a/weex_core/Source/core/data_render/class_array.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_ARRAY_CLASS_H
-#define DATA_RENDER_ARRAY_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassArray();
-int SetArray(Array *array, Value *index, const Value &val);
-int SetArray(Array *array, int index, const Value &val);
-Value GetArrayValue(Array *array, const Value &index);
-Value *GetArrayVar(Array *array, const Value &index);
-Value GetArraySizeValue(Array *array);
-size_t GetArraySize(Array *array);
-void ClearArray(Array *array);
-void PushArray(Array *array, Value val);
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_ARRAY_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_console.cc b/weex_core/Source/core/data_render/class_console.cc
deleted file mode 100644
index c74ff52..0000000
--- a/weex_core/Source/core/data_render/class_console.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <algorithm>
-#include <sstream>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/table.h"
-#include "core/data_render/class_console.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/vnode/vnode_render_manager.h"
-#include "third_party/json11/json11.hpp"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-#define WXLOG_ERROR "__ERROR"
-#define WXLOG_WARN "__WARN"
-#define WXLOG_INFO "__INFO"
-#define WXLOG_DEBUG "__DEBUG"
-#define WXLOG_LOG "__LOG"
-
-static Value log(ExecState *exec_state);
-static Value info(ExecState *exec_state);
-static Value debug(ExecState *exec_state);
-static Value warn(ExecState *exec_state);
-static Value error(ExecState *exec_state);
-
-ClassDescriptor *NewClassConsole() {
- ClassDescriptor *desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(desc, "log", log);
- AddClassStaticCFunc(desc, "info", info);
- AddClassStaticCFunc(desc, "debug", debug);
- AddClassStaticCFunc(desc, "warn", warn);
- AddClassStaticCFunc(desc, "error", error);
- return desc;
-}
-
-static std::string loginfo2string(ExecState *exec_state, std::string level) {
- size_t argc = exec_state->GetArgumentCount();
- std::stringstream stream;
- stream << "[";
- for (int i = 0; i < argc; ++i) {
- Value *a = exec_state->GetArgument(i);
- switch (a->type) {
- case Value::Type::NIL:
- stream << "null";
- break;
- case Value::Type::NUMBER:
- stream << a->n;
- break;
- case Value::Type::BOOL:
- stream << (a->b ? "true" : "false");
- break;
- case Value::Type::INT:
- stream << a->i;
- break;
- case Value::Type::STRING:
- stream << "\"" << a->str->c_str() << "\"";
- break;
- case Value::Type::TABLE:
- stream << TableToString(ValueTo<Table>(a));
- break;
- case Value::Type::ARRAY:
- stream << ArrayToString(ValueTo<Array>(a));
- break;
- case Value::Type::CLASS_DESC:
- stream << "class descriptor";
- break;
- case Value::Type::CLASS_INST:
- stream << "class object";
- break;
- case Value::Type::CPTR:
- stream << "cptr";
- break;
- default:
- stream << "unknown type";
- break;
- }
- }
- stream << ",\"" << level << "\"" << "]";
- return stream.str();
-}
-
-static Value log(ExecState *exec_state) {
- const std::string& stream = loginfo2string(exec_state, WXLOG_LOG);
- weex::core::data_render::VNodeRenderManager::GetInstance()->WXLogNative(exec_state, stream);
- return Value();
-}
-
-static Value info(ExecState *exec_state) {
- const std::string& stream = loginfo2string(exec_state, WXLOG_INFO);
- weex::core::data_render::VNodeRenderManager::GetInstance()->WXLogNative(exec_state, stream);
- return Value();
-}
-
-static Value debug(ExecState *exec_state) {
- const std::string& stream = loginfo2string(exec_state, WXLOG_DEBUG);
- weex::core::data_render::VNodeRenderManager::GetInstance()->WXLogNative(exec_state, stream);
- return Value();
-}
-
-static Value warn(ExecState *exec_state) {
- const std::string& stream = loginfo2string(exec_state, WXLOG_WARN);
- weex::core::data_render::VNodeRenderManager::GetInstance()->WXLogNative(exec_state, stream);
- return Value();
-}
-
-static Value error(ExecState *exec_state) {
- const std::string& stream = loginfo2string(exec_state, WXLOG_ERROR);
- weex::core::data_render::VNodeRenderManager::GetInstance()->WXLogNative(exec_state, stream);
- return Value();
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_console.h b/weex_core/Source/core/data_render/class_console.h
deleted file mode 100644
index 529ed38..0000000
--- a/weex_core/Source/core/data_render/class_console.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_CONSOLE_CLASS_H
-#define DATA_RENDER_CONSOLE_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassConsole();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_CONSOLE_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_factory.cc b/weex_core/Source/core/data_render/class_factory.cc
deleted file mode 100644
index 68b72af..0000000
--- a/weex_core/Source/core/data_render/class_factory.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/class_factory.h"
-#include "core/data_render/class.h"
-#include "core/data_render/class_array.h"
-#include "core/data_render/class_string.h"
-#include "core/data_render/class_json.h"
-#include "core/data_render/class_object.h"
-#include "core/data_render/class_console.h"
-#include "core/data_render/table.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/class_regex.h"
-#include "core/data_render/class_window.h"
-#include "class_math.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-Value ClassFactory::CreateClassDescriptor(ClassDescriptor *p_super) {
- ClassDescriptor *desc = NewClassDescriptor(p_super);
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::CreateArray() {
- Array *array = new Array();
- Value value;
- SetAValue(&value, reinterpret_cast<GCObject *>(array));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(array), value.type));
- return value;
-}
-
-Value ClassFactory::CreateTable() {
- Table *table = new Table();
- Value value;
- SetTValue(&value, reinterpret_cast<GCObject *>(table));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(table), value.type));
- return value;
-}
-
-Value ClassFactory::ClassString() {
- ClassDescriptor *desc = NewClassString();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassJSON() {
- ClassDescriptor *desc = NewClassJSON();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassArray() {
- ClassDescriptor *desc = NewClassArray();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassObject() {
- ClassDescriptor *desc = NewClassOject();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassRegExp() {
- ClassDescriptor *desc = NewClassRegex();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassWindow() {
- ClassDescriptor *desc = NewClassWindow();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassMath() {
- ClassDescriptor *desc = NewClassMath();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-Value ClassFactory::ClassConsole() {
- ClassDescriptor *desc = NewClassConsole();
- Value value;
- SetCDValue(&value, reinterpret_cast<GCObject *>(desc));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
- return value;
-}
-
-int ClassFactory::Find(const ClassDescriptor *desc) {
- std::vector<ClassDescriptor *> descs = this->descs();
- int index = 0;
- for (auto d : descs) {
- if (desc == d) {
- return index;
- }
- index++;
- }
- return -1;
-}
-
-ClassInstance *ClassFactory::CreateClassInstanceFromSuper(ClassDescriptor *p_desc) {
- ClassInstance *p_super = nullptr;
- ClassInstance *inst = NewClassInstance(p_desc);
- if (p_desc->p_super_) {
- p_super = CreateClassInstanceFromSuper(p_desc->p_super_);
- inst->p_super_ = p_super;
- }
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(inst), Value::Type::CLASS_INST));
- return inst;
-}
-
-Value ClassFactory::CreateClassInstance(ClassDescriptor *p_desc) {
- ClassInstance *inst = CreateClassInstanceFromSuper(p_desc);
- Value value;
- SetCIValue(&value, reinterpret_cast<GCObject *>(inst));
- return value;
-}
-
-Value ClassFactory::CreateFuncInstance(FuncState *func_state) {
- FuncInstance *func_inst = new FuncInstance(func_state);
- Value value;
- SetGCFuncValue(&value, reinterpret_cast<GCObject *>(func_inst));
- stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(func_inst), Value::Type::FUNC_INST));
- return value;
-}
-
-ClassFactory::~ClassFactory() {
- for (auto iter = stores_.begin(); iter != stores_.end(); iter++) {
- switch (iter->second) {
- case Value::Type::ARRAY:
- {
- delete reinterpret_cast<Array *>(iter->first);
- break;
- }
- case Value::Type::TABLE:
- {
- delete reinterpret_cast<Table *>(iter->first);
- break;
- }
- case Value::Type::CLASS_DESC:
- {
- delete reinterpret_cast<ClassDescriptor *>(iter->first);
- break;
- }
- case Value::Type::CLASS_INST:
- {
- delete reinterpret_cast<ClassInstance *>(iter->first);
- break;
- }
- case Value::Type::FUNC_INST:
- {
- FuncInstance *inst = reinterpret_cast<FuncInstance *>(iter->first);
- for (int i = 0; i < inst->closures_.size(); i++) {
- delete inst->closures_[i];
- }
- delete inst;
- break;
- }
- default:
- break;
- }
- }
- stores_.clear();
-}
-std::vector<ClassDescriptor *> ClassFactory::descs() {
- std::vector<ClassDescriptor *> descs;
- for (auto iter = stores_.begin(); iter != stores_.end(); iter++) {
- if (iter->second == Value::Type::CLASS_DESC) {
- descs.push_back(reinterpret_cast<ClassDescriptor *>(iter->first));
- }
- }
- return descs;
-}
-
-std::vector<Value> ClassFactory::constants() {
- std::vector<Value> constants;
- for (auto iter = stores_.begin(); iter != stores_.end(); iter++) {
- switch (iter->second) {
- case Value::Type::ARRAY:
- {
- Value array;
- SetAValue(&array, iter->first);
- constants.push_back(array);
- break;
- }
- case Value::Type::TABLE:
- {
- Value table;
- SetTValue(&table, iter->first);
- constants.push_back(table);
- break;
- }
- default:
- break;
- }
- }
- return constants;
-}
-
-}
-}
-}
diff --git a/weex_core/Source/core/data_render/class_factory.h b/weex_core/Source/core/data_render/class_factory.h
deleted file mode 100644
index a0b9679..0000000
--- a/weex_core/Source/core/data_render/class_factory.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_CLASSFACTORY_H
-#define DATA_RENDER_CLASSFACTORY_H
-
-#include <vector>
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-class ClassFactory {
-public:
- ClassFactory() {};
- ~ClassFactory();
- virtual Value CreateClassDescriptor(ClassDescriptor *p_super);
- virtual Value CreateClassInstance(ClassDescriptor *p_desc);
- virtual Value CreateFuncInstance(FuncState *func_state);
- virtual Value ClassArray();
- virtual Value ClassString();
- virtual Value ClassJSON();
- virtual Value ClassObject();
- virtual Value ClassRegExp();
- virtual Value ClassWindow();
- virtual Value ClassMath();
- virtual Value ClassConsole();
- virtual Value CreateArray();
- virtual Value CreateTable();
- int Find(const ClassDescriptor *desc);
- inline const std::vector<std::pair<GCObject *, Value::Type>>& stores() { return stores_; }
- std::vector<ClassDescriptor *> descs();
- std::vector<Value> constants();
- private:
- ClassInstance *CreateClassInstanceFromSuper(ClassDescriptor *p_desc);
- std::vector<std::pair<GCObject *, Value::Type>> stores_;
-};
-
-}
-}
-}
-
-#endif //DATA_RENDER_CLASSFACTORY_H
diff --git a/weex_core/Source/core/data_render/class_function.cc b/weex_core/Source/core/data_render/class_function.cc
deleted file mode 100644
index 9fde13d..0000000
--- a/weex_core/Source/core/data_render/class_function.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <algorithm>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/class_function.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-void AddClosure(ExecState *exec_state, Value *func) {
- do {
- if (!IsFuncInstance(func)) {
- throw VMExecError("add function closure type error");
- break;
- }
- FuncInstance *inst = ValueTo<FuncInstance>(func);
- FuncState *func_state = inst->func_;
- for (int i = 0; i < func_state->in_closure().size(); i++) {
- ValueRef *ref = func_state->in_closure()[i];
- FuncClosure *closure = new FuncClosure(ref);
- ref->SetClosure(closure);
- inst->closures_.push_back(closure);
- }
-
- } while (0);
-}
-
-Value *LoadClosure(Value *func, ValueRef *ref) {
- Value *ret = nullptr;
- do {
- if (!IsFuncInstance(func)) {
- throw VMExecError("load function closure type error");
- break;
- }
- FuncInstance *inst = ValueTo<FuncInstance>(func);
- for (int i = 0; i < inst->closures_.size(); i++) {
- FuncClosure *closure = inst->closures_[i];
- if (closure->func_state() == ref->func_state() && closure->register_id() == ref->register_id()) {
- ret = &closure->value();
- break;
- }
- }
-
- } while (0);
-
- return ret;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_function.h b/weex_core/Source/core/data_render/class_function.h
deleted file mode 100644
index 5278f79..0000000
--- a/weex_core/Source/core/data_render/class_function.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_FUNCTION_CLASS_H
-#define DATA_RENDER_FUNCTION_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-void AddClosure(ExecState *exec_state, Value *func);
-Value *LoadClosure(Value *func, ValueRef *ref);
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_FUNCTION_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_json.cc b/weex_core/Source/core/data_render/class_json.cc
deleted file mode 100644
index 0d7a769..0000000
--- a/weex_core/Source/core/data_render/class_json.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include "core/data_render/class_json.h"
-#include <algorithm>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/table.h"
-
-#include "core/data_render/vnode/vnode_exec_env.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value stringify(ExecState *exec_state);
-static Value parse(ExecState *exec_state);
-
-ClassDescriptor *NewClassJSON() {
- ClassDescriptor *array_desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(array_desc, "stringify", stringify);
- AddClassStaticCFunc(array_desc, "parse", parse);
- return array_desc;
-}
-
-static Value stringify(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 1) {
- break;
- }
- Value *value = exec_state->GetArgument(0);
- if (!IsArray(value) && !IsTable(value)) {
- throw VMExecError("stringify caller isn't a Array or Table");
- }
- std::string json_string = "";
- if (IsTable(value)) {
- json_string = TableToString(ValueTo<Table>(value));
- }
- else if (IsArray(value)) {
- json_string = ArrayToString(ValueTo<Array>(value));
- }
- ret = Value(exec_state->string_table()->StringFromUTF8(json_string));
-
- } while (0);
-
- return ret;
-}
-
-static Value parse(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 1) {
- break;
- }
- Value *value = exec_state->GetArgument(0);
- if (!IsString(value)) {
- throw VMExecError("json parse caller isn't a String");
- }
- std::string json_string = CStringValue(value);
- ret = StringToValue(exec_state, json_string);
-
- } while (0);
-
- return ret;
-
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_json.h b/weex_core/Source/core/data_render/class_json.h
deleted file mode 100644
index 5e06e14..0000000
--- a/weex_core/Source/core/data_render/class_json.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_JSON_CLASS_H
-#define DATA_RENDER_JSON_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassJSON();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_JSON_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_math.cc b/weex_core/Source/core/data_render/class_math.cc
deleted file mode 100644
index 9d1b282..0000000
--- a/weex_core/Source/core/data_render/class_math.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// Created by Xu Jiacheng on 2018/11/6.
-//
-
-#include "core/data_render/class_math.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/class.h"
-#include "core/data_render/common_error.h"
-#include "third_party/json11/json11.hpp"
-#include "vnode/vnode_render_manager.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value Ceil(ExecState* exec_state){
- size_t argc = exec_state->GetArgumentCount();
- if (argc!=1){
- throw VMExecError("math.ceil takes more than one args");
- }
- Value* value = exec_state->GetArgument(0);
- if(!IsNumber(value)&&!IsInt(value)){
- throw VMExecError("math.ceil arg not number");
- }
-
- if (IsNumber(value)){
- return Value(static_cast<int64_t>(ceil(NumValue(value))));
- } else {
- return Value(static_cast<int64_t>(ceil(IntValue(value))));
- }
-}
-
-static Value Floor(ExecState* exec_state){
- size_t argc = exec_state->GetArgumentCount();
- if (argc!=1){
- throw VMExecError("math.ceil takes more than one args");
- }
- Value* value = exec_state->GetArgument(0);
- if(!IsNumber(value)&&!IsInt(value)){
- throw VMExecError("math.ceil arg not number");
- }
-
- if (IsNumber(value)){
- return Value(static_cast<int64_t>(floor(NumValue(value))));
- } else {
- return Value(static_cast<int64_t>(floor(IntValue(value))));
- }
-}
-
-
-static Value Random(ExecState* exec_state){
- return Value(static_cast <double> (rand()) / static_cast <double>(RAND_MAX));
-}
-
-static Value Max(ExecState* exec_state){
- size_t argc = exec_state->GetArgumentCount();
- if (argc <= 1){
- return Value(INT64_MIN);
- }
-
- double max = std::numeric_limits<double>::lowest();
- int index = -1;
-
- for (int i = 0; i < argc; ++i) {
- auto value = exec_state->GetArgument(i);
- if (IsInt(value)){
- int64_t value_i = IntValue(value);
- if (value_i>max){
- index = i;
- max = static_cast<double>(value_i);
- }
- } else if (IsNumber(value)){
- double value_d = NumValue(value);
- if (value_d>max){
- index = i;
- max = value_d;
- }
- } else {
- return Value();
- }
- }
-
- if (index>=0){
- return Value(*exec_state->GetArgument(index));
- } else{
- return Value(INT64_MIN);
- }
-}
-
-static Value Min(ExecState* exec_state){
- size_t argc = exec_state->GetArgumentCount();
- if (argc <= 1){
- return Value(INT64_MAX);
- }
-
- double min = std::numeric_limits<double>::max();
- int index = -1;
-
- for (int i = 0; i < argc; ++i) {
- auto value = exec_state->GetArgument(i);
- if (IsInt(value)){
- int64_t value_i = IntValue(value);
- if (value_i<min){
- index = i;
- min = static_cast<double>(value_i);
- }
- } else if (IsNumber(value)){
- double value_d = NumValue(value);
- if (value_d<min){
- index = i;
- min = value_d;
- }
- } else {
- return Value();
- }
- }
-
- if (index>=0){
- return Value(*exec_state->GetArgument(index));
- } else{
- return Value(INT64_MAX);
- }
-}
-
-ClassDescriptor* NewClassMath() {
- ClassDescriptor *desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(desc, "ceil", Ceil);
- AddClassStaticCFunc(desc, "floor", Floor);
- AddClassStaticCFunc(desc, "random", Random);
- AddClassStaticCFunc(desc, "max", Max);
- AddClassStaticCFunc(desc, "min", Min);
- return desc;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_math.h b/weex_core/Source/core/data_render/class_math.h
deleted file mode 100644
index 6631884..0000000
--- a/weex_core/Source/core/data_render/class_math.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// Created by Xu Jiacheng on 2018/11/6.
-//
-
-#ifndef WEEX_PROJECT_CLASS_MATH_H
-#define WEEX_PROJECT_CLASS_MATH_H
-
-
-#include "object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassMath();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-
-#endif //WEEX_PROJECT_CLASS_MATH_H
diff --git a/weex_core/Source/core/data_render/class_object.cc b/weex_core/Source/core/data_render/class_object.cc
deleted file mode 100644
index 22dc213..0000000
--- a/weex_core/Source/core/data_render/class_object.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/class_object.h"
-#include <algorithm>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/table.h"
-#include "core/data_render/class_array.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value keys(ExecState *exec_state);
-
-ClassDescriptor *NewClassOject() {
- ClassDescriptor *object_desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(object_desc, "keys", keys);
- return object_desc;
-}
-
-static Value keys(ExecState *exec_state) {
- Value ret = exec_state->class_factory()->CreateArray();
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 1) {
- break;
- }
- Value *value = exec_state->GetArgument(0);
- if (!IsArray(value) && !IsTable(value)) {
- throw VMExecError("Object.keys caller isn't a Array or Table");
- }
- if (IsTable(value)) {
- std::vector<std::string> keys = GetTableKeys(ValueTo<Table>(value));
- Array *array = ValueTo<Array>(&ret);
- for (int i = 0; i < keys.size(); i++) {
- SetArray(array, i, Value(exec_state->string_table()->StringFromUTF8(keys[i])));
- }
- }
-
- } while (0);
-
- return ret;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_object.h b/weex_core/Source/core/data_render/class_object.h
deleted file mode 100644
index 8467d8b..0000000
--- a/weex_core/Source/core/data_render/class_object.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_OBJECT_CLASS_H
-#define DATA_RENDER_OBJECT_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassOject();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_OBJECT_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_regex.cc b/weex_core/Source/core/data_render/class_regex.cc
deleted file mode 100644
index 460aa38..0000000
--- a/weex_core/Source/core/data_render/class_regex.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/class_regex.h"
-#include <algorithm>
-#include <regex>
-#include <vector>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/table.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value test(ExecState *exec_state);
-static Value exec(ExecState *exec_state);
-
-ClassDescriptor *NewClassRegex() {
- ClassDescriptor *desc = new ClassDescriptor(nullptr);
- AddClassCFunc(desc, "test", test);
- AddClassCFunc(desc, "exec", exec);
- return desc;
-}
-
-static Value test(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("Regex.test arg count != 2");
- }
- Value *caller = exec_state->GetArgument(0);
- Value *arg = exec_state->GetArgument(1);
- if (!IsClassInstance(caller)) {
- throw VMExecError("Type Error For Class Instance with OP_CODE [OP_GETSUPER]");
- }
- ClassInstance *inst = ValueTo<ClassInstance>(caller);
-
- Value* reg = GetClassMember(inst, "_reg");
- Value* flag = GetClassMember(inst, "_flag");
- if (!IsString(reg) || !IsString(flag) || !IsString(arg)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
- std::string test_str = ValueTo<String>(arg)->c_str();
-
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag_str.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
- std::regex express(reg_str, type);
- std::smatch match;
- ret = Value(std::regex_search(test_str,match,express));
- } while (0);
-
- return ret;
-}
-
-static Value exec(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("Regex.exec arg count != 2");
- }
- Value *caller = exec_state->GetArgument(0);
- Value *arg = exec_state->GetArgument(1);
- if (!IsClassInstance(caller)) {
- throw VMExecError("Type Error For Class Instance with OP_CODE [OP_GETSUPER]");
- }
- ClassInstance *inst = ValueTo<ClassInstance>(caller);
-
- Value* reg = GetClassMember(inst, "_reg");
- Value* flag = GetClassMember(inst, "_flag");
- if (!IsString(reg) || !IsString(flag) || !IsString(arg)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
- std::string test_str = ValueTo<String>(arg)->c_str();
-
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag_str.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
-
- bool g_mode =flag_str.find('g') != std::string::npos;
-
- ret = exec_state->class_factory()->CreateArray();
- Array* arr = ValueTo<Array>(&ret);
-
- if (g_mode){
- std::regex express(reg_str, type);
- std::smatch match;
- std::string::const_iterator iterStart = test_str.begin();
- std::string::const_iterator iterEnd = test_str.end();
- bool succ = false;
- while (std::regex_search(iterStart,iterEnd,match,express)){
- arr->items.push_back(Value(exec_state->string_table()->StringFromUTF8(match[0])));
- iterStart = match[0].second;
- succ = true;
- }
- if (!succ){
- ret = Value();
- }
- } else{
- std::regex express(reg_str, type);
- std::smatch match;
- bool succ = std::regex_search(test_str,match,express);
-
- if (succ){
- for (size_t i = 0; i < match.size(); ++i){
- arr->items.push_back(Value(exec_state->string_table()->StringFromUTF8(match[i])));
- }
- } else {
- ret = Value();
- }
- // else return []
- }
- } while (0);
-
- return ret;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_regex.h b/weex_core/Source/core/data_render/class_regex.h
deleted file mode 100644
index 2cdd522..0000000
--- a/weex_core/Source/core/data_render/class_regex.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_REGEX_CLASS_H
-#define DATA_RENDER_REGEX_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassRegex();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_JSON_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_string.cc b/weex_core/Source/core/data_render/class_string.cc
deleted file mode 100644
index 85cd80d..0000000
--- a/weex_core/Source/core/data_render/class_string.cc
+++ /dev/null
@@ -1,554 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/class_string.h"
-#include <stdlib.h>
-#include <regex>
-#include <algorithm>
-
-#include "base/log_defines.h"
-#include "core/data_render/class.h"
-#include "core/data_render/class_array.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/table.h"
-#include "core/data_render/string_table.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value split(ExecState *exec_state);
-static Value trim(ExecState* exec_state);
-static Value indexOf(ExecState* exec_state);
-static Value search(ExecState* exec_state);
-static Value replaceAll(ExecState *exec_state);
-static Value replace(ExecState *exec_state);
-static Value match(ExecState *exec_state);
-
-static ClassInstance* to_regex_inst(ExecState *exec_state, Value* v){
- if (!IsClassInstance(v)){
- throw VMExecError("not a regex instance");
- }
- ClassInstance* instance = ValueTo<ClassInstance>(v);
- int index = exec_state->global()->IndexOf("RegExp");
- if (index < 0) {
- throw VMExecError("split lost RegExp define");
- }
- Value* reg_define = exec_state->global()->Find(index);
- if (!IsClass(reg_define)) {
- throw VMExecError("split not a RegExp define");
- }
- if (instance->p_desc_ != ValueTo<ClassDescriptor>(reg_define)) {
- throw VMExecError("split not a RegExp instance");
- }
- return instance;
-}
-
-std::vector<std::string> split_regex(const std::string& input, const std::string& regex, const std::string& flag) {
- // passing -1 as the submatch index parameter performs splitting
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
-
- std::regex re(regex,type);
- std::sregex_token_iterator first{input.begin(), input.end(), re, -1}, last;
- return {first, last};
-}
-
-ClassDescriptor *NewClassString() {
- ClassDescriptor *array_desc = new ClassDescriptor(nullptr);
- AddClassCFunc(array_desc, "split", split);
- AddClassCFunc(array_desc, "trim", trim);
- AddClassCFunc(array_desc, "indexOf", indexOf);
- AddClassCFunc(array_desc, "search", search);
- AddClassCFunc(array_desc, "replace", replace);
- AddClassCFunc(array_desc, "replaceAll", replaceAll);
- AddClassCFunc(array_desc, "match", match);
- return array_desc;
-}
-
-std::string& replace_all(std::string& str, std::string& old_value, std::string& new_value)
-{
- while (true)
- {
- std::string::size_type pos(0);
- if ((pos = str.find(old_value)) != std::string::npos) {
- str.replace(pos, old_value.length(),new_value);
- }
- else {
- break;
- }
- }
- return str;
-}
-
-std::string& replace_normal(std::string& str, std::string& old_value, std::string& new_value)
-{
- std::string::size_type pos(0);
- if ((pos = str.find(old_value)) != std::string::npos) {
- str.replace(pos, old_value.length(),new_value);
- }
- return str;
-}
-
-static Value replaceAll(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 3) {
- break;
- }
- Value *src = exec_state->GetArgument(0);
- if (!IsString(src)) {
- throw VMExecError("replaceAll caller isn't a string");
- }
- Value *oldValue = exec_state->GetArgument(1);
- if (!IsString(oldValue)) {
- throw VMExecError("old caller isn't a string");
- }
- Value *newValue = exec_state->GetArgument(2);
- if (!IsString(newValue)) {
- throw VMExecError("split caller isn't a string");
- }
- std::string srcstr = CStringValue(src);
- std::string oldstr = CStringValue(oldValue);
- std::string newstr = CStringValue(newValue);
- std::string dststr = replace_all(srcstr, oldstr, newstr);
- ret = Value(exec_state->string_table()->StringFromUTF8(dststr));
-
- } while (0);
-
- return ret;
-}
-
-static Value replace(ExecState *exec_state) {
- Value ret;
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 3) {
- break;
- }
- Value *src = exec_state->GetArgument(0);
- if (!IsString(src)) {
- throw VMExecError("replaceAll caller isn't a string");
- }
- Value *oldValue = exec_state->GetArgument(1);
- Value *newValue = exec_state->GetArgument(2);
- if (!IsString(newValue)) {
- throw VMExecError("new value isn't a string");
- }
- std::string srcstr = CStringValue(src);
- std::string newstr = CStringValue(newValue);
- if (IsString(oldValue)) {
-
- std::string oldstr = CStringValue(oldValue);
- std::string dststr = replace_normal(srcstr, oldstr, newstr);
- ret = Value(exec_state->string_table()->StringFromUTF8(dststr));
- } else if (IsClassInstance(oldValue)){
- ClassInstance* instance = to_regex_inst(exec_state,oldValue);
- Value* reg = GetClassMember(instance, "_reg");
- Value* flag = GetClassMember(instance, "_flag");
- if (!IsString(reg) || !IsString(flag)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
-
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag_str.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
- std::regex express(reg_str, type);
-
- std::string dststr = std::regex_replace(srcstr, express, newstr,std::regex_constants::format_first_only);
- ret = Value(exec_state->string_table()->StringFromUTF8(dststr));
- } else{
- throw VMExecError("old caller isn't a string or regex");
- }
- } while (0);
-
- return ret;
-}
-
-template <class Container>
-void split_string(const std::string& str, Container& container, const std::string& delims = " ")
-{
- std::size_t current, previous = 0;
- current = str.find(delims);
- while (current != std::string::npos) {
- container.push_back(str.substr(previous, current - previous));
- previous = current + delims.length();
- current = str.find(delims, previous);
- }
- if (str.length() > previous) {
- container.push_back(str.substr(previous, str.length() - previous));
- }
-}
-
-static Value split(ExecState *exec_state) {
- Value ret = exec_state->class_factory()->CreateArray();
- do {
- size_t length = exec_state->GetArgumentCount();
- if (length < 2) {
- break;
- }
- Value *string = exec_state->GetArgument(0);
- if (!IsString(string)) {
- throw VMExecError("split caller isn't a string");
- }
- Value *split = exec_state->GetArgument(1);
- if (IsString(split)) {
- std::string src = CStringValue(string);
- std::string delim = CStringValue(split);
- std::vector<std::string>split_array;
- split_string<std::vector<std::string>>(src, split_array, delim);
- Array *array = ValueTo<Array>(&ret);
- for (int i = 0; i < split_array.size(); i++) {
- Value string_value(exec_state->string_table()->StringFromUTF8(split_array[i]));
- array->items.push_back(string_value);
- }
- } else if(IsClassInstance(split)){
- ClassInstance* instance = to_regex_inst(exec_state,split);
- Value* reg = GetClassMember(instance, "_reg");
- Value* flag = GetClassMember(instance, "_flag");
- if (!IsString(reg) || !IsString(flag) || !IsString(string)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
- std::string test_str = ValueTo<String>(string)->c_str();
-
- auto ret_vec = split_regex(test_str,reg_str,flag_str);
-
- Array *array = ValueTo<Array>(&ret);
- for(auto st: ret_vec){
- Value string_value(exec_state->string_table()->StringFromUTF8(st));
- array->items.push_back(string_value);
- }
- } else {
- throw VMExecError("split caller isn't a string or regex");
- }
- } while (0);
-
- return ret;
-}
-
-std::string& trim(std::string &s) {
- if (s.empty()) {
- return s;
- }
-
- s.erase(0, s.find_first_not_of(" "));
- s.erase(s.find_last_not_of(" ") + 1);
- return s;
-}
-
-static Value trim(ExecState* exec_state) {
- size_t length = exec_state->GetArgumentCount();
- if (length != 1) {
- throw VMExecError("trim caller args wrong");
- }
- Value *string = exec_state->GetArgument(0);
- if (!IsString(string)) {
- throw VMExecError("trim caller isn't a string");
- }
-
- std::string src = CStringValue(string);
- trim(src);
-
- Value string_value(exec_state->string_table()->StringFromUTF8(src));
- return string_value;
-}
-
-/* Converts a hex character to its integer value */
-char from_hex(char ch) {
- return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
-}
-
-/* Converts an integer value to its hex character*/
-char to_hex(char code) {
- static char hex[] = "0123456789abcdef";
- return hex[code & 15];
-}
-
-/* Returns a url-encoded version of str */
-/* IMPORTANT: be sure to free() the returned string after use */
-char *url_encode(char *str) {
- char *pstr = str, *buf = (char *)malloc(strlen(str) * 3 + 1), *pbuf = buf;
- while (*pstr) {
- if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~')
- *pbuf++ = *pstr;
- else if (*pstr == ' ')
- *pbuf++ = '%', *pbuf++ = '2', *pbuf++ = '0';
- else
- *pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15);
- pstr++;
- }
- *pbuf = '\0';
- return buf;
-}
-
-/* Returns a url-decoded version of str */
-/* IMPORTANT: be sure to free() the returned string after use */
-char *url_decode(char *str) {
- char *pstr = str, *buf = (char *)malloc(strlen(str) + 1), *pbuf = buf;
- while (*pstr) {
- if (*pstr == '%') {
- if (pstr[1] && pstr[2]) {
- *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
- pstr += 2;
- }
- } else if (*pstr == '+') {
- *pbuf++ = ' ';
- } else {
- *pbuf++ = *pstr;
- }
- pstr++;
- }
- *pbuf = '\0';
- return buf;
-}
-
-Value encodeURIComponent(ExecState *exec_state) {
- size_t length = exec_state->GetArgumentCount();
- if (length < 1) {
- throw VMExecError("trim caller args wrong");
- }
- Value *string = exec_state->GetArgument(0);
- if (!IsString(string)) {
- throw VMExecError("trim caller isn't a string");
- }
- std::string src = CStringValue(string);
- char *uri = url_encode((char *)src.c_str());
- std::string dst = src;
- if (uri) {
- dst = uri;
- free(uri);
- }
- return Value(exec_state->string_table()->StringFromUTF8(dst));
-}
-
-std::string utf8chr(int cp)
-{
- char c[5] = { 0x00,0x00,0x00,0x00,0x00 };
- if (cp <= 0x7F) {
- c[0] = cp;
- }
- else if (cp <= 0x7FF) {
- c[0] = (cp >> 6) + 192;
- c[1] = (cp & 63) + 128;
- }
- else if (0xd800 <= cp && cp <= 0xdfff) {
- //invalid block of utf8
- }
- else if (cp <= 0xFFFF)
- {
- c[0] = (cp >> 12) + 224;
- c[1]= ((cp >> 6) & 63) + 128;
- c[2] = (cp & 63) + 128;
- }
- else if (cp <= 0x10FFFF) {
- c[0] = (cp >> 18) + 240;
- c[1] = ((cp >> 12) & 63) + 128;
- c[2] = ((cp >> 6) & 63) + 128;
- c[3] = (cp & 63) + 128;
- }
- return std::string(c);
-}
-
-std::string utf8_decode(std::string &input) {
- do {
- size_t length = input.length();
- if (!length) {
- break;
- }
- const char *chars = input.c_str();
- std::string utf8str = "";
- for (int i = 0; i < length; i++) {
- char c = chars[i];
- if (c == '\\' && chars[i + 1] == 'u') {
- int cc = 0;
- for (int j = 0; j < 4; j++)
- {
- char ch = tolower(chars[i + 2 + j]);
- if (('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f')) {
- cc|= (from_hex(ch) << (3 - j) * 4);
- }
- else
- {
- cc = 0;
- break;
- }
- }
- if (cc) {
- i += 5;
- utf8str += utf8chr(cc);
- continue;
- }
- }
- utf8str.push_back(c);
- }
- return utf8str;
-
- } while (0);
-
- return input;
-}
-
-Value indexOf(ExecState* exec_state) {
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("trim caller args wrong");
- }
-
- Value* string = exec_state->GetArgument(0);
- Value* subs = exec_state->GetArgument(1);
- if (!IsString(string) || !IsString(subs)) {
- throw VMExecError("trim caller isn't a string");
- }
-
- std::string src = CStringValue(string);
- std::string sub_src = CStringValue(subs);
-
- auto pos = src.find(sub_src);
- if (pos == std::string::npos) {
- return Value(-1);
- }
-
- return Value(static_cast<int64_t>(pos));
-}
-
-Value search(ExecState* exec_state) {
- Value ret;
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("search arg count wrong");
- }
-
- Value *string = exec_state->GetArgument(0);
- if (!IsString(string)) {
- throw VMExecError("split caller isn't a string");
- }
-
- Value *search_str = exec_state->GetArgument(1);
- if(IsClassInstance(search_str)){
- ClassInstance* instance = to_regex_inst(exec_state,search_str);
-
- Value* reg = GetClassMember(instance, "_reg");
- Value* flag = GetClassMember(instance, "_flag");
- if (!IsString(reg) || !IsString(flag)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
- std::string test_str = ValueTo<String>(string)->c_str();
-
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag_str.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
- std::regex express(reg_str, type);
- std::smatch match;
- bool succ = std::regex_search(test_str,match,express);
- if (succ){
- ret = Value(static_cast<int64_t>(match.position(0)));
- } else{
- ret = Value(-1);
- }
- } else {
- throw VMExecError("split caller isn't a string or regex");
- }
-
- return ret;
-}
-
-Value match(ExecState* exec_state) {
- Value ret;
- size_t length = exec_state->GetArgumentCount();
- if (length != 2) {
- throw VMExecError("search arg count wrong");
- }
-
- Value *string = exec_state->GetArgument(0);
- if (!IsString(string)) {
- throw VMExecError("split caller isn't a string");
- }
-
- Value *search_str = exec_state->GetArgument(1);
- if(IsClassInstance(search_str)){
- ClassInstance* instance = to_regex_inst(exec_state,search_str);
-
- Value* reg = GetClassMember(instance, "_reg");
- Value* flag = GetClassMember(instance, "_flag");
- if (!IsString(reg) || !IsString(flag)){
- throw VMExecError("Regex._reg || _flag is not string");
- }
- std::string reg_str = ValueTo<String>(reg)->c_str();
- std::string flag_str = ValueTo<String>(flag)->c_str();
- std::string test_str = ValueTo<String>(string)->c_str();
-
- std::regex_constants::syntax_option_type type = std::regex_constants::ECMAScript;
- if (flag_str.find('i') != std::string::npos){
- type |= std::regex_constants::icase;
- }
-
- bool g_mode =flag_str.find('g') != std::string::npos;
-
- ret = exec_state->class_factory()->CreateArray();
- Array* arr = ValueTo<Array>(&ret);
-
- if (g_mode){
- std::regex express(reg_str, type);
- std::smatch match;
- std::string::const_iterator iterStart = test_str.begin();
- std::string::const_iterator iterEnd = test_str.end();
- bool succ = false;
- while (std::regex_search(iterStart,iterEnd,match,express)){
- arr->items.push_back(Value(exec_state->string_table()->StringFromUTF8(match[0])));
- iterStart = match[0].second;
- succ = true;
- }
- if (!succ){
- ret = Value();
- }
- } else{
- std::regex express(reg_str, type);
- std::smatch match;
- bool succ = std::regex_search(test_str,match,express);
-
- if (succ){
- for (size_t i = 0; i < match.size(); ++i){
- arr->items.push_back(Value(exec_state->string_table()->StringFromUTF8(match[i])));
- }
- } else {
- ret = Value();
- }
- // else return []
- }
- } else {
- throw VMExecError("split caller isn't a string or regex");
- }
-
- return ret;
-}
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_string.h b/weex_core/Source/core/data_render/class_string.h
deleted file mode 100644
index 9aa3275..0000000
--- a/weex_core/Source/core/data_render/class_string.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// Created by pentao.pt on 2018/7/25.
-//
-
-#ifndef DATA_RENDER_STRING_CLASS_H
-#define DATA_RENDER_STRING_CLASS_H
-
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassString();
-Value encodeURIComponent(ExecState *exec_state);
-std::string utf8_decode(std::string &input);
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-#endif // DATA_RENDER_STRING_CLASS_H
diff --git a/weex_core/Source/core/data_render/class_window.cc b/weex_core/Source/core/data_render/class_window.cc
deleted file mode 100644
index db1e75a..0000000
--- a/weex_core/Source/core/data_render/class_window.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Created by Xu Jiacheng on 2018/11/6.
-//
-
-#include "core/data_render/class_window.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/class.h"
-#include "core/data_render/common_error.h"
-#include "third_party/json11/json11.hpp"
-#include "vnode/vnode_render_manager.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-static Value Open(ExecState *exec_state){
- size_t argc = exec_state->GetArgumentCount();
- if (argc!=1){
- throw VMExecError("window.open takes more than one args");
- }
- Value* url_value = exec_state->GetArgument(0);
- if(!IsString(url_value)){
- throw VMExecError("window.open arg not string");
- }
- json11::Json::array args_array;
- json11::Json::object obj{
- {"url",CStringValue(url_value)},
- {"animated", "true"},
- };
- args_array.push_back(obj);
-
- const std::string& args = json11::Json(args_array).dump();
- weex::core::data_render::VNodeRenderManager::GetInstance()
- ->CallNativeModule(exec_state, "navigator", "push", args, 2);
-
- return Value();
-}
-
-ClassDescriptor* NewClassWindow() {
- ClassDescriptor *desc = new ClassDescriptor(nullptr);
- AddClassStaticCFunc(desc, "open", Open);
- return desc;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/class_window.h b/weex_core/Source/core/data_render/class_window.h
deleted file mode 100644
index 4752bb4..0000000
--- a/weex_core/Source/core/data_render/class_window.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// Created by Xu Jiacheng on 2018/11/6.
-//
-
-#ifndef WEEX_PROJECT_CLASS_WINDOW_H
-#define WEEX_PROJECT_CLASS_WINDOW_H
-
-
-#include "object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-ClassDescriptor *NewClassWindow();
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
-
-
-#endif //WEEX_PROJECT_CLASS_WINDOW_H
diff --git a/weex_core/Source/core/data_render/code_generator.cc b/weex_core/Source/core/data_render/code_generator.cc
deleted file mode 100644
index a472243..0000000
--- a/weex_core/Source/core/data_render/code_generator.cc
+++ /dev/null
@@ -1,1621 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "core/data_render/code_generator.h"
-#include "core/data_render/exec_state.h"
-#include "core/data_render/string_table.h"
-#include "core/data_render/common_error.h"
-#include "core/data_render/class.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-
-void CodeGenerator::EnterClass(Value *class_value) {
- ClassCnt *parent = class_;
- class_ = new ClassCnt;
- class_->set_parent(parent);
- class_->set_class_value(class_value);
-}
-
-void CodeGenerator::LeaveClass() {
- ClassCnt *parent = class_->parent();
- if (class_) {
- delete class_;
- }
- class_ = parent;
- if (class_) {
- class_->set_children(nullptr);
- }
-}
-
-void CodeGenerator::EnterFunction() {
- FuncCnt *parent_func = func_;
- func_ = new FuncCnt;
- func_->set_parent(parent_func);
- func_->set_func_state(new FuncState);
- if (parent_func != nullptr) {
- parent_func->func_state()->AddChild(func_->func_state());
- }
- BlockCnt *block = new BlockCnt();
- block->set_func_state(func_->func_state());
- block->set_exec_state(exec_state_);
- func_->set_root_block(block);
- func_->set_current_block(block);
- BlockCnt *parent_block = block_;
- block_ = block;
- block_->set_parent(parent_block);
- if (parent_block) {
- parent_block->set_children(block_);
- }
-}
-
-void CodeGenerator::LeaveFunction() {
- FuncCnt *parent_func = func_->parent();
- if (func_) {
- delete func_;
- }
- func_ = parent_func;
- if (func_) {
- func_->set_children(nullptr);
- }
- BlockCnt *parent_block = block_->parent();
- if (block_) {
- block_->reset();
- delete block_;
- }
- block_ = parent_block;
- if (block_) {
- block_->set_children(nullptr);
- }
-}
-
-void CodeGenerator::EnterBlock() {
- BlockCnt *parent_block = block_;
- block_ = new BlockCnt;
- block_->set_parent(parent_block);
- block_->set_func_state(func_->func_state());
- block_->set_exec_state(exec_state_);
- if (parent_block != nullptr) {
- parent_block->set_children(block_);
- block_->set_idx(parent_block->idx());
- }
- func_->set_current_block(block_);
-}
-
-void CodeGenerator::LeaveBlock() {
- BlockCnt *parent = block_->parent();
- if (block_) {
- block_->reset();
- delete block_;
- }
- block_ = parent;
- if (block_) {
- block_->set_children(nullptr);
- }
- func_->set_current_block(block_);
-}
-
-void CodeGenerator::Visit(StringConstant* node, void* data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState *func_state = func_->func_state();
- auto value = exec_state_->string_table_->StringFromUTF8(node->string());
- int index = func_state->AddConstant(Value(value));
- Instruction i = CREATE_ABx(OP_LOADK, reg, index);
- func_state->AddInstruction(i);
- }
-}
-
-void CodeGenerator::Visit(RegexConstant* node, void* data) {
- RegisterScope scope(block_);
-
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState *func_state = func_->func_state();
- auto reg_ex = exec_state_->string_table_->StringFromUTF8(node->reg());
- auto flag = exec_state_->string_table_->StringFromUTF8(node->flag());
- auto reg_mem_name = exec_state_->string_table_->StringFromUTF8("_reg");
- auto flag_mem_name = exec_state_->string_table_->StringFromUTF8("_flag");
-
- int r_index = func_state->AddConstant(Value(reg_ex));
- int f_index = func_state->AddConstant(Value(flag));
- int mr_index = func_state->AddConstant(Value(reg_mem_name));
- int mf_index = func_state->AddConstant(Value(flag_mem_name));
- auto reg_class_index = exec_state_->global()->IndexOf("RegExp");
-
- auto mr_id = block_->NextRegisterId();
- auto mf_id = block_->NextRegisterId();
- auto r_id = block_->NextRegisterId();
- auto f_id = block_->NextRegisterId();
- auto class_id = block_->NextRegisterId();
- auto tmp = block_->NextRegisterId();
-
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, mr_id, mr_index));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, mf_id, mf_index));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, r_id, r_index));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, f_id, f_index));
- func_state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, class_id, reg_class_index));
-
- func_state->AddInstruction(CREATE_ABC(OP_NEW, reg, Value::Type::CLASS_DESC, class_id));
-
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBERVAR, tmp, reg, mr_id));
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, tmp, r_id));
-
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBERVAR, tmp, reg, mf_id));
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, tmp, f_id));
- }
-}
-
-void CodeGenerator::Visit(ExpressionList* node, void* data) {
- for (auto it = node->raw_list().begin(); it != node->raw_list().end(); ++it) {
- auto temp = (*it).get();
- temp->Accept(this, nullptr);
- }
-}
-
-void CodeGenerator::Visit(ChunkStatement* stms, void* data) {
- FuncScope scope(this);
- block_->NextRegisterId();
- // For root func
- for (int i = 0; i < stms->statements()->raw_list().size(); ++i) {
- auto temp = stms->statements()->raw_list()[i].get();
- if (temp != NULL) {
- temp->Accept(this, data);
- }
- }
- exec_state_->func_state_.reset(func_->func_state());
- // Save global variables
- exec_state_->global_variables_ = block_->variables();
-}
-
-void CodeGenerator::Visit(CallExpression *stms, void *data) {
- FuncState *func_state = func_->func_state();
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- long caller = -1;
- size_t argc = 0;
- std::vector<long> caller_regs_order;
- if (stms->callee().get() != NULL) {
- caller = block_->NextRegisterId();
- stms->callee()->Accept(this, &caller);
- argc = stms->args().size();
- if (block_->idx() > caller + 1) {
- long reg_old_caller = caller;
- caller = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, caller, reg_old_caller));
- }
- caller_regs_order.push_back(caller);
- }
- else if (stms->expr().get()) {
- if (class_ && stms->expr()->IsIdentifier() && stms->expr()->AsIdentifier()->GetName() == JS_GLOBAL_SUPER)
- {
- ClassDescriptor *class_desc = ValueTo<ClassDescriptor>(class_->class_value());
- if (!class_desc->p_super_) {
- throw GeneratorError("can't call super without class desc");
- }
- ClassDescriptor *class_desc_super = class_desc->p_super_;
- int index = class_desc_super->funcs_->IndexOf(JS_GLOBAL_CONSTRUCTOR);
- if (index < 0) {
- throw GeneratorError("can't call super without class desc");
- }
- long reg_this = block_->FindRegisterId("this");
- if (reg_this < 0) {
- throw GeneratorError("can't call super this without class desc");
- }
- caller = block_->NextRegisterId();
- caller_regs_order.push_back(caller);
- long arg_super = block_->NextRegisterId();
- caller_regs_order.push_back(arg_super);
- func_state->AddInstruction(CREATE_ABC(OP_GETSUPER, arg_super, reg_this, caller));
- argc++;
- }
- else {
- if (stms->expr()->IsIdentifier() && stms->member() && stms->member()->IsIdentifier()) {
- long reg_member = block_->NextRegisterId();
- auto value = exec_state_->string_table_->StringFromUTF8(stms->member()->AsIdentifier()->GetName());
- int tableIndex = func_state->AddConstant(Value(value));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, reg_member, tableIndex));
- long reg_class = block_->FindRegisterId(stms->expr()->AsIdentifier()->GetName());
- if (reg_class < 0) {
- throw GeneratorError("can't find " + stms->expr()->AsIdentifier()->GetName());
- }
- // caller and args must be continuous;
- caller = block_->NextRegisterId();
- caller_regs_order.push_back(caller);
- func_state->AddInstruction(CREATE_ABC(OP_GETCLASS, caller, reg_class, reg_member));
- long arg = block_->NextRegisterId();
- caller_regs_order.push_back(arg);
- stms->expr()->Accept(this, &arg);
- argc = stms->args().size() + 1;
- }
- else {
- caller = block_->NextRegisterId();
- stms->expr()->Accept(this, &caller);
- argc = stms->args().size();
- if (block_->idx() > caller + 1) {
- long reg_old_caller = caller;
- caller = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, caller, reg_old_caller));
- }
- caller_regs_order.push_back(caller);
- if (stms->expr()->IsMemberExpression()) {
- Handle<Expression> left = stms->expr()->AsMemberExpression()->expr();
- if (left->IsIdentifier()) {
- std::string class_name = left->AsIdentifier()->GetName();
- int index = exec_state_->global()->IndexOf(class_name);
- if (index <= 0) {
- long arg = block_->NextRegisterId();
- caller_regs_order.push_back(arg);
- stms->expr()->AsMemberExpression()->expr()->AsIdentifier()->Accept(this, &arg);
- argc++;
- }
- }
- else {
- long arg = block_->NextRegisterId();
- left->Accept(this, &arg);
- caller_regs_order.push_back(arg);
- argc++;
- }
- }
- }
- }
- }
- for (auto it = stms->args().begin(); it != stms->args().end(); ++it) {
- auto temp = (*it).get();
- long arg = block_->NextRegisterId();
- caller_regs_order.push_back(arg);
- temp->Accept(this, &arg);
- }
- if (stms->args_expr() != nullptr && stms->args_expr()->IsArgumentList()) {
- Handle<ArgumentList> arg_list = stms->args_expr()->AsArgumentList();
- for (int i = 0; i < arg_list->length(); i++) {
- long arg = block_->NextRegisterId();
- arg_list->args()->raw_list()[i]->Accept(this, &arg);
- caller_regs_order.push_back(arg);
- }
- argc += arg_list->length();
- }
- AddCallInstruction(ret, OP_CALL, caller_regs_order);
-}
-
-void CodeGenerator::AddCallInstruction(long ret, OPCode code, std::vector<long> orders) {
- FuncState *func_state = func_->func_state();
- bool reorder = false;
- int regs_count = static_cast<int>(orders.size());
- for (int i = 1; i < regs_count; i++) {
- if (orders[i] - orders[i - 1] != 1) {
- reorder = true;
- break;
- }
- }
- if (!reorder && regs_count > 0) {
- reorder = orders[regs_count - 1] + 1 >= block_->idx() ? false : true;
- }
- int argc = regs_count - 1;
- if (reorder) {
- long caller = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, caller, orders[0]));
- for (int i = 1; i < orders.size(); i++) {
- long arg = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, arg, orders[i]));
- }
- func_state->AddInstruction(CREATE_ABC(code, ret, argc, caller));
- }
- else {
- func_state->AddInstruction(CREATE_ABC(code, ret, argc, orders[0]));
- }
-}
-
-void CodeGenerator::Visit(ArgumentList *node, void *data) {
- Handle<ExpressionList> exprList = node->args();
- exprList->Accept(this, data);
-}
-
-void CodeGenerator::Visit(IfStatement *node, void *data) {
- RegisterScope scope(block_);
- long condition = block_->NextRegisterId();
- FuncState *func_state = func_->func_state();
- if (node->condition().get() != NULL) {
- node->condition()->Accept(this, &condition);
- }
- auto slot = func_state->AddInstruction(0);
- int tb_start_index = (int)func_state->instructions().size() - 1;
- if (node->body().get() != NULL) {
- node->body()->Accept(this, nullptr);
- }
- int tb_end_index = (int)func_state->instructions().size() - 1;
- func_state->ReplaceInstruction(slot, CREATE_ABx(OP_JMP, condition, tb_end_index - tb_start_index));
-}
-
-void CodeGenerator::Visit(TernaryExpression *node, void *data) {
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- FuncState *func_state = func_->func_state();
- long first = block_->NextRegisterId();
- if (node->first().get() != NULL) {
- node->first()->Accept(this, &first);
- }
- auto slot = func_state->AddInstruction(0);
- int second_index = (int)func_state->instructions().size() - 1;
- if (node->second().get() != NULL) {
- node->second()->Accept(this, &ret);
- }
- auto goto_slot = func_state->AddInstruction(0);
- int third_index = (int)func_state->instructions().size() - 1;
- if (node->third().get() != NULL) {
- node->third()->Accept(this, &ret);
- }
- int end_index = (int)func_state->instructions().size();
- func_state->ReplaceInstruction(slot, CREATE_ABx(OP_JMP, first, third_index - second_index));
- func_state->ReplaceInstruction(goto_slot, CREATE_Ax(OP_GOTO, end_index));
-}
-
-void CodeGenerator::Visit(IfElseStatement *node, void *data) {
- long ifcondition = block_->NextRegisterId();
- FuncState *func_state = func_->func_state();
- if (node->condition().get() != NULL) {
- node->condition()->Accept(this, &ifcondition);
- }
- auto slot = func_state->AddInstruction(0);
- int tb_start_index = (int)func_state->instructions().size() - 1;
- if (node->body().get() != NULL) {
- node->body()->Accept(this, nullptr);
- }
- auto else_slot = func_state->AddInstruction(0);
- int tb_end_index = (int)func_state->instructions().size() - 1;
- if (node->els().get() != NULL) {
- node->els()->Accept(this, nullptr);
- }
- func_state->ReplaceInstruction(slot, CREATE_ABx(OP_JMP, ifcondition, tb_end_index - tb_start_index));
- int end_index = (int)func_state->instructions().size();
- func_state->ReplaceInstruction(else_slot, CREATE_Ax(OP_GOTO, end_index));
-}
-
-void CodeGenerator::Visit(ContinueStatement *node, void *data) {
- do {
- FuncState *func_state = func_->func_state();
- int for_update_index = block_->for_update_index();
- if (for_update_index >= 0) {
- func_state->AddInstruction(CREATE_Ax(OP_GOTO, for_update_index));
- }
- else {
- auto slot = func_state->AddInstruction(0);
- block_->for_continue_slots().push_back(slot);
- }
-
- } while (0);
-}
-
-void CodeGenerator::Visit(ForStatement *node, void *data) {
- BlockScope for_scope(this); // for var index = 0;
- FuncState *func_state = func_->func_state();
- block_->set_is_loop(true);
- long condition = block_->NextRegisterId();
- if (node->init().get() != NULL) {
- node->init()->Accept(this, node->kind() == ForKind::kForIn ? &condition : nullptr);
- }
- int condition_start_index = -1;
- if (node->kind() == ForKind::kForIn) {
- condition_start_index = block_->for_start_index();
- }
- else {
- condition_start_index = (int)func_state->instructions().size(); // aka next one.
- block_->set_for_start_index(condition_start_index);
- }
- if (node->condition().get() != NULL) {
- node->condition()->Accept(this, &condition);
- }
- auto slot = func_state->AddInstruction(0);
- if (node->body().get() != NULL) {
- node->body()->Accept(this, nullptr);
- }
- int for_update_index = condition_start_index;
- if (node->update().get() != NULL) {
- for_update_index = (int)func_state->instructions().size(); // aka next one.
- node->update()->Accept(this, nullptr);
- }
- block_->set_for_update_index(for_update_index);
- func_state->AddInstruction(CREATE_Ax(OP_GOTO, condition_start_index));
- int for_end_index = (int)func_->func_state()->instructions().size() - 1;
- func_state->ReplaceInstruction(slot, (CREATE_ABx(OP_JMP, condition, for_end_index - slot)));
- std::vector<size_t> for_contiue_slots = block_->for_continue_slots();
- for (int i = 0; i < for_contiue_slots.size(); i++) {
- func_state->ReplaceInstruction(for_contiue_slots[i], CREATE_Ax(OP_GOTO, for_update_index));
- }
- for_contiue_slots.clear();
-}
-
-void CodeGenerator::Visit(BlockStatement* node, void* data) {
- BlockScope block_scoped(this);
- for (int i = 0; i < node->statements()->raw_list().size(); ++i) {
- auto temp = node->statements()->raw_list()[i].get();
- if (temp != NULL) {
- temp->Accept(this, data);
- }
- }
-}
-
-void CodeGenerator::Visit(FunctionPrototype *node, void *data) {}
-
-void CodeGenerator::Visit(FunctionStatement *node, void *data) {
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- RegisterScope register_scope(block_);
- Handle<FunctionPrototype> proto = node->proto();
- bool is_class_func = func_->parent() == nullptr && class_ ? true : false;
- // body
- // Slot
- auto slot = func_->func_state()->AddInstruction(0);
- {
- FuncScope scope(this);
- func_->func_state()->set_name(proto->GetName());
- if (is_class_func) {
- Value value;
- value.f = func_->func_state();
- value.type = Value::FUNC;
- ClassDescriptor *class_desc = ValueTo<ClassDescriptor>(class_->class_value());
- class_desc->funcs_->Add(proto->GetName(), value);
- func_->func_state()->set_is_class_func(is_class_func);
- }
- // skip func value in the fornt of stack;
- block_->NextRegisterId();
-
- // make arguments var in thie front of stack;
- if (is_class_func) {
- long arg = block_->NextRegisterId();
- block_->AddVariable("this", arg);
- func_->func_state()->argc()++;
- func_->func_state()->args().push_back(arg);
- }
- for (int i = 0; i < proto->GetArgs().size(); i++) {
- long arg = block_->NextRegisterId();
- block_->AddVariable(proto->GetArgs().at(i), arg);
- func_->func_state()->args().push_back(arg);
- func_->func_state()->argc()++;
- }
- node->body()->Accept(this, nullptr);
- if (func_->func_state()->out_closure().size() > 0) {
- for (int i = 0; i < func_->func_state()->out_closure().size(); i++) {
- ValueRef *ref = func_->func_state()->out_closure()[i];
- func_->func_state()->AddInstruction(CREATE_Ax(OP_REMOVE_CLOSURE, ref->ref_id()));
- }
- }
- }
-
- // function prototype
- // associate function_name and function_state
- if (func_->parent() == nullptr) {
- // in chunk
- if (!is_class_func) {
- Value value;
- value.f = func_->func_state()->GetChild(func_->func_state()->children().size() - 1);
- value.type = Value::FUNC;
- if (proto->GetName().length() > 0) {
- exec_state_->global()->Add(proto->GetName(), value);
- }
- else {
- int index = exec_state_->global()->Add(value);
- if (index >= 0) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_GETGLOBAL, ret, index));
- }
- }
- }
- }
- else {
- // inside function
- int index = (int)func_->func_state()->children().size() - 1;
- Instruction i = CREATE_ABx(OP_GETFUNC, ret, index);
- func_->func_state()->ReplaceInstruction(slot, i);
- if (proto->GetName().length() > 0) {
- block_->AddVariable(proto->GetName(), ret);
- }
- }
-}
-
-void CodeGenerator::Visit(ThisExpression *node, void *data) {
- long ret = data == nullptr ? -1 : *static_cast<long *>(data);
- if (ret >= 0) {
- // searching in global
- long rhs = block_->FindRegisterId("this");
- if (rhs != ret) {
- // a = b
- func_->func_state()->AddInstruction(CREATE_ABx(OP_MOVE, ret, rhs));
- }
- }
-}
-
-void CodeGenerator::Visit(ArrowFunctionStatement *node, void *data) {
- RegisterScope register_scope(block_);
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- bool is_class_func = func_->parent() == nullptr && class_ ? true : false;
- // body
- // Slot
- auto slot = func_->func_state()->AddInstruction(0);
- {
- FuncScope scope(this);
- if (is_class_func) {
- Value value;
- value.f = func_->func_state();
- value.type = Value::FUNC;
- ClassDescriptor *class_desc = ValueTo<ClassDescriptor>(class_->class_value());
- if (node->name().size() > 0) {
- class_desc->funcs_->Add(node->name(), value);
- }
- func_->func_state()->set_is_class_func(is_class_func);
- }
- // skip func value in the fornt of stack;
- block_->NextRegisterId();
- // make arguments var in thie front of stack;
- if (is_class_func) {
- long arg = block_->NextRegisterId();
- block_->AddVariable("this", arg);
- func_->func_state()->argc()++;
- func_->func_state()->args().push_back(arg);
- }
- // make arguments var in thie front of stack;
- for (int i = 0; i < node->args().size(); i++) {
- if (node->args()[i]->IsIdentifier()) {
- long arg = block_->NextRegisterId();
- block_->AddVariable(node->args()[i]->AsIdentifier()->GetName(), arg);
- func_->func_state()->argc()++;
- func_->func_state()->args().push_back(arg);
- }
- else if (node->args()[i]->IsCommaExpression()) {
- Handle<ExpressionList> arg_list = node->args()[i]->AsCommaExpression()->exprs();
- for (int j = 0; j < arg_list->Size(); j++) {
- long arg = block_->NextRegisterId();
- block_->AddVariable(arg_list->raw_list()[j]->AsIdentifier()->GetName(), arg);
- func_->func_state()->argc()++;
- func_->func_state()->args().push_back(arg);
- }
- }
- else {
- // force to error
- throw GeneratorError("arrow function only supporting args list");
- }
- }
- if (node->body()->IsJSXNodeExpression()) {
- long return1 = block_->NextRegisterId();
- node->body()->Accept(this, &return1);
- func_->func_state()->AddInstruction(CREATE_Ax(OP_RETURN1, return1));
- }
- else {
- node->body()->Accept(this, nullptr);
- }
- if (func_->func_state()->out_closure().size() > 0) {
- for (int i = 0; i < func_->func_state()->out_closure().size(); i++) {
- ValueRef *ref = func_->func_state()->out_closure()[i];
- func_->func_state()->AddInstruction(CREATE_Ax(OP_REMOVE_CLOSURE, ref->ref_id()));
- }
- }
- }
- // associate function_name and function_state
- if (func_->parent() == nullptr) {
- if (!is_class_func) {
- // in chunk
- Value value;
- assert(data);
- value.f = func_->func_state()->GetChild(func_->func_state()->children().size() - 1);
- value.type = Value::FUNC;
- int index = exec_state_->global()->Add(value);
- if (index >= 0) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_GETGLOBAL, ret, index));
- }
- }
- }
- else {
- // inside function
- int index = (int)func_->func_state()->children().size() - 1;
- Instruction i = CREATE_ABx(OP_GETFUNC, ret, index);
- func_->func_state()->ReplaceInstruction(slot, i);
- }
-}
-
-void CodeGenerator::Visit(ClassStatement *node, void *data) {
- do {
- Handle<Expression> super_expr = node->Super();
- Value *super_value = nullptr;
- if (super_expr) {
- if (!super_expr->IsIdentifier()) {
- throw GeneratorError("super isn't a Identifier");
- break;
- }
- int index = exec_state_->global()->IndexOf(super_expr->AsIdentifier()->GetName());
- if (index == -1) {
- throw GeneratorError("can't find super class" + super_expr->AsIdentifier()->GetName());
- break;
- }
- super_value = exec_state_->global()->Find(index);
- if (super_value->type != Value::CLASS_DESC) {
- throw GeneratorError("can't find super class" + super_expr->AsIdentifier()->GetName());
- break;
- }
- }
- std::string class_name = node->Identifier()->AsIdentifier()->GetName();
- int index = exec_state_->global()->IndexOf(class_name);
- if (index != -1) {
- throw GeneratorError(class_name + "redefine");
- break;
- }
- Value class_value(exec_state_->class_factory()->CreateClassDescriptor(super_value ? ValueTo<ClassDescriptor>(super_value) : nullptr));
- exec_state_->global()->Add(class_name, class_value);
- ClassScope scope(this, &class_value);
- class_->class_name() = class_name;
- node->Body()->Accept(this, nullptr);
-
- } while (0);
-}
-
-void CodeGenerator::Visit(ClassBody *node, void *data) {
- for (int i = 0; i < node->raw_list().size(); i++) {
- node->raw_list()[i]->Accept(this, data);
- }
-}
-
-void CodeGenerator::Visit(NewExpression *node, void *data) {
- do {
- RegisterScope scope(block_);
- long lhs = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- if (lhs >= 0) {
- FuncState *func_state = func_->func_state();
- long rhs = block_->FindRegisterId(node->name()->AsIdentifier()->GetName());
- if (rhs < 0) {
- int index = exec_state_->global()->IndexOf(node->name()->AsIdentifier()->GetName());
- if (index >= 0) {
- Value *name = exec_state_->global()->Find(index);
- if (IsClass(name)) {
- rhs = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, rhs, index));
- }
- else {
- // function call
- func_state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, lhs, index));
- break;
- }
- }
- else {
- throw GeneratorError("can't find new identifier: " + node->name()->AsIdentifier()->GetName());
- }
- }
- func_state->AddInstruction(CREATE_ABC(OP_NEW, lhs, Value::CLASS_DESC, rhs));
- long caller = block_->NextRegisterId();
- long inst = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, inst, lhs));
- std::vector<long> orders = { caller, inst };
- if (node->args()->Size() > 0) {
- for (int i = 0; i < node->args()->Size(); i++) {
- long arg = block_->NextRegisterId();
- orders.push_back(arg);
- node->args()->raw_list()[i]->Accept(this, &arg);
- }
- }
- AddCallInstruction(lhs, OP_CONSTRUCTOR, orders);
- }
-
- } while (0);
-
-}
-
-void CodeGenerator::Visit(JSXNodeExpression *node, void *data) {
- do {
- FuncState *func_state = func_->func_state();
- if (!node->LowerIdentifier()) {
- std::string name = node->Identifier()->AsIdentifier()->GetName();
- int index = exec_state_->global()->IndexOf(name);
- if (index >= 0) {
- node->SetClass(true);
- }
- }
- std::vector<Handle<Expression>> exprs = node->funcexprs();
- for (int i = 0; i < exprs.size(); i++) {
- exprs[i]->Accept(this, nullptr);
- }
- std::string vnode_ptr = node->node_ptr()->AsStringConstant()->string();
- long reg_parent = block_->FindRegisterId(vnode_ptr);
- if (reg_parent < 0) {
- throw GeneratorError("can't find identifier: " + node->node_ptr()->AsStringConstant()->string());
- }
- std::vector<Handle<Expression>> childrens = node->childrens();
- // 递归 childrens
- if (childrens.size() > 0) {
- for (int i = 0; i < childrens.size(); i++) {
- long ret = block_->NextRegisterId();
- long caller = block_->NextRegisterId();
- size_t argc = 2;
- long arg_0 = block_->NextRegisterId();
- long arg_1 = block_->NextRegisterId();
- int index = exec_state_->global()->IndexOf("appendChild");
- if (index < 0) {
- throw GeneratorError("can't find identifier appendChild");
- }
- func_state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, caller, index));
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, arg_0, reg_parent));
- childrens[i]->Accept(this, &arg_1);
- func_state->AddInstruction(CREATE_ABC(OP_CALL, ret, argc, caller));
- }
- }
- if (data) {
- long ret = *static_cast<long *>(data);
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, ret, reg_parent));
- }
-
- } while (0);
-}
-
-void CodeGenerator::Visit(BinaryExpression *node, void *data) {
- long left = -1;
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- if (node->lhs() && (node->lhs()->IsDeclaration() || node->lhs()->IsDeclarationList())) {
- left = block_->NextRegisterId();
- node->lhs()->Accept(this, &left);
- }
- BinaryOperation opeartion = node->op();
- FuncState *func_state = func_->func_state();
- RegisterScope scope(block_);
- if (left < 0) {
- left = block_->NextRegisterId();
- if (node->lhs().get() != NULL) {
- node->lhs()->Accept(this, &left);
- }
- }
- if (opeartion == BinaryOperation::kIn) {
- int for_start_index = (int)func_state->instructions().size(); // aka next one.
- block_->set_for_start_index(for_start_index);
- }
- switch (opeartion) {
- case BinaryOperation::kAddition:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a + b
- func_state->AddInstruction(CREATE_ABC(OP_ADD, ret, left, right));
- break;
- }
- case BinaryOperation::kSubtraction:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a - b
- func_state->AddInstruction(CREATE_ABC(OP_SUB, ret, left, right));
- break;
- }
- case BinaryOperation::kMultiplication:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a * b
- func_state->AddInstruction(CREATE_ABC(OP_MUL, ret, left, right));
- break;
- }
- case BinaryOperation::kDivision:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a / b
- func_state->AddInstruction(CREATE_ABC(OP_DIV, ret, left, right));
- break;
- }
- case BinaryOperation::kMod:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a % b
- func_state->AddInstruction(CREATE_ABC(OP_MOD, ret, left, right));
- break;
- }
- case BinaryOperation::kLessThan:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_LT, ret, left, right));
- break;
- }
- case BinaryOperation::kGreaterThan:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_GT, ret, left, right));
- break;
- }
- case BinaryOperation::kLessThanEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_LTE, ret, left, right));
- break;
- }
- case BinaryOperation::kGreaterThanEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_GTE, ret, left, right));
- break;
- }
- case BinaryOperation::kAnd:
- {
- auto slot = func_state->AddInstruction(0);
- int second_index = (int)func_state->instructions().size() - 1;
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_AND, ret, left, right));
- auto goto_slot = func_state->AddInstruction(0);
- int third_index = (int)func_state->instructions().size() - 1;
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, ret, left));
- int end_index = (int)func_state->instructions().size();
- func_state->ReplaceInstruction(slot, CREATE_ABx(OP_JMP, left, third_index - second_index));
- func_state->ReplaceInstruction(goto_slot, CREATE_Ax(OP_GOTO, end_index));
- break;
- }
- case BinaryOperation::kStrictEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_SEQ, ret, left, right));
- break;
- }
- case BinaryOperation::kIn:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_IN, ret, left, right));
- break;
- }
- case BinaryOperation::kOr:
- {
- auto slot = func_state->AddInstruction(0);
- int second_index = (int)func_state->instructions().size() - 1;
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, ret, left));
- auto goto_slot = func_state->AddInstruction(0);
- int third_index = (int)func_state->instructions().size() - 1;
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_OR, ret, left, right));
- int end_index = (int)func_state->instructions().size();
- func_state->ReplaceInstruction(slot, CREATE_ABx(OP_JMP, left, third_index - second_index));
- func_state->ReplaceInstruction(goto_slot, CREATE_Ax(OP_GOTO, end_index));
- break;
- }
- case BinaryOperation::kEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_EQ, ret, left, right));
- break;
- }
- case BinaryOperation::kNotEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_EQ, ret, left, right));
- func_state->AddInstruction(CREATE_ABx(OP_NOT, ret, ret));
- break;
- }
- case BinaryOperation::kStrictNotEqual:
- {
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- func_state->AddInstruction(CREATE_ABC(OP_SEQ, ret, left, right));
- func_state->AddInstruction(CREATE_ABx(OP_NOT, ret, ret));
- break;
- }
- default:
- {
- throw GeneratorError("unsupport binary operation");
- break;
- }
- }
-}
-
-void CodeGenerator::Visit(AssignExpression *node, void *data) {
- RegisterScope scope(block_);
- // needs to be left value, for now only identifer is supported.
- // this = a;
- // this.b = a; TBD
- long left = -1;
- if (node->lhs().get() != NULL) {
- if (node->lhs()->IsIdentifier()) {
- auto& name = node->lhs()->AsIdentifier()->GetName();
- left = block_->FindRegisterId(name);
- }
- else {
- left = block_->NextRegisterId();
- node->lhs()->Accept(this, &left);
- }
- }
- long right = block_->NextRegisterId();
- if (node->rhs().get() != NULL) {
- node->rhs()->Accept(this, &right);
- }
- // a = b
- FuncState *func_state = func_->func_state();
- switch (node->op()) {
- case AssignOperation::kAssign:
- {
- if (class_ && node->lhs()->IsMemberExpression() && node->lhs()->AsMemberExpression()->expr()->IsThisExpression()) {
- func_state->AddInstruction(CREATE_ABx(OP_SETMEMBERVAR, left, right));
- }
- else {
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, left, right));
- }
- break;
- }
- case AssignOperation::kAssignAdd:
- {
- long ret = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABC(OP_ADD, ret, left, right));
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, left, ret));
- break;
- }
- case AssignOperation::kAssignSub:
- {
- long ret = block_->NextRegisterId();
- func_state->AddInstruction(CREATE_ABC(OP_SUB, ret, left, right));
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, left, ret));
- break;
- }
- default:
- break;
- }
-}
-
-void CodeGenerator::Visit(Declaration *node, void *data) {
- long reg = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- FuncState *func_state = func_->func_state();
- block_->AddVariable(node->name(), reg);
- if (node->expr().get() != nullptr) {
- node->expr()->Accept(this, ®);
- }
- else {
- func_state->AddInstruction(CREATE_Ax(OP_LOADNULL, reg));
- }
-}
-
-void CodeGenerator::Visit(DeclarationList *node, void *data) {
- for (int i = 0; i < node->exprs().size(); ++i) {
- auto temp = node->exprs()[i].get();
- if (temp != NULL) {
- temp->Accept(this, data);
- }
- }
-}
-
-void CodeGenerator::Visit(CommaExpression* node, void* data) {
- bool first = true;
- for (auto it = node->exprs()->begin(); it != node->exprs()->end(); ++it) {
- auto temp = (*it).get();
- temp->Accept(this, first ? data : nullptr);
- first = false;
- }
-}
-
-void CodeGenerator::Visit(IntegralConstant* node, void* data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState* func_state = func_->func_state();
- int value = node->value();
- int index = func_state->AddConstant(Value(static_cast<int64_t>(value)));
- Instruction i = CREATE_ABx(OP_LOADK, reg, index);
- func_state->AddInstruction(i);
- }
-}
-
-void CodeGenerator::Visit(BooleanConstant* node, void* data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState* func_state = func_->func_state();
- bool value = node->pred();
- int index = func_state->AddConstant(Value(static_cast<bool>(value)));
- Instruction i = CREATE_ABx(OP_LOADK, reg, index);
- func_state->AddInstruction(i);
- }
-}
-
-void CodeGenerator::Visit(DoubleConstant* node, void* data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState* func_state = func_->func_state();
- double value = node->value();
- int index = func_state->AddConstant(Value(static_cast<double>(value)));
- Instruction i = CREATE_ABx(OP_LOADK, reg, index);
- func_state->AddInstruction(i);
- }
-}
-
-void CodeGenerator::Visit(NullConstant *node, void *data) {
- long reg = data == nullptr ? -1 : *static_cast<long *>(data);
- if (reg >= 0) {
- FuncState *func_state = func_->func_state();
- func_state->AddInstruction(CREATE_Ax(OP_LOADNULL, reg));
- }
-}
-
-void CodeGenerator::Visit(UndefinedConstant *node, void *data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- if (reg >= 0) {
- FuncState *func_state = func_->func_state();
- func_state->AddInstruction(CREATE_Ax(OP_LOADNULL, reg));
- }
-}
-
-void CodeGenerator::Visit(ObjectConstant *node, void *data) {
- long ret = data == nullptr ? -1 : *static_cast<long *>(data);
- FuncState *func_state = func_->func_state();
- if (ret >= 0) {
- func_state->AddInstruction(CREATE_ABC(OP_NEW, ret, Value::TABLE, 0));
- if (node->SpreadProperty().size() > 0) {
- std::vector<std::pair<ProxyOrder, std::string>> &orders = node->Orders();
- for (int i = 0; i < orders.size(); i++) {
- switch (orders[i].first) {
- case ProxyOrder::ProxyArray:
- {
- int index = atoi(orders[i].second.c_str());
- if (index < node->SpreadProperty().size()) {
- long key = block_->NextRegisterId();
- node->SpreadProperty()[index]->Accept(this, &key);
- func_state->AddInstruction(CREATE_ABC(OP_SETTABLE, ret, key, key));
- }
- break;
- }
- case ProxyOrder::ProxyObject:
- {
- RegisterScope scope(block_);
- auto iter = node->proxy().find(orders[i].second);
- if (iter != node->proxy().end()) {
- long item = block_->NextRegisterId();
- long key = block_->NextRegisterId();
- iter->second->Accept(this, &item);
- auto value = exec_state_->string_table_->StringFromUTF8(iter->first);
- int keyIndex = func_state->AddConstant(Value(value));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, key, keyIndex));
- func_state->AddInstruction(CREATE_ABC(OP_SETTABLE, ret, key, item));
- }
- break;
- }
- default:
- break;
- }
- }
- }
- else {
- // expr
- for (auto it = node->proxy().begin(); it != node->proxy().end(); it++) {
- RegisterScope scope(block_);
- long item = block_->NextRegisterId();
- long key = block_->NextRegisterId();
- auto ktemp = (*it).second;
- ktemp->Accept(this, &item);
- auto value = exec_state_->string_table_->StringFromUTF8(it->first);
- int keyIndex = func_state->AddConstant(Value(value));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, key, keyIndex));
- func_state->AddInstruction(CREATE_ABC(OP_SETTABLE, ret, key, item));
- }
- }
- }
-}
-// TODO: this is not correct.
-void CodeGenerator::Visit(ArrayConstant *node, void *data) {
- long reg = data == nullptr ? -1 : *static_cast<long*>(data);
- FuncState *func_state = func_->func_state();
- // new table
- if (reg >= 0) {
- func_state->AddInstruction(CREATE_ABC(OP_NEW, reg, Value::ARRAY, 0));
- int index = 0;
- for (auto it = node->exprs().begin(); it != node->exprs().end(); it++) {
- long item = block_->NextRegisterId();
- auto temp = (*it).get();
- temp->Accept(this, &item);
- Instruction i = CREATE_ABC(OP_SETARRAY, reg, index++, item);
- func_state->AddInstruction(i);
- }
- }
-}
-
-void CodeGenerator::Visit(ClassProperty *node, void *data) {
- RegisterScope scope(block_);
- assert(class_);
- do {
- FuncState *func_state = func_->func_state();
- if (node->is_static()) {
- long lhs = block_->NextRegisterId();
- long rhs = block_->NextRegisterId();
- int index = exec_state_->global()->IndexOf(class_->class_name());
- if (index <= 0) {
- throw GeneratorError("can't find class name " + class_->class_name());
- break;
- }
- func_state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, lhs, index));
- auto constant = exec_state_->string_table_->StringFromUTF8(node->name());
- index = func_state->AddConstant(Value(constant));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, rhs, index));
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBERVAR, lhs, lhs, rhs));
- if (node->init()) {
- node->init()->Accept(this, &rhs);
- func_state->AddInstruction(CREATE_ABx(OP_MOVE, lhs, rhs));
- }
- else {
- func_state->AddInstruction(CREATE_Ax(OP_LOADNULL, lhs));
- }
- }
-
- } while (0);
-}
-
-void CodeGenerator::Visit(MemberExpression *node, void *data) {
- RegisterScope registerScope(block_);
- long ret = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- FuncState *func_state = func_->func_state();
- if (node->kind() == MemberAccessKind::kIndex) {
- Handle<Expression> left = node->expr();
- left->Accept(this, &ret);
- long mindex = block_->NextRegisterId();
- if (node->member().get() != NULL) {
- node->member()->Accept(this, &mindex);
- }
- if (!node->ProduceRValue()) {
- func_state->AddInstruction(CREATE_ABC(OP_GETINDEXVAR, ret, ret, mindex));
- }
- else {
- func_state->AddInstruction(CREATE_ABC(OP_GETINDEX, ret, ret, mindex));
- }
- }
- else if (node->kind() == MemberAccessKind::kDot || node->kind() == MemberAccessKind::kCall) {
- Handle<Expression> left = node->expr();
- left->Accept(this, &ret);
- long right = block_->NextRegisterId();
- auto value = exec_state_->string_table_->StringFromUTF8(node->member()->AsIdentifier()->GetName());
- int tableIndex = func_state->AddConstant(Value(value));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, right, tableIndex));
- if (!node->ProduceRValue()) {
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBERVAR, ret, ret, right));
- }
- else {
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBER, ret, ret, right));
- }
- }
- else if (node->kind() == MemberAccessKind::kClass) {
- Handle<Expression> left = node->expr();
- left->Accept(this, &ret);
- long right = block_->NextRegisterId();
- auto value = exec_state_->string_table_->StringFromUTF8(node->member()->AsIdentifier()->GetName());
- int tableIndex = func_state->AddConstant(Value(value));
- func_state->AddInstruction(CREATE_ABx(OP_LOADK, right, tableIndex));
- if (!node->ProduceRValue()) {
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBERVAR, ret, ret, right));
- }
- else {
- func_state->AddInstruction(CREATE_ABC(OP_GETMEMBER, ret, ret, right));
- }
- }
-}
-
-void CodeGenerator::Visit(Identifier *node, void *data) {
- RegisterScope register_scope(block_);
- long reg_a = data == nullptr ? block_->NextRegisterId() : *static_cast<long *>(data);
- if (reg_a >= 0) {
- FuncState *state = func_->func_state();
- long reg_b = block_->FindRegisterId(node->GetName());
- if (reg_b >= 0) {
- state->AddInstruction(CREATE_ABx(OP_MOVE, reg_a, reg_b));
- return;
- }
-
- int index = exec_state_->global()->IndexOf(node->GetName());
- if (index >= 0) {
- state->AddInstruction(CREATE_ABx(OP_GETGLOBAL, reg_a, index));
- return;
- }
-
- // TODO Fix me: Identifer searching in this scope should be ahead of
- // searching in global
- long this_idx = block_->FindRegisterId("this");
- if (this_idx >= 0) {
- // using this
- long right = block_->NextRegisterId();
-
- FuncState* func_state = func_->func_state();
- auto value = exec_state_->string_table_->StringFromUTF8(node->GetName());
- int tableIndex = func_state->AddConstant(Value(value));
-
- func_state->AddInstruction(
- CREATE_ABx(OP_LOADK, right, tableIndex));
- func_state->AddInstruction(
- CREATE_ABC(OP_GETMEMBER, reg_a, this_idx, right));
- } else {
- // make data undefined.
- state->AddInstruction(CREATE_Ax(OP_LOADNULL, reg_a));
- }
- }
-}
-
-void CodeGenerator::Visit(PrefixExpression *node, void *data) {
- RegisterScope scope(block_);
- long ret = data == nullptr ? block_->NextRegisterId()
- : *static_cast<long *>(data);
- Handle<Expression> expr = node->expr();
- long reg = block_->NextRegisterId();
- if (expr->IsIdentifier()) {
- reg = block_->FindRegisterId(expr->AsIdentifier()->GetName());
- } else {
- expr->Accept(this, ®);
- }
- PrefixOperation operation = node->op();
- // ++i
- if (operation == PrefixOperation::kIncrement) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_PREV_INCR, reg, ret));
- }
- // --i
- else if (operation == PrefixOperation::kDecrement) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_PREV_DECR, reg, ret));
- }
- else if (operation == PrefixOperation::kNot) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_NOT, ret, reg));
- }
- else if (operation == PrefixOperation::kUnfold) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_MOVE, ret, reg));
- }
- else if (operation == PrefixOperation::kTypeof) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_TYPEOF, ret, reg));
- }
-}
-
-void CodeGenerator::Visit(PostfixExpression *node, void *data) {
- RegisterScope scope(block_);
- long ret = data == nullptr ? block_->NextRegisterId()
- : *static_cast<long *>(data);
- Handle<Expression> expr = node->expr();
- long reg = -1;
- if (expr->IsIdentifier()) {
- reg = block_->FindRegisterId(expr->AsIdentifier()->GetName());
- }
- else {
- reg = block_->NextRegisterId();
- expr->Accept(this, ®);
- }
- PostfixOperation operation = node->op();
- // i++
- if (operation == PostfixOperation::kIncrement) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_POST_INCR, reg, ret));
- }
- // i++
- else if (operation == PostfixOperation::kDecrement) {
- func_->func_state()->AddInstruction(CREATE_ABx(OP_POST_DECR, reg, ret));
- }
-}
-
-void CodeGenerator::Visit(ReturnStatement *node, void *data) {
- FuncState *func_state = func_->func_state();
- if (node->expr() == nullptr) {
- func_state->AddInstruction(CREATE_Ax(OP_RETURN0, 0));
- }
- else {
- long ret = block_->NextRegisterId();
- node->expr()->Accept(this, &ret);
- func_state->AddInstruction(CREATE_Ax(OP_RETURN1, ret));
- }
-}
-
-void CodeGenerator::Visit(SwitchStatement* node, void* data) {
- BlockScope for_scope(this);
- block_->set_is_switch(true);
-
- long test_value_id = block_->NextRegisterId();
- long case_value_id = block_->NextRegisterId();
- long test_result_id = block_->NextRegisterId();
-
- FuncState *func_state = func_->func_state();
- auto &cases = node->get_cases();
- //load test value into [test_value_id]
- node->test_case()->Accept(this,&test_value_id);
- std::vector<size_t> switch_case_index;
- std::vector<size_t> jump_slots;
-
- //value test for cases
- int defaultIndex = -1;
- Handle<CaseStatement> defaultCase;
- int index = 0;
- for(auto& a_case: cases){
- //load case value into [case_value_id]
- const Handle<CaseStatement>& caseStatement = a_case->AsCaseStatement();
- if (caseStatement->is_default()){
- jump_slots.push_back(0);
- defaultCase = caseStatement;
- defaultIndex = index;
- continue;
- }
- caseStatement->test_case()->Accept(this, &case_value_id);
- func_state->AddInstruction(CREATE_ABC(OP_EQ, test_result_id, test_value_id, case_value_id));
- size_t jump_slot = func_state->AddInstruction(0);
- jump_slots.push_back(jump_slot);
- index++;
- }
-
- size_t skip_to_end_slot = 0;
- if (defaultIndex != -1){
- //has default case
- size_t defaultJump = func_state->AddInstruction(0);
- jump_slots[defaultIndex] = defaultJump;
- } else {
- //no default
- skip_to_end_slot = func_state->AddInstruction(0);
- }
-
- //expression list for cases
- for(auto& a_case: cases){
- size_t lable_index = func_state->instructions().size();
- switch_case_index.push_back(lable_index);
-
- a_case->AsCaseStatement()->statements()->Accept(this, nullptr);
- }
-
- //replace case jump;
- index = 0;
- for(size_t to_replace:jump_slots){
- if(index == defaultIndex){
- func_state->ReplaceInstruction(to_replace,CREATE_Ax(OP_GOTO,switch_case_index[index]));
- } else {
- func_state->ReplaceInstruction(to_replace,CREATE_ABx(OP_TRUE_JMPTO,test_result_id,switch_case_index[index]));
- }
- index++;
- }
-
- //replace break;
- size_t end_index = func_state->instructions().size();;
- for(auto& to_replace:block_->break_slots()){
- func_state->ReplaceInstruction(to_replace, CREATE_Ax(OP_GOTO,end_index));
- }
-
- if (defaultIndex == -1){
- //no default, replace skip instruction;
- func_state->ReplaceInstruction(skip_to_end_slot, CREATE_Ax(OP_GOTO,end_index));
- }
-}
-
-void CodeGenerator::Visit(BreakStatement* node, void* data) {
- auto slot = func_->func_state()->AddInstruction(0);
- block_->break_slots().push_back(slot);
-}
-
-void CodeGenerator::Visit(TryCatchStatement* node, void* data) {
- node->try_block()->Accept(this, nullptr);
- if(node->finally()!= nullptr){
- node->finally()->Accept(this, nullptr);
- }
-}
-
-CodeGenerator::RegisterScope::~RegisterScope()
-{
- int start_idx = stored_idx_;
- BlockCnt *block = block_;
- FuncState *func_state = block_->func_state();
- if (func_state) {
- while (block) {
- if (block->func_state() == func_state) {
- auto iter = block->variables().begin();
- while (iter != block->variables().end()) {
- long reg_ref = iter->second;
- if (reg_ref >= start_idx) {
- iter = block->variables().erase(iter);
- }
- else {
- iter++;
- }
- }
- }
- block = block->parent();
- }
- }
- block = block_;
- if (func_state) {
- while (block && block->reg_refs().size() > 0) {
- if (block->func_state() == func_state) {
- auto iter = block->reg_refs().begin();
- while (iter != block->reg_refs().end()) {
- long reg_ref = *iter;
- if (reg_ref >= start_idx) {
- func_state->AddInstruction(CREATE_Ax(OP_RESETOUTVAR, reg_ref));
- iter = block->reg_refs().erase(iter);
- }
- else {
- iter++;
- }
- }
- }
- block = block->children();
- }
- }
- block_->is_register_scope() = false;
- block_->set_idx(stored_idx_);
-}
-
-void CodeGenerator::BlockCnt::AddVariable(const std::string &name, long reg) {
- auto iter = variables_.find(name);
- if (iter != variables_.end()) {
- variables_.erase(iter);
- }
- variables_.insert(std::make_pair(name, reg));
-}
-
-bool CodeGenerator::BlockCnt::FindVariable(const std::string &name) {
- auto iter = variables_.find(name);
- if (iter != variables_.end()) {
- return true;
- }
- if (parent() != nullptr) {
- return parent()->FindRegisterId(name) >= 0 ? true : false;
- }
- return false;
-}
-
-int CodeGenerator::BlockCnt::for_start_index() {
- if (is_loop()) {
- return for_start_index_;
- }
- if (parent() != nullptr) {
- if (parent()->is_loop()) {
- return parent()->for_start_index();
- }
- }
- return -1;
-}
-
-std::vector<size_t>& CodeGenerator::BlockCnt::for_continue_slots() {
- if (is_loop()) {
- return for_continue_slots_;
- }
- if (parent() != nullptr) {
- if (parent()->is_loop()) {
- return parent()->for_continue_slots_;
- }
- }
- return for_continue_slots_;
-}
-
-std::vector<size_t>& CodeGenerator::BlockCnt::break_slots() {
- if (is_loop()||is_switch()) {
- return for_break_slots_;
- }
- if (parent() != nullptr) {
- return parent()->break_slots();
- }
- return for_break_slots_;
-}
-
-int CodeGenerator::BlockCnt::for_update_index() {
- if (is_loop()) {
- return for_update_index_;
- }
- if (parent() != nullptr) {
- if (parent()->is_loop()) {
- return parent()->for_update_index();
- }
- }
- return -1;
-}
-
-void CodeGenerator::BlockCnt::reset() {
- for (int i = 0; i < reg_refs_.size(); i++) {
- if (func_state()) {
- func_state()->AddInstruction(CREATE_Ax(OP_RESETOUTVAR, reg_refs_[i]));
- }
- }
-}
-
-long CodeGenerator::BlockCnt::FindRegisterId(const std::string &name) {
- auto iter = variables_.find(name);
- if (iter != variables_.end()) {
- return iter->second;
- }
- if (parent() != nullptr) {
- if (parent()->func_state() == func_state_) {
- long reg_ref = parent()->FindRegisterId(name);
- if (reg_ref >= 0) {
- variables_.insert(std::make_pair(name, reg_ref));
- }
- return reg_ref;
- }
- else {
- long reg_ref = -1;
- ValueRef *ref = parent()->FindValueRef(name, reg_ref);
- if (ref) {
- BlockCnt *root_block = this;
- while (root_block->children() &&
- root_block->children()->func_state() == func_state_) {
- root_block = root_block->children();
- }
- reg_ref = root_block->NextRegisterId();
- root_block->reg_refs().push_back(reg_ref);
- if (ref->is_closure()) {
- func_state_->AddInClosure(ref);
- func_state_->AddInstruction(CREATE_ABx(OP_IN_CLOSURE, reg_ref, ref->ref_id()));
- }
- else {
- func_state_->AddInstruction(CREATE_ABx(OP_GETOUTVAR, reg_ref, ref->ref_id()));
- }
- }
- return reg_ref;
- }
- }
- return -1;
-}
-
-ValueRef *CodeGenerator::BlockCnt::FindValueRef(const std::string &name, long ®_ref) {
- auto iter = variables_.find(name);
- if (iter != variables_.end()) {
- if (exec_state_ && func_state_ ) {
- ValueRef *ref = exec_state_->AddRef(func_state_, iter->second);
- bool is_closure = func_state_->Inclusive(iter->second);
- if (is_closure) {
- ref->is_closure() = is_closure;
- func_state_->AddOutClosure(ref);
- }
- Instruction instruction = func_state_->instructions().size() > 0 ? func_state_->instructions()[func_state_->instructions().size() - 1] : 0;
- OPCode op(GET_OP_CODE(instruction));
- if (instruction && (op == OP_RETURN0 || op == OP_RETURN1)) {
- func_state_->instructions().pop_back();
- }
- func_state_->AddInstruction(CREATE_ABx(is_closure ? OP_OUT_CLOSURE : OP_SETOUTVAR, iter->second, ref->ref_id()));
- if (instruction && (op == OP_RETURN0 || op == OP_RETURN1)) {
- func_state_->AddInstruction(instruction);
- }
- return ref;
- }
- else {
- reg_ref = iter->second;
- return nullptr;
- }
- }
- if (parent() != nullptr) {
- return parent()->FindValueRef(name, reg_ref);
- }
- return nullptr;
-}
-
-} // namespace data_render
-} // namespace core
-} // namespace weex
diff --git a/weex_core/Source/core/data_render/code_generator.h b/weex_core/Source/core/data_render/code_generator.h
deleted file mode 100644
index 89ebfe9..0000000
--- a/weex_core/Source/core/data_render/code_generator.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef CORE_DATA_RENDER_CODE_GENERATOR_H_
-#define CORE_DATA_RENDER_CODE_GENERATOR_H_
-
-#include <unordered_map>
-#include "base/common.h"
-#include "core/data_render/ast.h"
-#include "core/data_render/ast_visitor.h"
-#include "core/data_render/op_code.h"
-#include "core/data_render/object.h"
-
-namespace weex {
-namespace core {
-namespace data_render {
-class ValueRef;
-class FuncState;
-class ExecState;
-class CodeGenerator : public ASTVisitor {
- public:
- CodeGenerator(ExecState *exec_state)
- : exec_state_(exec_state), block_(nullptr),func_(nullptr),class_(nullptr) {}
- ~CodeGenerator() {}
- void Visit(ChunkStatement *node, void *data) override;
- void Visit(StringConstant *node, void *data) override;
- void Visit(RegexConstant *node, void *data) override;
- void Visit(CallExpression *node, void *data) override;
- void Visit(ArgumentList *node, void *data) override;
- void Visit(IfStatement *node, void *data) override;
- void Visit(IfElseStatement *node, void *data) override;
- void Visit(ForStatement *node, void *data) override;
- void Visit(BlockStatement *node, void *data) override;
- void Visit(FunctionPrototype *node, void *data) override;
- void Visit(FunctionStatement *node, void *data) override;
- void Visit(BinaryExpression *node, void *data) override;
- void Visit(TernaryExpression *node, void *data) override;
- void Visit(CommaExpression *node, void *data) override;
- void Visit(AssignExpression *node, void *data) override;
- void Visit(Declaration *node, void *data) override;
- void Visit(DeclarationList *node, void *data) override;
- void Visit(BooleanConstant *node, void *data) override;
- void Visit(DoubleConstant *node, void *data) override;
- void Visit(NullConstant *node, void *data) override;
- void Visit(UndefinedConstant *node, void *data) override;
- void Visit(IntegralConstant *node, void *data) override;
- void Visit(MemberExpression *node, void *data) override;
- void Visit(Identifier *node, void *data) override;
- void Visit(PrefixExpression *node, void *data) override;
- void Visit(ObjectConstant *node, void *data) override;
- void Visit(ArrayConstant *node, void *data) override;
- void Visit(ReturnStatement *node, void *data) override;
- void Visit(ExpressionList *node, void *data) override;
- void Visit(JSXNodeExpression *node, void *data) override;
- void Visit(ClassStatement *node, void *data) override;
- void Visit(ClassBody *node, void *data) override;
- void Visit(ArrowFunctionStatement *node, void *data) override;
- void Visit(ThisExpression *node, void *data) override;
- void Visit(NewExpression *node, void *data) override;
- void Visit(PostfixExpression *node, void *data) override;
- void Visit(ContinueStatement *node, void *data) override;
- void Visit(SwitchStatement *node, void *data) override;
- void Visit(TryCatchStatement *node, void *data) override;
... 17314 lines suppressed ...