Comparing version 1.0.4 to 1.1.0
23
index.js
@@ -24,11 +24,22 @@ 'use strict'; | ||
estraverse.replace(ast, { | ||
enter: function enter(node) { | ||
if ('BlockStatement' === node.type) { | ||
return node.body[0].alternate.alternate; | ||
leave: function leave(node, parent) { | ||
var ret; | ||
if ('IfStatement' === node.type) { | ||
if ('BinaryExpression' !== node.test.type) return; | ||
if ('self' === node.test.left.argument.name) { | ||
node.alternate = null; | ||
} else if ('global' === node.test.left.argument.name) { | ||
ret = node.alternate; | ||
} | ||
return ret; | ||
} | ||
if ( | ||
'ConditionalExpression' === node.type | ||
&& 'global' === node.consequent.right.name | ||
'BlockStatement' === node.type | ||
&& 'FunctionExpression' === parent.type | ||
) { | ||
return node.alternate; | ||
return node.body[0].alternate.alternate; | ||
} | ||
@@ -35,0 +46,0 @@ } |
{ | ||
"name": "deumdify", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Browserify plugin to expose a standalone bundle as a property of the global object", | ||
@@ -25,9 +25,9 @@ "keywords": [ | ||
"scripts": { | ||
"coverage": "istanbul cover node_modules/.bin/_mocha -- --reporter spec", | ||
"test": "mocha --reporter spec", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec" | ||
"coverage": "istanbul cover node_modules/.bin/_mocha", | ||
"test": "mocha", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly" | ||
}, | ||
"dependencies": { | ||
"escodegen": "1.4.x", | ||
"esprima": "1.2.x", | ||
"escodegen": "1.6.x", | ||
"esprima": "2.0.x", | ||
"estraverse": "1.9.x", | ||
@@ -37,12 +37,12 @@ "through2": "0.6.x" | ||
"devDependencies": { | ||
"browserify": "8.0.x", | ||
"browserify": "9.0.x", | ||
"concat-stream": "1.4.x", | ||
"istanbul": "0.3.x", | ||
"jsdom": "1.5.x", | ||
"jsdom": "3.1.x", | ||
"mocha": "2.1.x", | ||
"pre-commit": "0.0.x" | ||
"pre-commit": "1.0.x" | ||
}, | ||
"peerDependencies": { | ||
"browserify": "5.1.0 - 8" | ||
"browserify": "9" | ||
} | ||
} |
5824
4
85
+ AddedJSONStream@0.10.0(transitive)
+ Addedbrowser-pack@4.0.4(transitive)
+ Addedbrowserify@9.0.8(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddeep-equal@1.1.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedescodegen@1.6.1(transitive)
+ Addedesprima@2.0.0(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-date-object@1.1.0(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedoptionator@0.5.0(transitive)
+ Addedread-only-stream@1.1.1(transitive)
+ Addedregexp.prototype.flags@1.5.4(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedumd@3.0.3(transitive)
- RemovedJSONStream@0.8.4(transitive)
- Removedasync@0.2.10(transitive)
- Removedbrowser-pack@3.2.0(transitive)
- Removedbrowserify@8.1.3(transitive)
- Removedcallsite@1.0.0(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddeep-equal@0.2.2(transitive)
- Removedescodegen@1.4.3(transitive)
- Removedoptimist@0.3.7(transitive)
- Removedoptionator@0.4.0(transitive)
- Removedresolve@0.3.10.7.4(transitive)
- Removedrfile@1.0.0(transitive)
- Removedruglify@1.0.0(transitive)
- Removedsource-map@0.1.34(transitive)
- Removeduglify-js@2.2.52.4.24(transitive)
- Removeduglify-to-browserify@1.0.2(transitive)
- Removedumd@2.1.0(transitive)
- Removedwindow-size@0.1.0(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedyargs@3.5.4(transitive)
Updatedescodegen@1.6.x
Updatedesprima@2.0.x