From 8b3d0a575d91f13c8b794485e79ce00bb4a6c853 Mon Sep 17 00:00:00 2001 From: Ruan Yifeng Date: Sun, 21 Dec 2014 22:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9docs/class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/class.md | 2 ++ docs/generator.md | 2 +- docs/reference.md | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/class.md b/docs/class.md index d94472d..f8832e9 100644 --- a/docs/class.md +++ b/docs/class.md @@ -71,6 +71,8 @@ class ColorPoint extends Point { 上面代码中,constructor方法和toString方法之中,都出现了super关键字,它指代父类的同名方法。在constructor方法内,super指代父类的constructor方法;在toString方法内,super指代父类的toString方法。 +有一个地方,需要注意。类和模块的内部,默认就是严格模式,所以不需要使用`use strict`指定运行模式。考虑到未来所有的代码,其实都是运行在模块之中,所以ES6实际上把整个语言升级到了严格模式。 + ## Module的基本用法 JavaScript没有模块(module)体系,无法将一个大程序拆分成互相依赖的小文件,再用简单的方法拼装起来。其他语言都有这项功能,比如Ruby的require、Python的import,甚至就连CSS都有@import,但是JavaScript任何这方面的支持都没有,这对开发大型的、复杂的项目形成了巨大障碍。 diff --git a/docs/generator.md b/docs/generator.md index f0d762e..686a7d0 100644 --- a/docs/generator.md +++ b/docs/generator.md @@ -347,7 +347,7 @@ function doStuff() { ``` -上面的函数,可以用一模一样的for...of循环处理!两相一比较,就不难看出Generator的这种用法,就是让数据或者操作,可以像数组那样处理。 +上面的函数,可以用一模一样的for...of循环处理!两相一比较,就不难看出Generator使得数据或者操作,具备了类似数组的接口。 ## throw方法 diff --git a/docs/reference.md b/docs/reference.md index 879fd3b..b3bfe2d 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -4,6 +4,7 @@ - [ECMAScript 6 Language Specification](http://people.mozilla.org/~jorendorff/es6-draft.html): 语言规格草案 - [harmony:proposals](http://wiki.ecmascript.org/doku.php?id=harmony:proposals): ES6的各种提案 +- [Draft Specification for ES.next (Ecma-262 Edition 6)](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts): ES6草案各版本之间的变动 ## 综合介绍