babel-plugin-namespace-amd-define
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -81,3 +81,14 @@ 'use strict'; | ||
}); | ||
it('when it is an object field', function () { | ||
var source = '\n\t\t\tvar a = {\n\t\t\t\tdefine: function(name, value) {\n\t\t\t\t\treturn name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t'; | ||
var _babel$transform7 = babel.transform(source, { | ||
plugins: [_index2.default] | ||
}), | ||
code = _babel$transform7.code; | ||
expect(code).toMatchSnapshot(); | ||
}); | ||
}); | ||
//# sourceMappingURL=index.test.js.map |
@@ -15,2 +15,6 @@ 'use strict'; | ||
if (path.parent.type === 'ObjectProperty' && path.parent.key === path.node) { | ||
return; | ||
} | ||
var scope = void 0; | ||
@@ -17,0 +21,0 @@ |
{ | ||
"name": "babel-plugin-namespace-amd-define", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A Babel plugin to namespace (prefix) AMD define() calls.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -88,2 +88,18 @@ import * as babel from 'babel-core'; | ||
}); | ||
it('when it is an object field', () => { | ||
const source = ` | ||
var a = { | ||
define: function(name, value) { | ||
return name; | ||
} | ||
} | ||
`; | ||
const {code} = babel.transform(source, { | ||
plugins: [plugin], | ||
}); | ||
expect(code).toMatchSnapshot(); | ||
}); | ||
}); |
@@ -17,2 +17,9 @@ /** | ||
if ( | ||
path.parent.type === 'ObjectProperty' && | ||
path.parent.key === path.node | ||
) { | ||
return; | ||
} | ||
let scope; | ||
@@ -19,0 +26,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17344
244