Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge tc39/ecma262 into zh-hans #61

Open
wants to merge 633 commits into
base: master
Choose a base branch
from
Open

docs(en): merge tc39/ecma262 into zh-hans #61

wants to merge 633 commits into from

Conversation

QC-L
Copy link
Member

@QC-L QC-L commented Oct 2, 2020

此 PR 自动生成。

合并 tc39/ecma262 的修改至本仓库

以下文件存在冲突,可能需要重新翻译:

请解决所有冲突后提交到此 pull request,可直接在 Github 修改、切换到 sync-464b3409 分支进行修改或者使用 Github Desktop 拉取此 pr 修改并提交。

禁止使用 Squash Merge 来合并此 Pull Request!

使用该操作会导致上游仓库的内容丢失,并致使下一次合并产生冲突。

jmdyck and others added 30 commits January 31, 2020 23:06
... to reserve that form for aliases whose value is
a source text (sequence of Unicode code points).
(It's only meaningful to parse something as an ES |Script|
if that thing is ES source text (sequence of Unicode code points),
not an ES String value.)
I.e., first have a step where we determine the text that we're going to parse
(which, for the _BMP_ = *true* case, takes a couple sentences to describe),
and *then* have the step where we parse it.
This change updates the wording of the first part of the “To make a pull
request” guidance in the CONTRIBUTING.md file to read:

> To make a pull request (PR), fork the ecma262 repository, apply
> changes to the `spec.html` file, and upload it ...

Without this change, the text lacks the word “repository" after
“ecma262” and the word “file” after “spec.html”.
tc39#1460)

Closes tc39#1453.

* Defines ordinary objects as having the ordinary internal methods, and exotic objects as not having the ordinary internal methods.

* Introduces MakeBasicObject, which now is the only source of object creation, centralizing the undefined phrase "a newly created object" or "newly created X exotic object" into one location.

* Introduces explicit definitions for every type of exotic object in terms of how they override the internal methods. This makes phrases like "x is an Array exotic object" well-defined.

* Renames ObjectCreate to OrdinaryObjectCreate, and clarifies how it should be used.

* Fixes immutable prototype exotic objects to not inaccurately state that they always have default internal methods besides [[SetPrototypeOf]]; this is not the case for web platform objects, for example. This involved then expanding the definition of %ObjectPrototype% a bit to be more explicit about its internal slots and methods.

* Improves missing or contradictory internal slot installation, e.g. the introduction for function objects said they had "the same internal slots" as other ordinary objects, but FunctionAllocate installed a list of slots that was missing [[Prototype]] and [[Extensible]].

* Deduplicates setting [[Extensible]] to its default true value.

* Clarifies with a note that CreateUnmappedArgumentsObject does not create an exotic object, despite being in the "Arguments Exotic Objects" clause.

* Slightly reduces the coupling between IntegerIndexedObjectCreate and CreateTypedArray by changing how arguments are passed.* Uses the phrase "bound function exotic object" uniformly instead of sometimes "bound function" or "bound function object".

Co-authored-by: Domenic Denicola <[email protected]>
Co-authored-by: Shu-yu Guo <[email protected]>
Fixes tc39#1637.

This only has an observable impact on `Atomics.store`.
The spec was inconsistent on whether _F_.[[SourceText]] was
a String or a source text (sequence of Unicode code points).

This commit picks the latter.

Resolves tc39#1458.
The phrase "the Number value for X" is only defined on mathematical values,
but `_prim_` is a BigInt value here.
So we have to take the mathematical value of `_prim_`
before applying "the Number value for ..."
 - insert space before paren in clause heading
 - eliminate grammatical parameters from non-defining production
 - Add 4 <emu-prodref> elements to Annex A
 - tweak syntax in algorithms
 - eliminate accidental ambiguity in Punctuator
      PR tc39#1646 introduced an ambiguity to the lexical grammar:
      Punctuator derives OtherPunctuator in two different ways --
      directly, and indirectly via OptionalChainingPunctuator.

      It doesn't make sense for OptionalChainingPunctuator to derive OtherPunctuator,
      so I've eliminated that alternative.
 - minor grammar refactoring re Punctuator
      Move the Punctuator production back to its former position.
      (Grammars are generally written top-down.)
 - Fix a 'use' production for AsyncConciseBody to match the new defining production
 - Add an <emu-prodref> for ExpressionBody to Annex A
About half of the changes delete an extraneous space
at the end of a lookahead annotation. The rest are misc.
None of them will make a visible difference in the rendered version.
…ons (tc39#1301)

 - CoveredCallExpression: change production
      When an SDO is applied to a Parse Node, the appropriate definition of the SDO
      is the one for the production of which the Parse Node is an instance
      (ignoring the complication of chain productions).

      The only invocation of CoveredCallExpression
      is on a |CoverCallExpressionAndAsyncArrowHead|,
      so we expect CoveredCallExpression to be defined on
          CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
      not
          CallExpression : CoverCallExpressionAndAsyncArrowHead
 - BoundNames: add def for ObjectBindingPattern
      BoundNames was missing a definition for
          ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}`
 - ContainsExpression: add a few defs
      ContainsExpression was missing definitions for:
          ObjectBindingPattern : `{` BindingRestProperty `}`
          ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}`
          ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
 - ExpectedArgumentCount: add a few defs
      ExpectedArgumentCount was missing definitions for:
          FormalParameters : FunctionRestParameter
          FormalParameterList : FormalParameter
          ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
 - CoveredFormalsList: add a def
      CoveredFormalsList was missing a definition for
          CoverParenthesizedExpressionAndArrowParameterList : `(` Expression `,` `)`
 - IteratorBindingInitialization: add a def
      IteratorBindingInitialization was missing a definition for:
          ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
 - HasCallInTailPosition: add a few defs
      HasCallInTailPosition was missing definitions for the 3
          IterationStatement : `for` `await` `(` productions.
 - define 3 SDOs on empty FunctionStatementList
      specifically:
       - ContainsDuplicateLabels
       - ContainsUndefinedBreakTarget
       - ContainsUndefinedContinueTarget
 - MV: add def for Hex4Digits
      PR tc39#984 added a reference to "the MV of |Hex4Digits|"
      (in the definition of CharacterValue)
      but didn't add a definition for it.

      Extract one from the definition for "the SV of |Hex4Digits|".
 - eliminate unsupported "SV of |SourceCharacter|"
      We have rules that say the TRV of something is:
       - the SV of the |SourceCharacter| that is that single code point; or
       - the SV of the |SourceCharacter| that is that |HexDigit|.

      but there's no definition for the SV of |SourceCharacter|.

      We could add such a definition, except that these usages are already odd,
      in that they introduce a |SourceCharacter| nonterminal when there isn't one
      in the parse tree. So instead, fix that oddity by eliminating the references
      to SV and |SourceCharacter|.

      And since I'm in the neighborhood,
         The TRV of a |HexDigit| ...
      is weird. No other SDO rule is written that way. Change it to:
         The TRV of <emu-grammar>HexDigit :: ....</emu-grammar> ...
This change updates the wording of the first sentence in the "About this
Specification" section to read:

> This document at https://tc39.es/ecma262/ is the most accurate and >
up-to-date ECMAScript specification.

Without this change, it just reads “the most accurate up-to-date”,
without the word “and”.
…ression productions potentially covering an AssignmentPattern (tc39#1658)

* Add two missing early error rules  “All Early Error rules for |AssignmentPattern| ... are applied to the |AssignmentPattern| covered by ...”

* Removes an early error rule “... derives a phrase that would produce a Syntax Error ...”, because it is implied by the previous rule.
... for consistency.
(The vast majority of these are in Annex A.)
…1597)

This layering change retains the PendingJob concept but sends
PendingJob records off to the host to be dispatched at the appropriate
time, replacing the RunJobs algorithm. The change is expected to
help specify the interaction between Promises, WeakRefs and the Web
more precisely, while maintaining all current invariants.

Co-authored-by: Domenic Denicola <[email protected]>
Co-authored-by: Daniel Ehrenberg <[email protected]>
Co-authored-by: Shu-yu Guo <[email protected]>
bakkot and others added 30 commits September 1, 2020 22:34
- Math.atan2: Refer to parameters in correct order.

- Math.fround: Call ToNumber on _x_.
    Insert "or" into a condition.

- Math.{hypot,max,min}: Accept zero or more arguments.
    (max and min have done so since ES3.
    hypot has done so since it was introduced in ES6.)

- Math.round: Fix typos: "_x_" -> "_n_"
- BreakableStatement
- WithStatement
- LabelledStatement
- `else` branch in IfStatement
解决部分冲突,新增英文部分暂未翻译。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.