8000 improved logger, support for more js shells, and quit() env module by jbeard4 · Pull Request #79 · requirejs/r.js · GitHub
[go: up one dir, main page]

Skip to content

improved logger, support for more js shells, and quit() env module #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Added basic browser support for r.js.
  • Loading branch information
jbeard4 committed Jan 12, 2012
commit 1dd826d3bf5ee67991f3d21c66f87d6ed3f637a0
1 change: 1 addition & 0 deletions build/jslib/browser/args.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define(function(){return function(){};});
1 change: 1 addition & 0 deletions build/jslib/browser/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define(function(){return function(){};});
2 changes: 2 additions & 0 deletions build/jslib/browser/load.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//nothing to do here
define(function(){return function(){};});
1 change: 1 addition & 0 deletions build/jslib/browser/optimize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define(function(){return function(){};});
6 changes: 6 additions & 0 deletions build/jslib/browser/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
define(function(){
return function(){
console.log.apply(console,Array.prototype.slice.apply(arguments));
};
});

1 change: 1 addition & 0 deletions build/jslib/browser/quit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define(function(){return function(){};});
9 changes: 6 additions & 3 deletions build/jslib/x.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ var requirejs, require, define;
commandOption = fileName.substring(1);
fileName = process.argv[3];
}
} else if (typeof window !== "undefined" && navigator && document) {
env = 'browser';
} else if (typeof load === 'function' && typeof print === 'function'){
env = 'spartan';

Expand All @@ -119,7 +121,7 @@ var requirejs, require, define;
}
};
}
}
}

//INSERT require.js

Expand Down Expand Up @@ -249,15 +251,16 @@ var requirejs, require, define;
//Just run an app

//Load the bundled libraries for use in the app.
if (commandOption === 'lib') {
//browser loads libs by default
if (commandOption === 'lib' || env === 'browser') {
loadLib();
}

setBaseUrl(fileName);

if(env === 'spartan'){
load(fileName);
} else{
} else if (env !== 'browser'){
if (exists(fileName)) {
exec(readFile(fileName), fileName);
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var fs = require('fs'),
loadRegExp = /\/\/INSERT ([\w\/\.]+)/g,
moduleNameRegExp = /build\/jslib\/([\w\/\-]+)\.js$/,
defRegExp = /define\s*\(/,
envs = ['node', 'rhino', 'spartan'],
envs = ['node', 'rhino', 'spartan', 'browser'],
//Update this list of files by running the optimizer against
//build/jslib/opto.build.js,
//but then remove any jslib/node entries and make sure there is
Expand Down
0