node.js 941 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. //>>built
  7. define("dojo/node",["./has"],function(_1){
  8. if(!0){
  9. throw new Error("node plugin failed to load because environment is not Node.js");
  10. }
  11. var _2;
  12. if(require.nodeRequire){
  13. _2=require.nodeRequire("path");
  14. }else{
  15. throw new Error("node plugin failed to load because it cannot find the original Node.js require");
  16. }
  17. return {load:function(id,_3,_4){
  18. if(!_3.nodeRequire){
  19. throw new Error("Cannot find native require function");
  20. }
  21. _4((function(id,_5){
  22. var _6=define,_7;
  23. define=undefined;
  24. try{
  25. _7=_5(id);
  26. }
  27. finally{
  28. define=_6;
  29. }
  30. return _7;
  31. })(id,_3.nodeRequire));
  32. },normalize:function(id,_8){
  33. if(id.charAt(0)==="."){
  34. var _9=require.toUrl(_8(".")).replace("/",_2.sep),_a=id.split("/");
  35. _a.unshift(_9);
  36. id=_2.join.apply(_2,_a);
  37. }
  38. return id;
  39. }};
  40. });