Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Pass exports object as "this" #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions lib/stitch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/stitch.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ exports.Package = class Package
module = {id: path, exports: {}};
try {
cache[path] = module;
fn(module.exports, function(name) {
fn.apply(module.exports, [module.exports, function(name) {
return require(name, dirname(path));
}, module);
}, module]);
return module.exports;
} catch (err) {
delete cache[path];
Expand Down