mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
11 changed files with 76 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||
module.exports = { |
|||
description: 'side-effects to non-globals are not blindly included' |
|||
}; |
@ -0,0 +1,7 @@ |
|||
define(function () { 'use strict'; |
|||
|
|||
var foo = 42; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}); |
@ -0,0 +1,5 @@ |
|||
'use strict'; |
|||
|
|||
var foo = 42; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,3 @@ |
|||
var foo = 42; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,7 @@ |
|||
(function () { 'use strict'; |
|||
|
|||
var foo = 42; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
})(); |
@ -0,0 +1,11 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : |
|||
typeof define === 'function' && define.amd ? define(factory) : |
|||
factory(); |
|||
}(this, function () { 'use strict'; |
|||
|
|||
var foo = 42; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
})); |
@ -0,0 +1,6 @@ |
|||
var uid = 0; |
|||
uid = 1; |
|||
uid += 1; |
|||
uid++; |
|||
|
|||
export var foo = 42; |
@ -0,0 +1,2 @@ |
|||
import { foo } from './foo'; |
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,14 @@ |
|||
var assert = require( 'assert' ); |
|||
|
|||
var Math = {}; |
|||
|
|||
module.exports = { |
|||
description: 'side-effects to assumed globals are included', |
|||
context: { |
|||
Math: Math |
|||
}, |
|||
exports: function ( exports ) { |
|||
assert.equal( Math.square( 3 ), 9 ); |
|||
assert.equal( Math.cube( 3 ), 27 ); |
|||
} |
|||
}; |
@ -0,0 +1,3 @@ |
|||
import { square } from './math'; |
|||
|
|||
assert.equal( square( 2 ), 4 ); |
@ -0,0 +1,15 @@ |
|||
function square ( x ) { |
|||
return x * x; |
|||
} |
|||
|
|||
function cube ( x ) { |
|||
return x * x * x; |
|||
} |
|||
|
|||
Math.square = square; |
|||
|
|||
if ( true ) { |
|||
Math.cube = cube; |
|||
} |
|||
|
|||
export { square }; |
Loading…
Reference in new issue