diff --git a/package.json b/package.json index 5c2a5b3..93003b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amdclean", - "version": "0.3.1", + "version": "0.3.2", "description": "A build tool that converts AMD code to standard JavaScript", "main": "./src/amdclean", "repository": { diff --git a/src/amdclean.js b/src/amdclean.js index 633e677..86cdc8b 100644 --- a/src/amdclean.js +++ b/src/amdclean.js @@ -1,4 +1,4 @@ -/*! amdclean - v0.3.1 - 2013-11-25 +/*! amdclean - v0.3.2 - 2013-11-26 * http://gregfranko.com/amdclean * Copyright (c) 2013 Greg Franko; Licensed MIT*/ @@ -35,7 +35,7 @@ // The Public API object publicAPI = { // Current project version number - VERSION: '0.3.1', + VERSION: '0.3.2', // Default Options defaultOptions: { 'globalObject': false, diff --git a/test/specs/convert.js b/test/specs/convert.js index a3ebb97..3ed9594 100644 --- a/test/specs/convert.js +++ b/test/specs/convert.js @@ -26,6 +26,13 @@ describe('amdclean specs', function() { expect(cleanedCode).toBe(standardJavaScript); }); + it('should correctly normalize multi-level relative file paths', function() { + var AMDcode = "define('./foo/prototype/commonMethodName.js', ['example1', 'example2'], function(one, two) {});", + cleanedCode = amdclean.clean({ code: AMDcode, escodegen: { format: { compact: true } } }), + standardJavaScript = "var foo_prototype_commonMethodNamejs=function (one,two){}(example1,example2);"; + expect(cleanedCode).toBe(standardJavaScript); + }); + it('should correctly prefix reserved keywords with an underscore', function() { var AMDcode = "define('foo', ['./function'], function(fn){ fn.bar(); });", cleanedCode = amdclean.clean({ code: AMDcode, escodegen: { format: { compact: true } } }),