ECMAScript 4的一些引用资料/杂记

刚才在es4-discuss看到的:
[quote="Graydon"]Sure. I can describe the state of most issues as named by the proposals page, I think. Some of the proposals have sort of no-longer-sensible names so I'm going to use the proposals page as a rough guide and name the things that have seemed, in my work, to be separate "features" of the RI.

Implemented, may have bugs:
- classes and interfaces
- namespaces
- pragmas
- let, const, let-const
- iterators
- enumerability control
- type expressions / definitions / annotations
- runtime type checks ("standard mode")
- nullability - destructuring assignment
- slice syntax
- hashcode
- catchalls
- map & vector
- date & time improvements
- meta objects
- static generics
- string trim
- typeof
- globals
- expression closures
- name objects
- type operators (is / to / cast / wrap)

Implemented and partly working, but still in flux / work to do:
- inheritance checking
- strict mode
- type parameters
- structural types
- numbers & decimal
- getters & setters (structural part is incomplete)
- packages

Partially implemented / not yet working:
- program units
- generic function
- updates to unicode
- updates to regexps

Unimplemented:
- generators
- tail calls
- triple quotes
- stack inspection
- reformed with
- resurrected eval (eval exists but may be wrong)
- help for the argument object
- "this function" / "this generator"

In my mind the "high priority" deficits where I actually know what to do are:
- extending strict mode
- extending the part of the definer that checks inheritance

The remaining issues on my list all involve some spec/discussion work (units and packages, type parameters, structural typechecks, tail calls, reformed rules for with/this/eval/arguments)[/quote]
很好,这问题问得好回答得也好。可以更有效的阅读ES4 RI了。

===================================================================

Francis Cheng在[url=http://blogs.adobe.com/fcheng/]他的blog[/url]提到了[url=http://blogs.adobe.com/fcheng/2008/02/vectors.html]ECMAScript 4中的Vector[/url]。内容倒没什么让人感到特别意外的地方,反正C++和Java里都是这么写的了。
Vector的构造器会接受两个参数,第一个是初始长度,第二个是是否为固定长度。所以可以这样构造一个Vector实例:
var intVector:Vector.<int> = new Vector.<int>(7, true)

得到的intVector就是一个长度为7,长度固定的Vector。
Vector有下列几个特性:
[list][*]Vector总是密集的(而不像数组中间可以有空洞)
[*]Vector会进行边界检查(例如说不能对一个长度为3的Vector中下标为10的位置赋值)
[*]Vector可以是固定长度的
[*]Vector有类型参数
[*]Vector拥有数组所拥有的方法(例如push(), pop(), slice(), sort()等),并且还有些额外的方法如every(), filter(), indexOf(), some()等。
[/list]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值