babel-plugin-transform-event
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -71,3 +71,3 @@ 'use strict'; | ||
if (t.isFunctionDeclaration(path.node) || t.isFunctionExpression(path.node) || t.isClassMethod(path.node)) { | ||
if (path.node.params[0].name === 'e') { | ||
if (path.node.params.length && path.node.params[0].name === 'e') { | ||
return path; | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name": "babel-plugin-transform-event", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "add support e.scrElement e.returnValue e.cancelBubble in IE8", | ||
@@ -5,0 +5,0 @@ "main": "dest/index.js", |
@@ -5,5 +5,4 @@ # Babel-plugin-event-target | ||
* `e.preventDefault()` => `e.preventDefault ? e.preventDefault() : e.returnValue = false` | ||
* `e.stopPropagation()` => `e.stopPropagation ? e.stopPropagation() : | ||
e.cancelBubble = true` | ||
* `e.stopImmediatePropagation()` => `e.stopImmediatePropagation()` | ||
* `e.stopPropagation()` => `e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true` | ||
* `e.stopImmediatePropagation()` => `e.stopImmediatePropagation ? e.stopImmediatePropagation() : void(0)` | ||
@@ -22,3 +22,3 @@ import template from 'babel-template' | ||
if (t.isFunctionDeclaration(path.node) || t.isFunctionExpression(path.node) || t.isClassMethod(path.node)) { | ||
if (path.node.params[0].name === 'e') { | ||
if (path.node.params.length && path.node.params[0].name === 'e') { | ||
return path | ||
@@ -25,0 +25,0 @@ } |
9431
8