[GitHub] incubator-weex issue #1374: [WEEX-539][Android] report container info when r...

2018-07-25 Thread weex-bot
Github user weex-bot commented on the issue:

https://github.com/apache/incubator-weex/pull/1374
  





  

  
  Warnings

  
  
  :warning:
  No Changelog changes!

  

  :warning:
  Potential BREAK CHANGE. Modify public in 
android/sdk/src/main/java/com/taobao/weex/common/WXPerformance.java without 
metion it in commit message. You'd better add '@notdanger' in your commit log. 


  




  

  
  Messages

  
  
  :book:
  danger test finished.

  




  Generated by :no_entry_sign: http://github.com/danger/danger-js/;>dangerJS




---


[GitHub] incubator-weex pull request #1374: [WEEX-539][Android] report container info...

2018-07-25 Thread lucky-chen
GitHub user lucky-chen opened a pull request:

https://github.com/apache/incubator-weex/pull/1374

[WEEX-539][Android] report container info when report error or perfor…

- add extInfo when report error and performance

- windmail ext info 
- is embed
- containerInfo

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/lucky-chen/incubator-weex 
android-feature-reporterror4widmail

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-weex/pull/1374.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1374


commit 5d0b875281dbea7c1b40eba283ab565c51206c81
Author: zhongcang 
Date:   2018-07-26T04:05:46Z

[WEEX-539][Android] report container info when report error or performance

* [Android] rm useless code




---


incubator-weex git commit: # This is a combination of 2 commits. # This is the 1st commit message:

2018-07-25 Thread cxfeng
Repository: incubator-weex
Updated Branches:
  refs/heads/master cb22b8ac7 -> 5a1d32a7a


# This is a combination of 2 commits.
# This is the 1st commit message:

[WEEX-511][iOS] Improve compatibility for debuglog

# This is the commit message #2:

[WEEX-511][iOS] Make debug log simpler


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5a1d32a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5a1d32a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5a1d32a7

Branch: refs/heads/master
Commit: 5a1d32a7abf17d45d7418fe8d5f4315388d7bb20
Parents: cb22b8a
Author: Xiaomin 
Authored: Tue Jul 24 19:29:40 2018 +0800
Committer: Adam Feng 
Committed: Wed Jul 25 16:19:48 2018 +0800

--
 ios/sdk/WeexSDK/Sources/Utility/WXLog.m | 386 ++-
 1 file changed, 253 insertions(+), 133 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5a1d32a7/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
--
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXLog.m 
b/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
index e7383b9..9c7ffc8 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXLog.m
@@ -6,9 +6,9 @@
  * 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
@@ -82,7 +82,7 @@ static id _externalLog;
 {
 if (((WXLog*)[self sharedInstance])->_logLevel != level) {
 ((WXLog*)[self sharedInstance])->_logLevel = level;
-
+
 [[WXSDKManager bridgeMgr] resetEnvironment];
 }
 #pragma clang diagnostic push
@@ -126,7 +126,7 @@ static id _externalLog;
   @"debug" : @(WXLogLevelDebug),
   @"log" : @(WXLogLevelLog)
 };
-
+
 [self setLogLevel:[logLevelStringToEnum[levelString] 
unsignedIntegerValue]];
 }
 
@@ -151,16 +151,16 @@ static id _externalLog;
 flagString = @"info";
 break;
 }
-
+
 NSString *logMessage = [NSString stringWithFormat:@"[%@]%s:%ld, %@", 
flagString, fileName, (unsigned long)line, message];
-
-
+
+
 if ([_externalLog logLevel] & flag) {
 [_externalLog log:flag message:logMessage];
 }
-
+
 [[WXSDKManager bridgeMgr] logToWebSocket:flagString message:message];
-
+
 if ([WXLog logLevel] & flag) {
 NSLog(@"%@", logMessage);
 }
@@ -189,7 +189,7 @@ static id _externalLog;
 flagString = @"info";
 break;
 }
-
+
 va_list args;
 va_start(args, format);
NSString *message = @"";
@@ -199,7 +199,7 @@ static id _externalLog;
message = [[NSString alloc] initWithFormat:format 
arguments:args];
}
 va_end(args);
-
+
 NSArray *messageAry = [NSArray arrayWithObjects:message, nil];
 Class WXLogClass = NSClassFromString(@"WXDebugger");
 if (WXLogClass) {
@@ -216,7 +216,7 @@ static id _externalLog;
 [invocation setArgument: atIndex:3];
 [invocation invoke];
 }
-
+
 [self log:flag file:fileName line:line message:message];
 }
 }
@@ -231,145 +231,265 @@ static id _externalLog;
 @end
 
 #pragma mark - WXSafeLog
-static NSString *dealWithArray(NSArray *array, NSMutableSet *outSet);
 
+static void dealWithValue(NSMutableString *result, id value, NSMutableSet 
*outSet);
 static NSUInteger getParamCount(NSString *format, NSMutableDictionary *outDict)
 {
-   NSUInteger paramCount = 0;
-   NSUInteger formatLength = [format length];
-
-   NSRange searchRange = NSMakeRange(0, formatLength);
-   NSRange paramRange = [format rangeOfString:@"%" options:0 
range:searchRange];
-
-   NSMutableArray *paramLocations = [NSMutableArray array];
-   NSArray *possibleTwo = @[@"l", @"h", @"z"];
-   NSArray *two = @[@"hh", @"ld", @"lu", @"lx", @"zx"];
-   while (paramRange.location != NSNotFound)
-   {
-   NSString *subString = [format 
substringWithRange:NSMakeRange(paramRange.location+1, 1)];
-   if ([possibleTwo containsObject:subString]) {
-   NSString *subString2 = [format 
substringWithRange:NSMakeRange(paramRange.location+1, 2)];
-   if ([two containsObject:subString2]) {
-   subString = subString2;
-   }
-   }
- 

[GitHub] incubator-weex pull request #1373: [jsfm] add try catch for callback functio...

2018-07-25 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-weex/pull/1373


---


incubator-weex git commit: [jsfm] add try catch for callback function and event handler (#1373)

2018-07-25 Thread hanks
Repository: incubator-weex
Updated Branches:
  refs/heads/master a45c0ce7f -> cb22b8ac7


[jsfm] add try catch for callback function and event handler (#1373)


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cb22b8ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cb22b8ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cb22b8ac

Branch: refs/heads/master
Commit: cb22b8ac7b407d86b16dc7c9ec518ff65739d4fe
Parents: a45c0ce
Author: Hanks 
Authored: Wed Jul 25 10:40:29 2018 +0800
Committer: Hanks 
Committed: Wed Jul 25 10:44:29 2018 +0800

--
 runtime/bridge/CallbackManager.js |  6 +-
 runtime/vdom/Element.js   | 15 ++-
 2 files changed, 15 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cb22b8ac/runtime/bridge/CallbackManager.js
--
diff --git a/runtime/bridge/CallbackManager.js 
b/runtime/bridge/CallbackManager.js
index 04d339c..e9f0887 100644
--- a/runtime/bridge/CallbackManager.js
+++ b/runtime/bridge/CallbackManager.js
@@ -76,7 +76,11 @@ export default class CallbackManager {
   delete this.callbacks[callbackId]
 }
 if (typeof callback === 'function') {
-  return callback(data)
+  try {
+return callback.call(null, data)
+  } catch (error) {
+console.error(`[JS Framework] Failed to execute the callback 
function:\n + ${error.toString()}`)
+  }
 }
 return new Error(`invalid callback id "${callbackId}"`)
   }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cb22b8ac/runtime/vdom/Element.js
--
diff --git a/runtime/vdom/Element.js b/runtime/vdom/Element.js
index 8e7b572..9f8290c 100644
--- a/runtime/vdom/Element.js
+++ b/runtime/vdom/Element.js
@@ -450,11 +450,16 @@ export default class Element extends Node {
   event.stopPropagation = () => {
 isStopPropagation = true
   }
-  if (options && options.params) {
-result = handler.call(this, ...options.params, event)
-  }
-  else {
-result = handler.call(this, event)
+  try {
+if (options && options.params) {
+  result = handler.call(this, ...options.params, event)
+}
+else {
+  result = handler.call(this, event)
+}
+  } catch (error) {
+console.error(`[JS Framework] Failed to invoke the event handler of 
"${type}" `
+  + `on ${this.type} (${this.ref}):\n ${error.toString()}`)
   }
 }