- 授权协议: Apache
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/google/traceur-compiler
- 软件文档: https://github.com/google/traceur-compiler/wiki/LanguageFeatures
软件介绍
Traceur 是一个来自 Google 的 Javascript 编译器,通过它可以体验一些很新并且有趣的 Javascript 语言特性,这些多数是还没有被当前浏览器实现的 ECMAScript 标准或草案,比如:数组比较、类、模块、迭代器、方法参数默认值、Promise等。
以下是几个例子:
数组比较(Array Comprehension):
var array = [for (x of [0, 1, 2]) for (y of [0, 1, 2]) x + '' + y]; expect(array).to.be.eql([ '00', '01', '02', '10', '11', '12', '20', '21', '22' ]);
更精简的函数定义语法(Arrow Functions):
var square = (x) => {
return x * x;
};
var square2 = x => x * x;
var objectify = x => ({ value: x }); // Immediate return of an object literal must be wrapped in parentheses
expect(square(4)).to.be.eql(16);
expect(square2(4)).to.be.eql(16);
expect(objectify(1)).to.be.eql({ value: 1 });Promises:
function timeout(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
timeout(100).then(() => {
console.log('done');
});更详细的语言特性列表,请参考:https://github.com/google/traceur-compiler/wiki/LanguageFeatures
GWT in Action
Robert Hanson、Adam Tacy / Manning Publications / 2007-06-05 / USD 49.99
This book will show Java developers how to use the Google Web Toolkit (GWT) to rapidly create rich web-based applications using their existing skills. It will cover the full development cycle, from ......一起来看看 《GWT in Action》 这本书的介绍吧!
