⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testingcase08.js

📁 《脚本驱动的应用软件开发方法与实践》源代码下载
💻 JS
字号:
//*****************************************************************************
// A Practical Guide to Script-Driven Software Development
// Author: Qiming Lu                        Date: 5/1/2006
//*****************************************************************************

// Testing Case 8: automatic type conversion
Debugger.addBlankLine(1);
Debugger.trace("Testing Case 8", "automatic type conversion");

// Test some built-in objects
var currentDate = new Date();
Debugger.trace("Info", currentDate);

// Test a user-defined JS object
function Color(r, g, b)
{
	this.r = r;
	this.g = g;
	this.b = b;
}

Color.prototype.toString = function()
{
	return "RGB(" + this.r + "," + this.g + "," + this.b + ")";
}

var myColor = new Color(128, 128, 128);
Debugger.trace("Info", myColor);

// Test our C++ created object
try
{
	var wheel1 = Application.car.createWheel("KUMHO", "red");
	Debugger.trace("Info", wheel1);
}
catch (e)
{
	Debugger.trace("Exception", e.message);
}

// Test our enhanced wheel object
try
{
	var wheel2 = Application.car.createEnhancedWheel("KUMHO", "red");
	Debugger.trace("Info", wheel2);
}
catch (e)
{
	Debugger.trace("Exception", e.message);
}

⌨️ 快捷键说明

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