You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/08/08 08:55:21 UTC
[09/39] incubator-weex git commit: * [jsfm] return instance in legacy
framework
* [jsfm] return instance in legacy framework
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ac348544
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ac348544
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ac348544
Branch: refs/heads/0.16-dev
Commit: ac348544ccbf46170d714521a0a9cd3cf32901f1
Parents: ac53dc8
Author: Hanks <zh...@gmail.com>
Authored: Fri Jul 28 13:50:48 2017 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Fri Jul 28 13:50:48 2017 +0800
----------------------------------------------------------------------
html5/frameworks/legacy/static/create.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ac348544/html5/frameworks/legacy/static/create.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/static/create.js b/html5/frameworks/legacy/static/create.js
index ae97d46..1c963b3 100644
--- a/html5/frameworks/legacy/static/create.js
+++ b/html5/frameworks/legacy/static/create.js
@@ -42,13 +42,10 @@ export function createInstance (id, code, options, data, info) {
if (!instance) {
instance = new App(id, options)
instanceMap[id] = instance
- result = initApp(instance,
- code,
- data,
- services)
+ result = initApp(instance, code, data, services)
}
else {
result = new Error(`invalid instance id "${id}"`)
}
- return result
+ return (result instanceof Error) ? result : instance
}