Skip to content

Commit

Permalink
Ensure escapedSource test is run for strict mode, too.
Browse files Browse the repository at this point in the history
Addresses #50.
  • Loading branch information
eventualbuddha committed Jan 13, 2015
1 parent 09bb404 commit 64d8d01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/standalone/builders/strictMode/cjs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import packageResult from 'utils/packageResult';
import transformBody from './utils/transformBody';
import { req } from 'utils/mappers';

export default function cjs ( mod, body, options ) {
var importBlock;
Expand All @@ -9,10 +10,10 @@ export default function cjs ( mod, body, options ) {
var name, replacement;

if ( x.isEmpty ) {
replacement = `require('${x.path}');`;
replacement = `${req(x.path)};`;
} else {
name = mod.getName( x );
replacement = `var ${name} = require('${x.path}');`;
replacement = `var ${name} = ${req(x.path)};`;
}

return replacement;
Expand Down
1 change: 1 addition & 0 deletions test/strictMode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = function () {
{ file: 'earlyExport', description: 'transpiles exports that are not the final statement' },
{ file: 'emptyImport', description: 'transpiles empty imports with no exports' },
{ file: 'emptyImportWithDefaultExport', description: 'transpiles empty imports with default exports' },
{ file: 'escapedSource', description: 'preserves character escapes in source strings' },
{ file: 'exportAnonFunction', description: 'transpiled anonymous default function exports' },
{ file: 'exportDefault', description: 'transpiles default exports' },
{ file: 'exportInlineFunction', description: 'transpiles named inline function exports' },
Expand Down

0 comments on commit 64d8d01

Please sign in to comment.