Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
134 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function error ( props ) { | ||
const err = new Error( props.message ); | ||
|
||
Object.keys( props ).forEach( key => { | ||
err[ key ] = props[ key ]; | ||
}); | ||
|
||
throw err; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
'use strict'; | ||
|
||
var $ = require('jquery'); | ||
$ = 'default' in $ ? $['default'] : $; | ||
function _interopDefault (ex) { return 'default' in ex ? ex['default'] : ex; } | ||
|
||
var $ = _interopDefault(require('jquery')); | ||
|
||
$( function () { | ||
$( 'body' ).html( '<h1>hello world!</h1>' ); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
'use strict'; | ||
|
||
var factory = require('factory'); | ||
factory = 'default' in factory ? factory['default'] : factory; | ||
function _interopDefault (ex) { return 'default' in ex ? ex['default'] : ex; } | ||
|
||
var factory = _interopDefault(require('factory')); | ||
var baz = require('baz'); | ||
var containers = require('shipping-port'); | ||
var alphabet = require('alphabet'); | ||
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet; | ||
var alphabet__default = _interopDefault(alphabet); | ||
|
||
factory( null ); | ||
baz.foo( baz.bar, containers.port ); | ||
containers.forEach( console.log, console ); | ||
console.log( alphabet.a ); | ||
console.log( alphabet__default.length ); | ||
console.log( alphabet__default.length ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var path = require( 'path' ); | ||
var assert = require( 'assert' ); | ||
|
||
module.exports = { | ||
description: 'errors if code calls an external namespace', | ||
error: function ( err ) { | ||
assert.equal( err.message, 'Cannot call a namespace (\'foo\')' ); | ||
assert.equal( err.file.replace( /\//g, path.sep ), path.resolve( __dirname, 'main.js' ) ); | ||
assert.equal( err.pos, 28 ); | ||
assert.deepEqual( err.loc, { line: 2, column: 0 }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as foo from 'foo'; | ||
foo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var path = require( 'path' ); | ||
var assert = require( 'assert' ); | ||
|
||
module.exports = { | ||
description: 'errors if code calls an internal namespace', | ||
error: function ( err ) { | ||
assert.equal( err.message, 'Cannot call a namespace (\'foo\')' ); | ||
assert.equal( err.file.replace( /\//g, path.sep ), path.resolve( __dirname, 'main.js' ) ); | ||
assert.equal( err.pos, 33 ); | ||
assert.deepEqual( err.loc, { line: 2, column: 0 }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const a = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as foo from './foo.js'; | ||
foo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
description: 'does not stack overflow on crazy cyclical dependencies' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { C } from './c.js'; | ||
|
||
export function B () {}; | ||
|
||
B.prototype = { | ||
c: function () { | ||
return function () { | ||
new C(); | ||
}; | ||
}() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { D } from './d.js'; | ||
|
||
export function C () { | ||
this.x = 'x'; | ||
} | ||
|
||
C.prototype = { | ||
d: function () { | ||
return function () { | ||
new D(); | ||
}; | ||
}() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { B } from './b.js'; | ||
import { C } from './c.js'; | ||
|
||
export function D () {}; | ||
|
||
D.prototype = { | ||
c: function () { | ||
return function () { | ||
new C(); | ||
}; | ||
}() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { C } from './c.js'; | ||
|
||
assert.equal( new C().x, 'x' ); |