Skip to content

Commit

Permalink
Merge branch 'master' into FLUID-4675
Browse files Browse the repository at this point in the history
  • Loading branch information
yzen committed Mar 9, 2012
2 parents a62a341 + 9be57fe commit 27a8019
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/webapp/framework/core/js/Fluid.js
Expand Up @@ -37,9 +37,14 @@ var fluid = fluid || fluid_1_5;

fluid.version = "Infusion 1.5";

// Export this for use in environments like node.js, where it is useful for
// configuring stack trace behaviour
fluid.Error = Error;

fluid.environment = {
fluid: fluid
};

var globalObject = window || {};

var softFailure = [false];
Expand Down
18 changes: 15 additions & 3 deletions src/webapp/module/fluid.js
@@ -1,5 +1,5 @@
/*
Copyright 2012 OCAD University
Copyright 2012 OCAD University, Antranig Basman
Licensed under the Educational Community License (ECL), Version 2.0 or the New
BSD license. You may not use this file except in compliance with one these
Expand Down Expand Up @@ -48,12 +48,24 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt

var fluid = context.fluid;

fluid.require = function (moduleName, namespace) {
fluid.require = function (moduleName, foreignRequire, namespace) {
foreignRequire = foreignRequire || require;
namespace = namespace || moduleName;
var module = require(moduleName);
var module = foreignRequire(moduleName);
fluid.set(context, namespace, module);
return module;
};

fluid.getLoader = function (dirName, foreignRequire) {
return {
require: function (moduleName, namespace) {
if (moduleName.indexOf("/") > -1) {
moduleName = dirName + "/" + moduleName;
}
return fluid.require(moduleName, foreignRequire, namespace);
}
}
};

module.exports = fluid;

Expand Down

0 comments on commit 27a8019

Please sign in to comment.