diff --git a/android/playground/app/src/main/assets/lite_template/case.js b/android/playground/app/src/main/assets/lite_template/case.js
index 90278f05d9..1463c8d1d0 100644
--- a/android/playground/app/src/main/assets/lite_template/case.js
+++ b/android/playground/app/src/main/assets/lite_template/case.js
@@ -1,10 +1,72 @@
/* eslint-disable react/react-in-jsx-scope */
/* global __weex_data__, print, createElement */
+
+try{
+ console.log("abc in try");
+} catch(err) {
+ console.log("err");
+} finally{
+ console.log("finally");
+}
+
+var a= /(a.)/g;
+var b = a.exec('abc,aac, ssa2, dda');
+console.log(b);
+
+console.log('aabccbddBc'.match(/(bss.)/g));
+
+console.log("ceil");
+console.log(Math.ceil(0.95)," == 1");
+console.log(Math.ceil(4)," == 4");
+console.log(Math.ceil(7.004)," == 8");
+console.log(Math.ceil(-0.95)," == -0");
+console.log(Math.ceil(-4)," == -4");
+console.log(Math.ceil(-7.004)," == -7");
+
+console.log("floor");
+console.log(Math.floor( 45.95)," == 45");
+console.log(Math.floor( 45.05)," == 45");
+console.log(Math.floor( 4 )," == 4");
+console.log(Math.floor(-45.05)," == -46");
+console.log(Math.floor(-45.95)," == -46");
+
+console.log("random");
+console.log(Math.random());
+console.log(Math.random());
+console.log(Math.random());
+console.log(Math.random());
+
+console.log("max");
+console.log(Math.max(1,2,3)," == 3");
+console.log(Math.max(1,2.2, 4.2), "== 4.2");
+console.log(Math.max(1,"a"),"== null");
+console.log(Math.max(),"== INT_MIN");
+
+console.log("min");
+console.log(Math.min(1,2,3)," == 1");
+console.log(Math.min(0.5,2.2, 4), "== 0.5");
+console.log(Math.min(1,"a"),"== null");
+console.log(Math.min(),"== INT_MAX");
+
+var a = 3;
+
+console.log('start');
+switch(a){
+ case 1:
+ console.log('switch 1');
+ break;
+ case 2:
+ console.log('switch 2');
+ break;
+ default:
+ console.log('default branch');
+}
+console.log('end');
class Component {
constructor(props) {
this.props = props;
}
-
+
setState(newData) {
this.state = { ...this.state,
...newData
@@ -20,7 +82,7 @@ var nativeModules = {};
const registerModule = moduleName => {
var sourceKeys = Object.keys(moduleName);
var key;
-
+
for (var i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
nativeModules[key] = moduleName[key];
@@ -46,12 +108,12 @@ const require = name => {
loop(methods[i]);
}
}
- log("register",methods);
+ console.log("register",methods);
return target;
};
-
+
const MODULE_NAME_PREFIX = '@weex-module/';
-
+
if (name.split(MODULE_NAME_PREFIX).length > 1) {
const weexModuleName = name.split(MODULE_NAME_PREFIX)[1];
return requireModule(weexModuleName);
@@ -150,12 +212,12 @@ class TipTag extends Component {
super(props);
}
_onClick = e => {
- log("click go");
+ console.log("click go");
let searchParams = {};
if (this.props.data.q) {
searchParams.q = this.props.data.q;
}
-
+
if (this.props.data.params && this.props.data.params.length > 0) {
this.props.data.params.forEach(item => {
if (item.key) {
@@ -165,22 +227,22 @@ class TipTag extends Component {
}
if (this.props.tiptype && this.props.tiptype == 'voice_smarttips') {
searchParams['voiceFrom'] = '1';
- log("se go");
+ console.log("se go");
searchEvent.searchOption("searchOption", {
params: searchParams
});
} else {
- log("se go2");
+ console.log("se go2");
searchEvent.search("search", {
params: searchParams
});
}
};
-
+
render() {
let data = this.props.data;
let tagStyle = styles.tag;
-
+
if (!this.props.isListMode) {
tagStyle = { ...styles.tag,
marginLeft: 5.5,
@@ -193,7 +255,7 @@ class TipTag extends Component {
{data.show}
;
}
-
+
}
const _tiptag_export = {
@@ -205,15 +267,15 @@ const TipTag_import_default_from__WidgetInWFStyle__tiptag = _tiptag_export.defau
const WidgetInWFStyle = props => {
let tips = props.tips,
tiptype = props.tiptype;
-
+
if (!tips || tips.length === 0) {
return null;
}
-
+
if (tips.length > 8) {
tips = tips.slice(0, 8);
}
-
+
let wfTitle =
{props.topic || '相关搜索'}
@@ -221,7 +283,7 @@ const WidgetInWFStyle = props => {
;
let wfLines = [];
let tipLength = tips.length;
-
+
function createWfLine(leftTip, rightTip) {
let tag1 = ;
let tag2 = rightTip ? : null;
@@ -309,11 +371,11 @@ const WidgetInListStyle = props => {
if (!tips || tips.length === 0) {
return null;
}
-
+
if (tips.length > 8) {
tips = tips.slice(0, 8);
}
-
+
const listTitle =
{props.topic || '相关搜索'}
@@ -327,7 +389,7 @@ const WidgetInListStyle = props => {
firstLineTips.push(tipTag);
} else {
const firstLineCount = parseInt(tips.length / 2, 10) + tips.length % 2;
-
+
if (index < firstLineCount) {
firstLineTips.push(tipTag);
} else if (index < 8) {
@@ -371,7 +433,7 @@ class Widget extends Component {
return {content};
}
-
+
}
const _lib_export = {
@@ -400,7 +462,8 @@ class Segment extends Component {
;
}
-
+
}
render();
+
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
index 2e13921f9b..8a5408daf8 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
@@ -242,8 +242,13 @@ private void loadWXfromService(final String url) {
public void onSuccess(WXHttpTask task) {
Log.i(TAG, "into--[http:onSuccess] url:" + url);
try {
+ Uri uri = Uri.parse(url);
mConfigMap.put("bundleUrl", url);
- mInstance.render(TAG, new String(task.response.data, "utf-8"), mConfigMap, null, WXRenderStrategy.APPEND_ASYNC);
+ if (uri.getPath().endsWith(".wlasm")){
+ mInstance.render(TAG, task.response.data, mConfigMap, null);
+ } else {
+ mInstance.render(TAG, new String(task.response.data, "utf-8"), mConfigMap, null, WXRenderStrategy.APPEND_ASYNC);
+ }
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
diff --git a/android/sdk/gradle/wrapper/gradle-wrapper.properties b/android/sdk/gradle/wrapper/gradle-wrapper.properties
index 73990aa521..d64998259f 100644
--- a/android/sdk/gradle/wrapper/gradle-wrapper.properties
+++ b/android/sdk/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=http://gw.alicdn.com/bao/uploaded/LB1J5WLJVXXXXcMXpXXXXXXXXXX.zip
diff --git a/android/sdk/libs/armeabi-v7a/libweexcore.so b/android/sdk/libs/armeabi-v7a/libweexcore.so
old mode 100644
new mode 100755
diff --git a/android/sdk/libs/armeabi/libweexcore.so b/android/sdk/libs/armeabi/libweexcore.so
old mode 100644
new mode 100755
diff --git a/android/sdk/libs/x86/libweexcore.so b/android/sdk/libs/x86/libweexcore.so
old mode 100644
new mode 100755
index bee91b96e4..9955dc3fca
Binary files a/android/sdk/libs/x86/libweexcore.so and b/android/sdk/libs/x86/libweexcore.so differ
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index b470d6d67e..cfa87b7e66 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@ -93,6 +93,7 @@
import java.util.PriorityQueue;
import java.util.concurrent.ConcurrentHashMap;
+import static com.taobao.weex.common.WXErrorCode.WX_ERR_RELOAD_PAGE;
import static com.taobao.weex.http.WXHttpUtil.KEY_USER_AGENT;
@@ -127,6 +128,8 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
private String mBundleUrl = "";
public static String requestUrl = "requestUrl";
private boolean isDestroy=false;
+ private boolean hasException = false;
+ private boolean isRenderSuccess = false;
private Map mUserTrackParams;
private NativeInvokeHelper mNativeInvokeHelper;
private boolean isCommit=false;
@@ -705,13 +708,43 @@ private void renderInternal(String pageName,
WXSDKManager.getInstance().createInstance(this, template, renderOptions, jsonInitData);
mRendered = true;
+
+
+ if(WXBridgeManager.getInstance().isIsRebootJscWhenWhiteScreen()) {
+ WXSDKManager.getInstance().postOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if(isDestroy || hasException || isRenderSuccess) {
+ return;
+ }
+
+ View containerView = getContainerView();
+ if(containerView instanceof ViewGroup) {
+ if(0 == ((ViewGroup) containerView).getChildCount()) {
+ boolean isWxActivity = false;
+ if(mContext != null && mContext.getClass() != null) {
+ String name = mContext.getClass().getName();
+ if(!TextUtils.isEmpty(name)) {
+ isWxActivity = name.contains("WXActivity");
+ }
+ }
+
+ if(!isWxActivity) {
+ onJSException(String.valueOf(WX_ERR_RELOAD_PAGE),"jsc reboot","jsc reboot");
+ }
+ WXBridgeManager.getInstance().callReportCrashReloadPage(mInstanceId, null);
+ }
+ }
+ }
+ }, WXBridgeManager.getInstance().getRebootJscTimeout());
+ }
}
private void renderByUrlInternal(String pageName,
final String url,
Map options,
final String jsonInitData,
- final WXRenderStrategy flag) {
+ WXRenderStrategy flag) {
ensureRenderArchor();
pageName = wrapPageName(pageName, url);
@@ -740,6 +773,16 @@ private void renderByUrlInternal(String pageName,
return;
}
+ boolean is_wlasm = false;
+ if (uri != null && uri.getPath()!=null) {
+ if(uri.getPath().endsWith(".wlasm")){
+ is_wlasm = true;
+ }
+ }
+ if (is_wlasm){
+ flag = WXRenderStrategy.DATA_RENDER_BINARY;
+ }
+
IWXHttpAdapter adapter = WXSDKManager.getInstance().getIWXHttpAdapter();
WXRequest wxRequest = new WXRequest();
@@ -1017,9 +1060,10 @@ public void onActivityCreate() {
mGlobalEventReceiver=new WXGlobalEventReceiver(this);
try {
getContext().registerReceiver(mGlobalEventReceiver, new IntentFilter(WXGlobalEventReceiver.EVENT_ACTION));
- } catch (Exception e) {
+ } catch (Throwable e) {
// Huawei may throw a exception if register more than 500 BroadcastReceivers
WXLogUtils.e(e.getMessage());
+ mGlobalEventReceiver = null;
}
}
@@ -1265,6 +1309,7 @@ public void runOnUiThread(Runnable action) {
}
public void onRenderSuccess(final int width, final int height) {
+ isRenderSuccess = true;
if (!isNewFsEnd){
getApmForInstance().arriveNewFsRenderTime();
}
@@ -1298,7 +1343,7 @@ public void onRenderSuccess(final int width, final int height) {
WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, mWXPerformance.toString());
}
- if(!WXEnvironment.isApkDebugable()){
+ if(WXEnvironment.isPerf()){
WXLogUtils.e("weex_perf",mWXPerformance.getPerfData());
}
}
@@ -1365,6 +1410,7 @@ public void run() {
public void onJSException(final String errCode, final String function, final String exception) {
getExceptionRecorder().recordReportErrorMsg("["+errCode+","+function+","+exception+"]");
+ hasException = true;
if (mRenderListener != null && mContext != null) {
runOnUiThread(new Runnable() {
@@ -2010,8 +2056,12 @@ public void onHttpFinish(WXResponse response) {
String wxErrorCode = WXInstanceApm.VALUE_ERROR_CODE_DEFAULT;
if (response!=null && response.originalData!=null && TextUtils.equals("200", response.statusCode)) {
mApmForInstance.onStage(WXInstanceApm.KEY_PAGE_STAGES_DOWN_BUNDLE_END);
- String template = new String(response.originalData);
- render(pageName, template, options, jsonInitData, flag);
+ if (flag==WXRenderStrategy.DATA_RENDER_BINARY){
+ render(pageName, response.originalData, options, jsonInitData);
+ } else {
+ String template = new String(response.originalData);
+ render(pageName, template, options, jsonInitData, flag);
+ }
// check content-type
} else if (TextUtils.equals(WXErrorCode.WX_DEGRAD_ERR_BUNDLE_CONTENTTYPE_ERROR.getErrorCode(),
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 5785fd3c0a..531b601133 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
@@ -162,6 +162,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
// add for cloud setting, default value is false.
// weexcore use single process or not
private static boolean isUseSingleProcess = false;
+ private static boolean isRebootJscWhenWhiteScreen = false;
+ public final static long DEFAULT_REBOOT_JSC_TIMEOUT = 5000;
+ private static long rebootJscTimeout = DEFAULT_REBOOT_JSC_TIMEOUT;
public enum BundType {
Vue,
@@ -222,7 +225,21 @@ public static WXBridgeManager getInstance() {
}
return mBridgeManager;
}
+ public boolean isIsRebootJscWhenWhiteScreen() {
+ return isRebootJscWhenWhiteScreen;
+ }
+
+ public void setIsRebootJscWhenWhiteScreen(boolean _isRebootJscWhenWhiteScreen) {
+ isRebootJscWhenWhiteScreen = _isRebootJscWhenWhiteScreen;
+ }
+
+ public long getRebootJscTimeout() {
+ return rebootJscTimeout;
+ }
+ public void setRebootJscTimeout(long timeout) {
+ rebootJscTimeout = timeout;
+ }
public void setUseSingleProcess(final boolean flag) {
if (flag != isUseSingleProcess) {
isUseSingleProcess = flag;
@@ -770,21 +787,27 @@ public int callRefreshFinish(String instanceId, String callback) {
}
public int callReportCrashReloadPage(String instanceId, String crashFile) {
+ boolean isCrashFileEmpty = TextUtils.isEmpty(crashFile);
try {
String url = null;
WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
if (instance != null) {
url = instance.getBundleUrl();
}
- try {
- if (WXEnvironment.getApplication() != null) {
- crashFile = mInitParams.getCrashFilePath() + crashFile;
- Log.d("jsengine", "callReportCrashReloadPage crashFile:" + crashFile);
+ if(!isCrashFileEmpty) {
+ try {
+ if (WXEnvironment.getApplication() != null) {
+ crashFile = mInitParams.getCrashFilePath() + crashFile;
+ Log.d("jsengine", "callReportCrashReloadPage crashFile:" + crashFile);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
}
- } catch (Throwable e) {
- e.printStackTrace();
+ callReportCrash(crashFile, instanceId, url);
+ } else {
+ commitJscCrashAlarmMonitor(IWXUserTrackAdapter.JS_BRIDGE, WXErrorCode.WX_ERR_RELOAD_PAGE, "reboot jsc Engine", instanceId, url);
}
- callReportCrash(crashFile, instanceId, url);
+
if (reInitCount > CRASHREINIT) {
return IWXBridge.INSTANCE_RENDERING_ERROR;
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionMoveElement.java b/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionMoveElement.java
index 7523120103..424ee8416e 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionMoveElement.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionMoveElement.java
@@ -39,9 +39,12 @@ public GraphicActionMoveElement(WXSDKInstance instance, String ref, String paren
@Override
public void executeAction() {
WXComponent component = WXSDKManager.getInstance().getWXRenderManager().getWXComponent(getPageId(), getRef());
+ if(component == null) {
+ return;
+ }
WXVContainer oldParent = component.getParent();
WXComponent newParent = WXSDKManager.getInstance().getWXRenderManager().getWXComponent(getPageId(), mParentref);
- if (component == null || oldParent == null
+ if (oldParent == null
|| newParent == null || !(newParent instanceof WXVContainer)) {
return;
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java
index 7e519e96a2..a0a5c1dc49 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java
@@ -21,6 +21,8 @@
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import com.taobao.weex.dom.WXImageQuality;
+
+import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashMap;
@@ -317,29 +319,7 @@ private void setRemoteSrc(Uri rewrited, int blurRadius) {
this.mBlurRadius = blurRadius;
final String rewritedStr = rewrited.toString();
- imageStrategy.setImageListener(new WXImageStrategy.ImageListener() {
- @Override
- public void onImageFinish(String url, ImageView imageView, boolean result, Map extra) {
- if (getEvents().contains(Constants.Event.ONLOAD)) {
- Map params = new HashMap();
- Map size = new HashMap<>(2);
- if (imageView != null && imageView instanceof Measurable) {
- size.put("naturalWidth", ((Measurable) imageView).getNaturalWidth());
- size.put("naturalHeight", ((Measurable) imageView).getNaturalHeight());
- } else {
- size.put("naturalWidth", 0);
- size.put("naturalHeight", 0);
- }
-
- if (containsEvent(Constants.Event.ONLOAD)) {
- params.put("success", result);
- params.put("size", size);
- fireEvent(Constants.Event.ONLOAD, params);
- }
- }
- monitorImgSize(imageView,rewritedStr);
- }
- });
+ imageStrategy.setImageListener(new MyImageListener(this,rewritedStr));
String placeholder=null;
if(getAttrs().containsKey(Constants.Name.PLACEHOLDER)){
@@ -514,4 +494,42 @@ public interface Measurable {
int getNaturalWidth();
int getNaturalHeight();
}
+
+ public static class MyImageListener implements WXImageStrategy.ImageListener {
+
+ private WeakReference wxImageWeakReference;
+
+ private String rewritedStr;
+
+ MyImageListener(WXImage image,String rewritedStr) {
+ this.wxImageWeakReference = new WeakReference(image);
+ this.rewritedStr = rewritedStr;
+ }
+
+ @Override
+ public void onImageFinish(String url, ImageView imageView, boolean result, Map extra) {
+ WXImage image = wxImageWeakReference.get();
+
+ if(image == null)
+ return;
+
+ if (image.getEvents().contains(Constants.Event.ONLOAD)) {
+ Map params = new HashMap();
+ Map size = new HashMap<>(2);
+ if (imageView != null && imageView instanceof Measurable) {
+ size.put("naturalWidth", ((Measurable) imageView).getNaturalWidth());
+ size.put("naturalHeight", ((Measurable) imageView).getNaturalHeight());
+ } else {
+ size.put("naturalWidth", 0);
+ size.put("naturalHeight", 0);
+ }
+ if (image.containsEvent(Constants.Event.ONLOAD)) {
+ params.put("success", result);
+ params.put("size", size);
+ image.fireEvent(Constants.Event.ONLOAD, params);
+ }
+ }
+ image.monitorImgSize(imageView,rewritedStr);
+ }
+ }
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/config/AutoScanConfigRegister.java b/android/sdk/src/main/java/com/taobao/weex/ui/config/AutoScanConfigRegister.java
index b8b5805f88..fb0a52bc95 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/config/AutoScanConfigRegister.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/config/AutoScanConfigRegister.java
@@ -151,7 +151,7 @@ private static void doScanConfigSync(){
WXSDKEngine.registerComponent(configComponentHolder, configComponentHolder.isAppendTree(), configComponentHolder.getType());
}
}
- }catch (Exception e){
+ }catch (Throwable e){
WXLogUtils.e(TAG, e);
}
}
diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
index aaf8be7f5c..bfbf06cf5d 100644
--- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
+++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj
@@ -77,8 +77,6 @@
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 */; };
- 453267202142731000DAA620 /* binary_file.h in Headers */ = {isa = PBXBuildFile; fileRef = 4532671E2142731000DAA620 /* binary_file.h */; };
- 453267212142731000DAA620 /* binary_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4532671F2142731000DAA620 /* binary_file.cc */; };
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 */; };
@@ -305,6 +303,19 @@
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 */; };
@@ -1083,8 +1094,6 @@
45326709213FC84900DAA620 /* WXDisplayLinkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDisplayLinkManager.m; sourceTree = ""; };
453267122140E38900DAA620 /* vcomponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vcomponent.h; sourceTree = ""; };
453267132140E38900DAA620 /* vcomponent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vcomponent.cc; sourceTree = ""; };
- 4532671E2142731000DAA620 /* binary_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = binary_file.h; sourceTree = ""; };
- 4532671F2142731000DAA620 /* binary_file.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binary_file.cc; sourceTree = ""; };
4547FCFF2152048600E79971 /* class_object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_object.cc; sourceTree = ""; };
4547FD002152048600E79971 /* class_object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_object.h; sourceTree = ""; };
4547FD0B215392F900E79971 /* js_common_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_common_function.h; sourceTree = ""; };
@@ -1294,6 +1303,19 @@
77E65A181C155F25008B8775 /* WXScrollerComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXScrollerComponent.mm; sourceTree = ""; };
841CD1021F9739890081196D /* WXExceptionUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXExceptionUtils.m; sourceTree = ""; };
841CD1041F97399C0081196D /* WXExceptionUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXExceptionUtils.h; sourceTree = ""; };
+ 98399A7E21916A9600D83CCE /* exec_state_section.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec_state_section.cc; sourceTree = ""; };
+ 98399A7F21916A9600D83CCE /* exec_state_binary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec_state_binary.cc; sourceTree = ""; };
+ 98399A8021916A9600D83CCE /* class_regex.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_regex.cc; sourceTree = ""; };
+ 98399A8121916A9600D83CCE /* exec_state_binary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec_state_binary.h; sourceTree = ""; };
+ 98399A8221916A9700D83CCE /* class_console.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_console.cc; sourceTree = ""; };
+ 98399A8321916A9700D83CCE /* class_window.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_window.cc; sourceTree = ""; };
+ 98399A8421916A9700D83CCE /* class_function.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = class_function.cc; sourceTree = ""; };
+ 98399A8521916A9700D83CCE /* class_window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_window.h; sourceTree = ""; };
+ 98399A8621916A9700D83CCE /* class_console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_console.h; sourceTree = ""; };
+ 98399A8721916A9700D83CCE /* class_regex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_regex.h; sourceTree = ""; };
+ 98399A8821916A9700D83CCE /* exec_state_section.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec_state_section.h; sourceTree = ""; };
+ 98399A8921916A9800D83CCE /* class_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class_function.h; sourceTree = ""; };
+ 98399A8A21916A9800D83CCE /* op_code.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = op_code.cc; sourceTree = ""; };
9B9E74771FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTestBridgeMethodDummy.h; sourceTree = ""; };
9B9E74781FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTestBridgeMethodDummy.m; sourceTree = ""; };
B8394F3521468AF100CA1EFF /* render_action_trigger_vsync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render_action_trigger_vsync.h; sourceTree = ""; };
@@ -2224,6 +2246,18 @@
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 */,
+ 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 */,
@@ -2241,8 +2275,6 @@
B8F2C6D72133A83B00635B37 /* class.cc */,
B8F2C6D22133A83A00635B37 /* class.h */,
B8F2C6CE2133A83A00635B37 /* common_error.h */,
- 4532671F2142731000DAA620 /* binary_file.cc */,
- 4532671E2142731000DAA620 /* binary_file.h */,
B8F2C6D32133A83A00635B37 /* rax_jsx_ast.cc */,
B8F2C6D12133A83A00635B37 /* rax_jsx_ast.h */,
B8F2C6D92133A83B00635B37 /* rax_parser_builder.cc */,
@@ -2277,15 +2309,16 @@
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 */,
- B8D66B182125572F003960BD /* exec_state.cc */,
);
path = data_render;
sourceTree = "";
@@ -2670,6 +2703,7 @@
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 */,
@@ -2683,9 +2717,9 @@
B8D66BE12125572F003960BD /* handle.h in Headers */,
B8D66BCD2125572F003960BD /* statement.h in Headers */,
77D161241C02DDD10010B15B /* WXSDKInstance.h in Headers */,
- 453267202142731000DAA620 /* binary_file.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 */,
@@ -2729,6 +2763,7 @@
B8D66C9121255730003960BD /* render_factory_interface.h in Headers */,
DCE2CF9B1F46D4220021BDC4 /* WXVoiceOverModule.h in Headers */,
74BB5FB91DFEE81A004FC3DF /* WXMetaModule.h in Headers */,
+ 98399A9621916A9800D83CCE /* class_function.h in Headers */,
DCA0EF641D6EED6F00CB18B9 /* WXGlobalEventModule.h in Headers */,
2A837AB21CD9DE9200AEDF03 /* WXLoadingComponent.h in Headers */,
B8D66BBD2125572F003960BD /* vnode_exec_env.h in Headers */,
@@ -2833,6 +2868,7 @@
C43C03E81EC8ACA40044C7FF /* WXPrerenderManager.h in Headers */,
453267142140E38900DAA620 /* vcomponent.h in Headers */,
17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */,
+ 98399A9321916A9800D83CCE /* class_console.h in Headers */,
B8D66CD121255730003960BD /* thread_impl_darwin.h in Headers */,
B8D66CBD21255730003960BD /* closure.h in Headers */,
C4B834281DE69B09007AD27E /* WXPickerModule.h in Headers */,
@@ -2842,6 +2878,7 @@
B8D66CDD21255730003960BD /* message_loop.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 */,
@@ -2907,6 +2944,7 @@
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;
@@ -3448,6 +3486,7 @@
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 */,
@@ -3455,7 +3494,6 @@
2A837AB71CD9DE9200AEDF03 /* WXRefreshComponent.mm in Sources */,
74A4BA9B1CB3BAA100195969 /* WXThreadSafeMutableDictionary.m in Sources */,
77E65A1A1C155F25008B8775 /* WXScrollerComponent.mm in Sources */,
- 453267212142731000DAA620 /* binary_file.cc in Sources */,
747A787D1D1BAAC900DED9D0 /* WXComponent+ViewManagement.mm in Sources */,
C4E375371E5FCBD3009B2D9C /* WXComponent+BoxShadow.m in Sources */,
C43C03E91EC8ACA40044C7FF /* WXPrerenderManager.m in Sources */,
@@ -3466,6 +3504,7 @@
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 */,
@@ -3537,6 +3576,7 @@
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 */,
@@ -3565,6 +3605,7 @@
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 */,
B8A72CA0213F8BAE0024E7BE /* class_string.cc in Sources */,
B8D66C6721255730003960BD /* render_scroller.cpp in Sources */,
@@ -3574,6 +3615,7 @@
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 */,
@@ -3593,6 +3635,7 @@
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 */,
@@ -3619,6 +3662,7 @@
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 */,
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 993e7913f8..5920dd86e8 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -1128,7 +1128,7 @@ + (void)mountContextEnvironment:(JSContext*)context
};
}
-+ (void)handleConsoleOutputWithArgument:(NSArray*)arguments logLevel:(WXLogFlag)logLevel
++ (void)handleConsoleOutputWithArgument:(NSArray *)arguments logLevel:(WXLogFlag)logLevel
{
NSMutableString *string = [NSMutableString string];
[string appendString:@"jsLog: "];
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
index 793601e5eb..a332abf76d 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
@@ -28,6 +28,8 @@
#import "WXUtility.h"
#import "WXAssert.h"
#import "WXAppConfiguration.h"
+#import "WXSDKEngine.h"
+#import "WXAppMonitorProtocol.h"
#include "base/CoreConstants.h"
#include "core/manager/weex_core_manager.h"
@@ -158,6 +160,32 @@ static id TO_OBJECT(NSString* s)
return result;
}
+ static void consoleWithArguments(NSArray *arguments, WXLogFlag logLevel)
+ {
+ NSMutableString *jsLog = [NSMutableString string];
+ [jsLog appendString:@"jsLog: "];
+ [arguments enumerateObjectsUsingBlock:^(NSString *jsVal, NSUInteger idx, BOOL *stop) {
+ if (idx == arguments.count - 1) {
+ if (logLevel) {
+ if (WXLogFlagWarning == logLevel) {
+ id appMonitorHandler = [WXSDKEngine handlerForProtocol:@protocol(WXAppMonitorProtocol)];
+ if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
+ [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"jswarning" success:FALSE errorCode:@"99999" errorMsg:jsLog arg:[WXSDKEngine topInstance].pageName];
+ }
+ }
+ WX_LOG(logLevel, @"%@", jsLog);
+ }
+ else {
+ [jsLog appendFormat:@"%@ ", jsVal] ;
+ WXLogInfo(@"%@", jsLog);
+ }
+ }
+ else {
+ [jsLog appendFormat:@"%@ ", jsVal];
+ }
+ }];
+ }
+
static void MergeBorderWidthValues(NSMutableDictionary* dict,
const WXCoreBorderWidth & borders,
bool isUpdate, float pixelScaleFactor)
@@ -223,9 +251,7 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
assert(false);
}
- std::unique_ptr IOSSide::CallNativeModule(const char *page_id, const char *module, const char *method,
- const char *args, int argc,
- const char *options, int optionsLength)
+ std::unique_ptr IOSSide::CallNativeModule(const char *page_id, const char *module, const char *method, const char *args, int args_length, const char *options, int options_length)
{
// should not enter this function
do {
@@ -237,10 +263,11 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
NSString *moduleName = [NSString stringWithUTF8String:module];
NSString *methodName = [NSString stringWithUTF8String:method];
NSArray *newArguments;
- if (argc > 0 && args) {
+ if (args && args_length > 0) {
NSString *arguments = [NSString stringWithUTF8String:args];
newArguments = [WXUtility objectFromJSON:arguments];
}
+ 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];
@@ -262,11 +289,35 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
// should not enter this function
assert(false);
}
-
- void IOSSide::NativeLog(const char* str_array)
+
+ void IOSSide::NativeLog(const char *args)
{
// should not enter this function
- assert(false);
+ do {
+ if (!args) {
+ break;
+ }
+ NSArray *newArguments;
+ if (args) {
+ NSString *arguments = [NSString stringWithUTF8String:args];
+ newArguments = [WXUtility objectFromJSON:arguments];
+ }
+ if (![newArguments isKindOfClass:[NSArray class]] || !newArguments.count) {
+ break;
+ }
+ static NSDictionary *levelMap;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ levelMap = @{@"__ERROR": @(WXLogFlagError),
+ @"__WARN": @(WXLogFlagWarning),
+ @"__INFO": @(WXLogFlagInfo),
+ @"__DEBUG": @(WXLogFlagDebug),
+ @"__LOG": @(WXLogFlagLog)};
+ });
+ NSString *levelStr = [newArguments lastObject];
+ consoleWithArguments(newArguments, (WXLogFlag)[levelMap[levelStr] integerValue]);
+
+ } while (0);
}
void IOSSide::TriggerVSync(const char* page_id)
@@ -835,19 +886,7 @@ + (void)createDataRenderInstance:(NSString *)pageId contents:(NSData *)contents
auto node_manager = weex::core::data_render::VNodeRenderManager::GetInstance();
NSString *optionsString = [WXUtility JSONString:options];
NSString *dataString = [WXUtility JSONString:data];
-
-// NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
-// NSString *txtPath = [documentsPath stringByAppendingPathComponent:@"test.wasm"];
-// std::string path = [txtPath UTF8String];
-// std::ifstream fin(path, std::ios::in|std::ios::binary|std::ios::ate);
-// unsigned length = static_cast(fin.tellg());
-//
-// char* buffer = new char[length];
-// fin.seekg (0, std::ios::beg);
-// fin.read(buffer, length);
-// fin.close();
-
- node_manager->CreatePage(static_cast(contents.bytes), contents.length, [pageId UTF8String], [optionsString UTF8String], dataString ? [dataString UTF8String] : "");
+ node_manager->CreatePage(static_cast(contents.bytes), contents.length, [pageId UTF8String], [optionsString UTF8String], dataString ? [dataString UTF8String] : "");
}
+ (void)destroyDataRenderInstance:(NSString *)pageId
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 87bc32650b..8cf079e158 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -53,6 +53,8 @@
#import "WXPageEventNotifyEvent.h"
#import "WXCoreBridge.h"
+#define WEEX_LITE_URL_SUFFIX @"wlasm"
+
NSString *const bundleUrlOptionKey = @"bundleUrl";
NSTimeInterval JSLibInitTime = 0;
@@ -233,7 +235,9 @@ - (void)renderWithURL:(NSURL *)url options:(NSDictionary *)options data:(id)data
WXLogError(@"Url must be passed if you use renderWithURL");
return;
}
-
+ if ([url.absoluteString hasSuffix:WEEX_LITE_URL_SUFFIX]) {
+ _defaultDataRender = YES;
+ }
_scriptURL = url;
[self _checkPageName];
[self.apmInstance startRecord:self.instanceId];
@@ -257,16 +261,16 @@ - (void)renderView:(id)source options:(NSDictionary *)options data:(id)data
[self _renderWithMainBundleString:source];
[WXTracingManager setBundleJSType:source instanceId:self.instanceId];
} else if ([source isKindOfClass:[NSData class]]) {
- [self _renderWithOpcode:source];
+ [self _renderWithData:source];
}
}
-- (NSString*) bundleTemplate
+- (NSString *) bundleTemplate
{
return self.mainBundleString;
}
-- (void)_renderWithOpcode:(NSData *)contents
+- (void)_renderWithData:(NSData *)contents
{
if (!self.instanceId) {
WXLogError(@"Fail to find instance!");
@@ -538,8 +542,8 @@ - (void)_renderWithRequest:(WXResourceRequest *)request options:(NSDictionary *)
return;
}
- if ([options[@"DATA_RENDER"] boolValue] && [options[@"RENDER_WITH_BINARY"] boolValue]) {
- [strongSelf _renderWithOpcode:data];
+ if (strongSelf.dataRender) {
+ [strongSelf _renderWithData:data];
return;
}
@@ -775,7 +779,7 @@ - (CGFloat)pixelScaleFactor
- (BOOL)dataRender
{
- if ([_options[@"DATA_RENDER"] boolValue]) {
+ if ([_options[@"WLASM_RENDER"] boolValue]) {
return YES;
}
return _defaultDataRender;
diff --git a/weex_core/Source/CMakeLists.txt b/weex_core/Source/CMakeLists.txt
index 8b9df20db5..7246b9e7a4 100644
--- a/weex_core/Source/CMakeLists.txt
+++ b/weex_core/Source/CMakeLists.txt
@@ -73,7 +73,12 @@ set(COMMON_SRCS
./core/data_render/class_array.cc
./core/data_render/class_json.cc
./core/data_render/class_string.cc
+ ./core/data_render/class_regex.cc
+ ./core/data_render/class_console.cc
+ ./core/data_render/class_window.cc
+ ./core/data_render/class_math.cc
./core/data_render/class_factory.cc
+ ./core/data_render/class_function.cc
./core/data_render/class_object.cc
./core/data_render/code_generator.cc
./core/data_render/exec_state.cc
@@ -92,8 +97,10 @@ set(COMMON_SRCS
./core/data_render/table.cc
./core/data_render/token.cc
./core/data_render/tokenizer.cc
+ ./core/data_render/op_code.cc
./core/data_render/vm.cc
- ./core/data_render/binary_file.cc
+ ./core/data_render/exec_state_binary.cc
+ ./core/data_render/exec_state_section.cc
./core/data_render/vnode/vnode.cc
./core/data_render/vnode/vcomponent.cc
./core/data_render/vnode/vnode_exec_env.cc
diff --git a/weex_core/Source/base/LogDefines.h b/weex_core/Source/base/LogDefines.h
index d1f78d80b6..2cfac7b47b 100644
--- a/weex_core/Source/base/LogDefines.h
+++ b/weex_core/Source/base/LogDefines.h
@@ -62,6 +62,8 @@
#else
+#define LOGE(...) ((void) 0)
+#define LOGA(...) ((void) 0)
#define LOGV(...) ((void) 0)
#define LOGD(...) ((void) 0)
#define LOGI(...) ((void) 0)
diff --git a/weex_core/Source/base/ViewUtils.h b/weex_core/Source/base/ViewUtils.h
index ec8866c24c..890e032ed6 100644
--- a/weex_core/Source/base/ViewUtils.h
+++ b/weex_core/Source/base/ViewUtils.h
@@ -19,6 +19,8 @@
#ifndef WEEX_PROJECT_VIEWUTILS_H
#define WEEX_PROJECT_VIEWUTILS_H
+#include
+#include
#include
#include
#include
diff --git a/weex_core/Source/base/string_util.h b/weex_core/Source/base/string_util.h
index 7995924982..9e07c97c6d 100644
--- a/weex_core/Source/base/string_util.h
+++ b/weex_core/Source/base/string_util.h
@@ -21,11 +21,11 @@
#define CORE_BASE_STRING_UTIL_H
#include
-#include
+#include
#ifdef OS_ANDROID
#include
#else
-#include
+#include
#endif
#include "base/third_party/icu/icu_utf.h"
diff --git a/weex_core/Source/base/thread/thread_impl_darwin.cc b/weex_core/Source/base/thread/thread_impl_darwin.cc
index a45d80a52f..c53ea4bdaf 100644
--- a/weex_core/Source/base/thread/thread_impl_darwin.cc
+++ b/weex_core/Source/base/thread/thread_impl_darwin.cc
@@ -29,7 +29,12 @@ ThreadImplDarwin::~ThreadImplDarwin() {}
void ThreadImplDarwin::SetName(const std::string& name) {
ThreadImpl::SetName(name);
- pthread_setname_np(name.c_str());
+#ifdef OS_LINUX
+ pthread_setname_np(pthread_self(), name.c_str());
+#else
+ pthread_setname_np(name.c_str());
+#endif
+
}
} // namespace base
diff --git a/weex_core/Source/core/config/core_environment.cpp b/weex_core/Source/core/config/core_environment.cpp
index 626145d0a4..63eea5f41e 100644
--- a/weex_core/Source/core/config/core_environment.cpp
+++ b/weex_core/Source/core/config/core_environment.cpp
@@ -16,9 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
+
+#include
+#include
#include "core_environment.h"
#include "base/CoreConstants.h"
-#include
#include
#include "base/LogDefines.h"
diff --git a/weex_core/Source/core/css/css_value_getter.cpp b/weex_core/Source/core/css/css_value_getter.cpp
index ea78c96e01..f576245e32 100644
--- a/weex_core/Source/core/css/css_value_getter.cpp
+++ b/weex_core/Source/core/css/css_value_getter.cpp
@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
+
+#include
#include "css_value_getter.h"
#include "constants_value.h"
#include "constants_name.h"
diff --git a/weex_core/Source/core/data_render/ast.h b/weex_core/Source/core/data_render/ast.h
index d382a4ea8e..1bdfa7ff64 100644
--- a/weex_core/Source/core/data_render/ast.h
+++ b/weex_core/Source/core/data_render/ast.h
@@ -67,10 +67,14 @@ namespace data_render {
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) \
@@ -99,6 +103,7 @@ namespace data_render {
M(NewExpression) \
M(ArrowFunctionStatement) \
M(ClassBody) \
+ M(ClassProperty) \
M(ExpressionList)
class ASTVisitor;
@@ -117,7 +122,7 @@ enum class ASTNodeType {
kNrType
};
-extern const char* type_as_string[(int)ASTNodeType::kNrType];
+extern const char *type_as_string[(int)ASTNodeType::kNrType];
class Expression : public RefCountObject {
protected:
@@ -132,7 +137,7 @@ class Expression : public RefCountObject {
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 As##Type() { assert(0 && "Expression is not " #Type); }
@@ -174,17 +179,17 @@ class ExpressionList : public Expression {
private:
std::vector> exprs_;
};
-
+
class ClassBody : public Expression {
public:
using iterator = std::vector>::iterator;
-
+
void Insert(Handle expr) { body_.push_back(expr); }
-
+
size_t Size() { return body_.size(); }
-
+
std::vector>& raw_list() { return body_; }
-
+
iterator begin() { return body_.begin(); }
iterator end() { return body_.end(); }
DEFINE_NODE_TYPE(ClassBody, Expression);
@@ -235,6 +240,38 @@ class StringConstant : public Expression {
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 first,
@@ -305,7 +342,7 @@ class BinaryExpression : public Expression {
Handle lhs_;
Handle rhs_;
};
-
+
enum class DeclarationKind {
kConst,
};
@@ -462,7 +499,8 @@ enum class PrefixOperation {
kIncrement,
kDecrement,
kNot,
- kUnfold
+ kUnfold,
+ kTypeof,
};
class PrefixExpression : public Expression {
@@ -497,7 +535,7 @@ class PostfixExpression : public Expression {
PostfixOperation op_;
Handle expr_;
};
-
+
enum class ProxyOrder { ProxyArray, ProxyObject };
class ObjectConstant : public Expression {
@@ -538,7 +576,7 @@ class ArrayConstant : public Expression {
private:
ProxyArray exprs_;
};
-
+
enum class AssignOperation {
kAssign,
kAssignAdd,
@@ -567,37 +605,36 @@ class UndefinedConstant : public Expression {
UndefinedConstant(Position &loc, Scope *scope)
: Expression(loc, scope)
{ }
-
+
DEFINE_NODE_TYPE(UndefinedConstant, Expression);
};
-
+
class NewExpression : public Expression {
public:
- NewExpression(Position &loc, Scope *scope, Handle member)
- : Expression(loc, scope), member_{ member } { }
- NewExpression(Handle member)
- : Expression(), member_{ member } { }
+ NewExpression(Position &loc, Scope *scope, Handle name, Handle args = nullptr)
+ : Expression(loc, scope), name_(name), args_(args) { }
+ NewExpression(Handle name, Handle args = nullptr)
+ : Expression(), name_(name), args_(args) { }
- Handle member() { return member_; }
+ Handle name() { return name_; }
+ Handle args() { return args_; }
bool ProduceRValue() override { return false; }
- void set_is_class_(bool is_class) { is_class_ = is_class; };
- bool is_class() { return is_class_; }
DEFINE_NODE_TYPE(NewExpression, Expression);
private:
- Handle member_;
- bool is_class_{false};
+ Handle name_;
+ Handle 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 exprs)
@@ -605,13 +642,50 @@ class CommaExpression : public Expression {
CommaExpression(Position &loc, Scope *scope, Handle exprs)
: Expression(loc, scope), exprs_{ exprs }
{ }
-
+
Handle exprs() { return exprs_; }
DEFINE_NODE_TYPE(CommaExpression, Expression);
private:
Handle exprs_;
};
+class ClassProperty : public Expression {
+public:
+ ClassProperty(Position &loc, Scope *scope, std::string name, Handle 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& init() { return init_; }
+ DEFINE_NODE_TYPE(ClassProperty, Expression);
+private:
+ std::string name_;
+ Handle init_;
+ bool is_static_{false};
+};
+
+class TryCatchStatement : public Expression {
+ public:
+ TryCatchStatement(Handle try_block,
+ Handle catch_expr, Handle catch_block, Handle finally)
+ : Expression(), try_block_{ try_block }, catch_expr_{ catch_expr },
+ catch_block_{ catch_block }, finally_{ finally }
+ { }
+
+
+ Handle try_block() { return try_block_; }
+ Handle catch_expr() { return catch_expr_; }
+ Handle catch_block() { return catch_block_; }
+ Handle finally() { return finally_; }
+ DEFINE_NODE_TYPE(TryCatchStatement,Expression);
+ private:
+ Handle try_block_;
+ Handle catch_expr_;
+ Handle catch_block_;
+ Handle finally_;
+};
+
+
} // namespace data_render
} // namespace core
} // namespace weex
diff --git a/weex_core/Source/core/data_render/ast_builder.cc b/weex_core/Source/core/data_render/ast_builder.cc
index a40cc05341..b3d62dce55 100644
--- a/weex_core/Source/core/data_render/ast_builder.cc
+++ b/weex_core/Source/core/data_render/ast_builder.cc
@@ -106,10 +106,10 @@ Handle ASTBuilder::NewPrefixExpression(PrefixOperation op, HandleNewPrefixExpression(locator()->location(), manager()->current(), op, expr));
}
-Handle ASTBuilder::NewNewExpression(Handle expr)
+Handle ASTBuilder::NewNewExpression(Handle expr, Handle args)
{
COUNT();
- return save(factory()->NewNewExpression(locator()->location(), manager()->current(), expr));
+ return save(factory()->NewNewExpression(locator()->location(), manager()->current(), expr, args));
}
Handle ASTBuilder::NewPostfixExpression(PostfixOperation op,
@@ -166,6 +166,12 @@ Handle ASTBuilder::NewStringConstant(const std::string &str)
COUNT();
return save(factory()->NewStringConstant(locator()->location(), manager()->current(), str));
}
+
+Handle ASTBuilder::NewRegexConstant(const std::string &str)
+{
+ COUNT();
+ return save(factory()->NewRegexConstant(locator()->location(), manager()->current(), str));
+}
Handle ASTBuilder::NewThisExpression()
{
@@ -261,6 +267,29 @@ Handle ASTBuilder::NewClassStatement(Handle identifier,
return save(factory()->NewClassStatement(locator()->location(), manager()->current(), identifier, superClass, body));
}
+Handle ASTBuilder::NewClassProperty(std::string name, Handle init) {
+ COUNT();
+ return save(factory()->NewClassProperty(locator()->location(), manager()->current(), name, init));
+}
+
+Handle ASTBuilder::NewCaseStatement(Handle test_case,Handle expr) {
+ COUNT();
+ return save(factory()->NewCaseStatement(locator()->location(), manager()->current(), test_case, expr));
+}
+
+Handle ASTBuilder::NewSwitchStatement(Handle test_value,
+ std::vector> cases) {
+ COUNT();
+ return save(factory()->NewSwitchStatement(locator()->location(), manager()->current(), test_value, cases));
+}
+Handle ASTBuilder::NewTryCatchStatement(Handle try_block,
+ Handle catch_expr,
+ Handle catch_block,
+ Handle 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
index 77d331a6c0..d72961a90f 100644
--- a/weex_core/Source/core/data_render/ast_builder.h
+++ b/weex_core/Source/core/data_render/ast_builder.h
@@ -33,7 +33,7 @@
namespace weex {
namespace core {
namespace data_render {
-
+
class ASTBuilder {
public:
ASTBuilder(ParserContext *ctx, ASTFactory *factory,
@@ -51,7 +51,7 @@ class ASTBuilder {
// create a new node representing JavaScript ternary expression
Handle NewTernaryExpression(Handle first, Handle second, Handle third);
// create a new node representing JavaScript binary expression
- Handle NewBinaryExpression(BinaryOperation op, Handle lhs, Handle rhs);
+ Handle NewBinaryExpression(BinaryOperation op, Handle lhs, Handle rhs);
// create a new node representing JavaScript assign expression
Handle NewAssignExpression(Handle lhs, Handle rhs);
Handle NewDeclaration(std::string name, Handle init = nullptr);
@@ -63,7 +63,7 @@ class ASTBuilder {
// create a new node representing JavaScript postfix operation
Handle NewPostfixExpression(PostfixOperation op, Handle expr);
// create a new node representing JavaScript `new` expression
- Handle NewNewExpression(Handle expr);
+ Handle NewNewExpression(Handle expr, Handle args = nullptr);
// create a new node representing JavaScript Identifier
Handle NewIdentifier(std::string name);
// create a new node representing JavaScript argument list
@@ -80,6 +80,8 @@ class ASTBuilder {
Handle NewNullConstant();
// create a new node representing JavaScript string
Handle NewStringConstant(const std::string &str);
+
+ Handle NewRegexConstant(const std::string &str);
// create a new node representing JavaScript boolean
Handle NewBooleanConstant(bool value);
// create a new node representing JavaScript 'this'
@@ -105,19 +107,25 @@ class ASTBuilder {
// create a new node representing JavaScript for loop
Handle NewForStatement(ForKind kind, Handle init, Handle cond, Handle update, Handle body);
// create a new node representing JavaScript break statement
+ Handle NewCaseStatement(Handle test_case,Handle expr);
+ Handle NewSwitchStatement(Handle test_value,std::vector> cases);
+ Handle NewTryCatchStatement(Handle try_block,
+ Handle catch_expr, Handle catch_block, Handle finally);
Handle NewBreakStatement(Handle label = nullptr);
-
+
// create a new node representing JavaScript continue statement
Handle NewContinueStatement(Handle label = nullptr);
Handle NewArrowFunctionStatement(Handle body, std::vector> args);
Handle NewJSXNodeExpression(Handle identifier, Handle props, Handle parent, std::vector> childrens);
Handle NewClassStatement(Handle identifier, Handle superClass, Handle body);
+ Handle NewClassProperty(std::string name, Handle init = nullptr);
+
Handle NewClassBody();
ASTFactory *factory() { return factory_; }
SourceLocator *locator() { return locator_; }
ScopeManager *manager() { return manager_; }
-
+
template
inline Handle save(Handle handle) {
exprs_.push_back(handle);
diff --git a/weex_core/Source/core/data_render/ast_factory.cc b/weex_core/Source/core/data_render/ast_factory.cc
index a1742ee4d9..3f87e78ba4 100644
--- a/weex_core/Source/core/data_render/ast_factory.cc
+++ b/weex_core/Source/core/data_render/ast_factory.cc
@@ -38,23 +38,23 @@ ASTFactory* ASTFactory::GetFactoryInstance() {
Handle ASTFactory::NewExpressionList() {
return MakeHandle();
}
-
+
Handle ASTFactory::NewExpressionList(const std::vector>& list) {
return MakeHandle(list);
}
-
+
Handle ASTFactory::NewClassBody() {
return MakeHandle();
}
-
+
Handle ASTFactory::NewThisExpression() {
return MakeHandle();
}
-
-Handle ASTFactory::NewNewExpression(Handle expr) {
- return MakeHandle(expr);
+
+Handle ASTFactory::NewNewExpression(Handle expr, Handle args) {
+ return MakeHandle(expr, args);
}
-
+
Handle ASTFactory::NewIdentifier(std::string name) {
return MakeHandle(name);
}
@@ -88,7 +88,7 @@ Handle ASTFactory::NewFunctionPrototype(std::string name, std::vecto
Handle ASTFactory::NewFunctionStatement(Handle proto, Handle body) {
return MakeHandle(proto, body);
}
-
+
Handle ASTFactory::NewReturnStatement(Handle expr) {
return MakeHandle(expr);
}
@@ -96,7 +96,7 @@ Handle ASTFactory::NewReturnStatement(Handle expr) {
Handle ASTFactory::NewDeclaration(std::string name, Handle init) {
return MakeHandle(name, init);
}
-
+
Handle ASTFactory::NewDeclarationList() {
return MakeHandle();
}
@@ -108,7 +108,7 @@ Handle ASTFactory::NewDeclarationList(std::vector ASTFactory::NewCommaExpression(const std::vector>& list) {
return MakeHandle(NewExpressionList(list));
}
-
+
Handle ASTFactory::NewBinaryExpression(BinaryOperation op, Handle lhs, Handle rhs) {
return MakeHandle(op, lhs, rhs);
}
@@ -132,7 +132,7 @@ Handle ASTFactory::NewNullConstant() {
Handle ASTFactory::NewCallExpression(MemberAccessKind kind, Handle expr, Handle member, std::vector> args) {
return MakeHandle(kind, expr, member, args);
}
-
+
Handle ASTFactory::NewCallExpression(Handle func, std::vector> args) {
return MakeHandle(func, args);
}
@@ -153,11 +153,11 @@ Handle ASTFactory::NewForStatement(ForKind kind, Handle
Handle update, Handle body) {
return MakeHandle(kind, init, condition, update, body);
}
-
+
Handle ASTFactory::NewObjectConstant(ProxyObject obj) {
return MakeHandle(std::move(obj));
}
-
+
Handle ASTFactory::NewAssignExpression(Handle lhs, Handle rhs) {
return MakeHandle(lhs, rhs);
}
@@ -165,7 +165,7 @@ Handle ASTFactory::NewAssignExpression(Handle lhs, Handl
Handle