From 4124c269ea7104fb7d3d3b473cc04c8d4c1b4b74 Mon Sep 17 00:00:00 2001 From: surunzi Date: Tue, 28 Jun 2016 13:54:01 +0800 Subject: [PATCH] Fix: Android illegal invocation --- src/lib/stringify.es6 | 17 ++--------------- webpack.config.js | 3 ++- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/lib/stringify.es6 b/src/lib/stringify.es6 index ff7d1a5..7261405 100644 --- a/src/lib/stringify.es6 +++ b/src/lib/stringify.es6 @@ -79,12 +79,7 @@ export default function stringify(obj, visited, topObj, simple) } util.each(names, name => { - try { - parts.push(`"${escapeJsonStr(name)}": ${stringify(obj[name], visited, null, simple)}`); - } catch (e) - { - parts.push(`"${escapeJsonStr(name)}": "${escapeJsonStr(e.message)}"`); - } + parts.push(`"${escapeJsonStr(name)}": ${stringify(topObj[name], visited, null, simple)}`); }); if (proto) parts.push(proto); json += parts.join(', ') + '}'; @@ -134,15 +129,7 @@ export default function stringify(obj, visited, topObj, simple) names.sort(sortObjName); util.each(names, name => { - try - { - let val = topObj[name]; - - parts.push(`"${escapeJsonStr(name)}": ${stringify(val, visited, null, simple)}`); - } catch (e) - { - parts.push(`"${escapeJsonStr(name)}": "${escapeJsonStr(e.message)}"`); - } + parts.push(`"${escapeJsonStr(name)}": ${stringify(topObj[name], visited, null, simple)}`); }); if (proto) parts.push(proto); json += parts.join(',\n') + '\n}'; diff --git a/webpack.config.js b/webpack.config.js index 8548320..28b9c90 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,8 @@ module.exports = { devtool: false, entry: './src/index.es6', devServer: { - contentBase: './test' + contentBase: './test', + port: 3000 }, output: { path: __dirname + '/dist/',