vaderjs 1.3.3-alpha-25 → 1.3.3-alpha-27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vader.js +5 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vaderjs",
3
3
  "description": "A Reactive library aimed to helping you build reactive applications inspired by react.js",
4
4
  "module": "vader.js",
5
- "version": "1.3.3-alpha-25",
5
+ "version": "1.3.3-alpha-27",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -180,6 +180,9 @@ function Compiler(func) {
180
180
  }
181
181
  });
182
182
 
183
+ if(isJSXComponent){
184
+ return
185
+ }
183
186
  let replacement = `this.useFunction(${name} ${isJSXComponent ? "" : ","
184
187
  } ${params || null}${isJSXComponent ? "" : ","} true ${isJSXComponent ? "" : ","
185
188
  } '${ref}')`;
@@ -227,7 +230,7 @@ function Compiler(func) {
227
230
  let paramString = params ? params.split(' ').map(param => param + ',').join('') : "";
228
231
 
229
232
  paramString = paramString.replaceAll(',,', ',')
230
- let jsxAttribute = `${attributeName}=function(${paramString}){${newvalue}},`
233
+ let jsxAttribute = `${attributeName}=function(${paramString}){${newvalue}}.bind(this),`
231
234
  let newatribute = `${attributeName}="\${this.bind(\`${newvalue}\`, ${isJSXComponent ? true : false}, '${ref}', "${paramString}", ${params || null})}",`
232
235
 
233
236
  attribute[attributeName] = {
@@ -265,7 +268,7 @@ function Compiler(func) {
265
268
  newvalue = newvalue.split('\n').map(line => line.trim() ? line.trim() + ';' : line).join('\n');
266
269
  let paramString = params ? params.split(' ').map(param => param + ',').join('') : "";
267
270
  paramString = paramString.replaceAll(',,', ',')
268
- let jsxAttribute = `${attributeName}=function(${paramString}){${newvalue}},`
271
+ let jsxAttribute = `${attributeName}=function(${paramString}){${newvalue}}.bind(this),`
269
272
  let newattribute = `${attributeName}="\${this.bind(\`${newvalue}\`, ${isJSXComponent ? true : false}, '${ref}', "${paramString}", ${params || null})}",`
270
273
  newattribute = newattribute.replace(/\s+/g, " ")
271
274
  string = string.replace(old, isJSXComponent ? jsxAttribute : newattribute);