mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 17:34:58 +00:00
Update app.js
This commit is contained in:
parent
62626df60e
commit
23b8eb233e
7
app.js
7
app.js
|
@ -160,6 +160,7 @@ function include(FN) {
|
||||||
*/
|
*/
|
||||||
function require(FN) {
|
function require(FN) {
|
||||||
var cache = require.__cache__ = require.__cache__ || {};
|
var cache = require.__cache__ = require.__cache__ || {};
|
||||||
|
|
||||||
if (FN.substr(FN.length - 3) !== '.js') FN += ".js";
|
if (FN.substr(FN.length - 3) !== '.js') FN += ".js";
|
||||||
if (cache[FN]) return cache[FN];
|
if (cache[FN]) return cache[FN];
|
||||||
|
|
||||||
|
@ -168,7 +169,7 @@ function require(FN) {
|
||||||
var __dirname__ = require.__getDirName__(__filename__);
|
var __dirname__ = require.__getDirName__(__filename__);
|
||||||
var T = require.__load__(FN);
|
var T = require.__load__(FN);
|
||||||
|
|
||||||
// make function
|
// build
|
||||||
T = "(function(global){var module=new require.__ModuleObject__();return(function(exports,require,module,__filename,__dirname){"
|
T = "(function(global){var module=new require.__ModuleObject__();return(function(exports,require,module,__filename,__dirname){"
|
||||||
+ '"use strict";'
|
+ '"use strict";'
|
||||||
+ T
|
+ T
|
||||||
|
@ -176,14 +177,14 @@ function require(FN) {
|
||||||
+ FN
|
+ FN
|
||||||
;
|
;
|
||||||
|
|
||||||
// execute function
|
// execute
|
||||||
try {
|
try {
|
||||||
cache[FN] = eval(T);
|
cache[FN] = eval(T);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("PARSE ERROR!", e.number, ",", e.description, ", FN=", FN);
|
console.error("PARSE ERROR!", e.number, ",", e.description, ", FN=", FN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check is it exists VERSIONINFO
|
// print VERSIONINFO
|
||||||
if (typeof(cache[FN]) === "object") {
|
if (typeof(cache[FN]) === "object") {
|
||||||
if ("VERSIONINFO" in cache[FN]) console.log(cache[FN].VERSIONINFO);
|
if ("VERSIONINFO" in cache[FN]) console.log(cache[FN].VERSIONINFO);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user