第十章:执行上下文 已发布

8 views
Skip to first unread message

氷の鋭

unread,
Jul 16, 2008, 10:54:26 AM7/16/08
to ECMA-262 翻译组
前言和 1 到 10 章(执行上下文),不包括样式表和链接。
  ZIP 包下载:
  http://ecma-262.googlecode.com/files/ecma-262-%5B0-10%5D.zip
  比较重要。

Zhang Zhen

unread,
Jul 17, 2008, 12:09:59 AM7/17/08
to ecma...@googlegroups.com
2008/7/16 氷の鋭 <solo...@gmail.com>:

一个更符合中文表达习惯的理解是将execution context翻译为"执行环境"。

--
Zhang, Zhen
http://www.lunaticsun.com ( in Chinese only )

Lich_Ray

unread,
Jul 17, 2008, 4:18:01 AM7/17/08
to ecma...@googlegroups.com

非常不幸,ECMA-262 的术语已经用全了,导致“环境”这个概念在前面的章节已经有其它的定义。

--
Ray Stinger, nickname Lich_Ray
God is in his heaven, all's right with the world.
-------------------------------------------------
let focus = 'computing' in where:
http://lichray.javaeye.com
let focus = 'computing' in here:
http://let-in.blogspot.com

Zhang Zhen

unread,
Jul 19, 2008, 3:30:29 AM7/19/08
to ecma...@googlegroups.com
2008/7/17 Lich_Ray <solo...@gmail.com>:

> 非常不幸,ECMA-262 的术语已经用全了,导致"环境"这个概念在前面的章节已经有其它的定义。

这个解释可以接受。我可以看到的可能引起冲突的词语是execution environment

另外, 8.7中有这样一段:

For example, the left-hand operand of an assignment is expected to produce a
reference. The behaviour of assignment could, instead, be explained
entirely in terms of a case analysis on
the syntactic form of the left-hand operand of an assignment operator,
but for one difficulty: function calls
are permitted to return references. This possibility is admitted
purely for the sake of host objects. No builtin
ECMAScript function defined by this specification returns a reference
and there is no provision for a
user-defined function to return a reference. (Another reason not to
use a syntactic case analysis is that it
would be lengthy and awkward, affecting many parts of the specification.)

你是这样翻译的

例如,赋值的左侧操作数被期望产生一个引用。作为替代,对于赋值运算符的左侧操作数,赋值的行为被用于解释其整个句法形式的套用分析,但这对于解释允许函数调用返回引用这个问题有些困难。我们纯粹是为了宿主对象而允许这种可能性。本规范中定义的非内置的
ECMAScript 函数返回一个引用,但这里没有为用户定义函数返回引用作准备。

实在是很晦涩,且有一处明显错误。我做了下修改:

例如,一次赋值操作的左操作数应当产生一个引用值。然而,通过在一个赋值操作符的左操作数的语法形式上进行事件分析,赋值行为完全能够被解释,但存在一则困境,即函数调用允许返回引用值。该允许仅限于宿主对象。本规范定义的所有ECMAScript内置函数不会返回引用值,且本规范没有提供任何能够使用户自定义函数返回引用值的方法。

我并非在吹毛求疵,我对你能够花费时间和精力翻译如此复杂的内容表示敬佩。并希望它能够趋于完美。

Lich_Ray

unread,
Jul 19, 2008, 6:35:55 AM7/19/08
to ecma...@googlegroups.com

很久以前的事了。确实现在看起来我自己也觉得汗颜。下一次提交的时候我会修正这个问题。

Reply all
Reply to author
Forward
0 new messages