You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/14 09:26:22 UTC

[GitHub] Hanks10100 closed pull request #1909: [jsfm] attach data to WeexInstance

Hanks10100 closed pull request #1909: [jsfm] attach data to WeexInstance
URL: https://github.com/apache/incubator-weex/pull/1909
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/runtime/api/WeexInstance.js b/runtime/api/WeexInstance.js
index af2fcd7d81..b6738ebc1a 100644
--- a/runtime/api/WeexInstance.js
+++ b/runtime/api/WeexInstance.js
@@ -53,9 +53,10 @@ function moduleSetter (id, module, method, fn) {
 }
 
 export default class WeexInstance {
-  constructor (id, config) {
+  constructor (id, config, data) {
     setId(this, String(id))
     this.config = config || {}
+    this._nativeData = data || {}
     this.document = new Document(id, this.config.bundleUrl)
     this.requireModule = this.requireModule.bind(this)
     this.importScript = this.importScript.bind(this)
diff --git a/runtime/api/init.js b/runtime/api/init.js
index 6813c5f8af..c4d914b3db 100644
--- a/runtime/api/init.js
+++ b/runtime/api/init.js
@@ -90,7 +90,7 @@ function getFrameworkType (id) {
 }
 
 function createInstanceContext (id, options = {}, data) {
-  const weex = new WeexInstance(id, options)
+  const weex = new WeexInstance(id, options, data)
 
   const bundleType = options.bundleType || 'Vue'
   instanceTypeMap[id] = bundleType


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services