New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

regularjs

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regularjs - npm Package Compare versions

Comparing version
0.6.0
to
0.6.1
+24
-7
lib/dom.js

@@ -180,6 +180,12 @@ /*jshint -W082 */

// return node[key], if none exists, attach one with unique value
function ensureId(node, key) {
return typeof node[key] !== 'undefined' ?
node[key] :
(node[key] = _.uid());
}
dom.on = function(node, type, handler){
var types = type.split(' ');
handler.real = function(ev){
var real = function(ev){
var $event = new Event(ev);

@@ -189,5 +195,16 @@ $event.origin = node;

}
var nodeId = ensureId(node, '_nid');
handler._events = handler._events || {};
types.forEach(function(type){
type = fixEventName(node, type);
addEvent(node, type, handler.real);
var cacheKey = nodeId + '-' + type;
if(!handler._events[cacheKey]) {
handler._events[cacheKey] = real;
}
addEvent(node, type, handler._events[cacheKey]);
});

@@ -198,6 +215,9 @@ return dom;

var types = type.split(' ');
handler = handler.real || handler;
var nodeId = ensureId(node, '_nid');
types.forEach(function(type){
type = fixEventName(node, type);
removeEvent(node, type, handler);
var cacheKey = nodeId + '-' + type;
var real = handler._events[cacheKey] || handler;
removeEvent(node, type, real);
})

@@ -394,4 +414,1 @@ }

}

@@ -399,3 +399,3 @@ var _ = require("../util");

set = set.replace(_.setName,
prefix + setBuffer.join("") + "})("+ _.setName +")" );
prefix + setBuffer.join("") + "})("+ _.setName +")" );

@@ -558,3 +558,3 @@ }

last = path;
base = ctxName + "._sg_('" + path + "', " + varName + ", " + extName + ")";
base = ctxName + "._sg_('" + path + "', undefined, " + varName + ", " + extName + ")";
onlySimpleAccessor = true;

@@ -585,3 +585,3 @@ }else{ //Primative Type

if( this.la() !== "(" ){
base = ctxName + "._sg_('" + tmpName + "', " + base + ")";
base = ctxName + "._sg_('" + tmpName + "', " + base + " || null)";
}else{

@@ -598,3 +598,3 @@ base += "." + tmpName ;

// and confirm that the function call wont lose its context
base = ctxName + "._sg_(" + path.get + ", " + base + ")";
base = ctxName + "._sg_(" + path.get + ", " + base + " || null)";
}else{

@@ -601,0 +601,0 @@ base += "[" + path.get + "]";

@@ -556,15 +556,32 @@ /**

// simple accessor get
_sg_:function(path, defaults, ext){
// ext > parent > computed > defaults
_sg_:function(path, parent, defaults, ext){
if( path === undefined ) return undefined;
if(ext && typeof ext === 'object'){
if(ext[path] !== undefined) return ext[path];
}
var computed = this.computed,
computedProperty = computed[path];
if(computedProperty){
if(computedProperty.type==='expression' && !computedProperty.get) this._touchExpr(computedProperty);
if(computedProperty.get) return computedProperty.get(this);
else _.log("the computed '" + path + "' don't define the get function, get data."+path + " altnately", "warn")
// reject to get from computed, return undefined directly
// like { empty.prop }, empty equals undefined
// prop shouldn't get from computed
if(parent === null) {
return undefined
}
if(parent && typeof parent[path] !== 'undefined') {
return parent[path]
}
// without parent, get from computed
if (parent !== null) {
var computed = this.computed,
computedProperty = computed[path];
if(computedProperty){
if(computedProperty.type==='expression' && !computedProperty.get) this._touchExpr(computedProperty);
if(computedProperty.get) return computedProperty.get(this);
else _.log("the computed '" + path + "' don't define the get function, get data."+path + " altnately", "warn")
}
}
if( defaults === undefined ){

@@ -571,0 +588,0 @@ return undefined;

@@ -394,8 +394,12 @@ require('./helper/shim')();

return function fire(obj){
var sender = this;
self.$update(function(){
var data = this.data;
data.$event = obj;
data.$sender = sender;
var res = evaluate(self);
if(res === false && obj && obj.preventDefault) obj.preventDefault();
data.$event = undefined;
data.$sender = undefined;
})

@@ -570,3 +574,3 @@

}
_.eventReg = /^on-(\w[-\w]+)$/;
_.eventReg = /^on-(\w[-\w]*)$/;

@@ -619,8 +623,1 @@ _.toText = function(obj){

}
{
"name": "regularjs",
"version": "0.6.0",
"version": "0.6.1",
"author": {

@@ -5,0 +5,0 @@ "name": "leeluolee"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display