runtime.js

来自「《JavaScript王者归来》examples.rar」· JavaScript 代码 · 共 225 行 · 第 1/4 页

JS
225
字号
				{
					code = code.replace((strings_tmpPrefix + i
					+ strings_tmpSuffix),	constStrs[i]);
				}
				return code;
			}
		});

	JSVM.setConsole(
		new function ()
		{
				var printer = null;
				this.output = function(msg)
				{
					if (printer == null)
					{
						printer = jsre.JSVM.loadClass("js.io.WebPrinter").newInstance();
						printer.prompt = "JSVM Console output [Version "
							+ jsre.currentVersion
							+ "]<br>(C) All Copyright 2004-2005 JSVM Team. <br><br>";
					}
					printer.print(msg);
				}
				this.input = function ()
				{
					return window.prompt("JSVM Console; Input: ");
				}
		}
	);
	JSVM.logger.log("JSVM redefine console succ.");

	jsre.loadModule("runtime.module", function ()
		{
			var jsre = _JSVM_Namespace.runtimeEnvironment;
			window.Class = _JSVM_Namespace.kernel.Class;
			window._import = function(name)
			{
				try
				{
					var clazz = jsre.JSVM.loadClass(name);
					var shortName = name.replace(/(.*)\./, "");
					if ("undefined"	== typeof(window[shortName]))
					{
						window[shortName] = clazz;
					}
				}
				catch(ex)
				{
					ex.printStackTrace();
					throw ex;
				}
			}
		});
});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?