Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Bind calls to ES5 constructors
- Loading branch information
1 parent
2fb0c34
commit 503b8aa
Showing
3 changed files
with
24 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
test/function/samples/associate-es5-constructor-parameter-mutations/_config.js
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,8 @@ | ||
var assert = require( 'assert' ); | ||
|
||
module.exports = { | ||
description: 'Associates ES5 constructor parameters with their call arguments', | ||
exports: function ( exports ) { | ||
assert.equal( exports.bar, 'present' ); | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/function/samples/associate-es5-constructor-parameter-mutations/main.js
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 @@ | ||
const foo = { mightBeExported: {} }; | ||
const exported = {}; | ||
|
||
function AssignExported ( obj ) { | ||
obj.mightBeExported = exported; | ||
} | ||
|
||
const bar = new AssignExported( foo ); | ||
foo.mightBeExported.bar = 'present'; | ||
|
||
export default exported; |