Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit be82dfb

Browse files
committed
meta: merge node/master into node-chakracore/master
Merge 470bd39 as of 2018-01-11 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com>
2 parents 8374411 + 470bd39 commit be82dfb

File tree

4,163 files changed

+116438
-20563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,163 files changed

+116438
-20563
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ end_of_line = ignore
3636
trim_trailing_whitespace = ignore
3737
charset = ignore
3838

39-
[{test/fixtures,deps,tools/eslint,tools/gyp,tools/icu,tools/msvs}/**]
39+
[{test/fixtures,deps,tools/node_modules,tools/gyp,tools/icu,tools/msvs}/**]
4040
insert_final_newline = false

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test/addons/??_*
55
test/es-module/test-esm-dynamic-import.js
66
test/fixtures
77
test/message/esm_display_syntax_error.mjs
8-
tools/eslint
8+
tools/node_modules
99
tools/icu
1010
tools/remark-*
1111
node_modules

.eslintrc.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ env:
77
node: true
88
es6: true
99

10+
parser: babel-eslint
11+
1012
parserOptions:
11-
ecmaVersion: 2017
13+
sourceType: script
1214

1315
overrides:
1416
- files: ["doc/api/esm.md", "*.mjs", "test/es-module/test-esm-example-loader.js"]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.*
33
!deps/**/.*
44
!test/fixtures/**/.*
5-
!tools/eslint/**/.*
5+
!tools/node_modules/**/.*
66
!tools/doc/node_modules/**/.*
77
!.editorconfig
88
!.eslintignore

LICENSE

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ The externally maintained libraries used by Node.js are:
10611061
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10621062
"""
10631063

1064-
- ESLint, located at tools/eslint, is licensed as follows:
1064+
- ESLint, located at tools/node_modules/eslint, is licensed as follows:
10651065
"""
10661066
Copyright JS Foundation and other contributors, https://js.foundation
10671067

@@ -1084,6 +1084,32 @@ The externally maintained libraries used by Node.js are:
10841084
THE SOFTWARE.
10851085
"""
10861086

1087+
- babel-eslint, located at tools/node_modules/babel-eslint, is licensed as follows:
1088+
"""
1089+
Copyright (c) 2014-2016 Sebastian McKenzie <sebmck@gmail.com>
1090+
1091+
MIT License
1092+
1093+
Permission is hereby granted, free of charge, to any person obtaining
1094+
a copy of this software and associated documentation files (the
1095+
"Software"), to deal in the Software without restriction, including
1096+
without limitation the rights to use, copy, modify, merge, publish,
1097+
distribute, sublicense, and/or sell copies of the Software, and to
1098+
permit persons to whom the Software is furnished to do so, subject to
1099+
the following conditions:
1100+
1101+
The above copyright notice and this permission notice shall be
1102+
included in all copies or substantial portions of the Software.
1103+
1104+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1105+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1106+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1107+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1108+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1109+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1110+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1111+
"""
1112+
10871113
- gtest, located at deps/gtest, is licensed as follows:
10881114
"""
10891115
Copyright 2008, Google Inc.

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ COVTESTS ?= test-cov
1414
GTEST_FILTER ?= "*"
1515
GNUMAKEFLAGS += --no-print-directory
1616
GCOV ?= gcov
17+
PWD = $(CURDIR)
1718

1819
ifdef JOBS
1920
PARALLEL_ARGS = -j $(JOBS)
@@ -640,7 +641,7 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
640641
available-node = \
641642
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
642643
$(PWD)/$(NODE) $(1); \
643-
elif [ -x `which node` ] && [ -e `which node` ]; then \
644+
elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
644645
`which node` $(1); \
645646
else \
646647
echo "No available node, cannot run \"node $(1)\""; \
@@ -913,7 +914,7 @@ $(TARBALL): release-only $(NODE_EXE) doc
913914
$(RM) -r $(TARNAME)/deps/openssl/openssl/{doc,demos,test}
914915
$(RM) -r $(TARNAME)/deps/zlib/contrib # too big, unused
915916
$(RM) -r $(TARNAME)/.{editorconfig,git*,mailmap}
916-
$(RM) -r $(TARNAME)/tools/{eslint,eslint-rules,osx-pkg.pmdoc,pkgsrc,remark-cli,remark-preset-lint-node}
917+
$(RM) -r $(TARNAME)/tools/{eslint-rules,node_modules,osx-pkg.pmdoc,pkgsrc,remark-cli,remark-preset-lint-node}
917918
$(RM) -r $(TARNAME)/tools/{osx-*,license-builder.sh,cpplint.py}
918919
$(RM) -r $(TARNAME)/test*.tap
919920
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs $(RM)
@@ -1115,7 +1116,7 @@ lint-md:
11151116
endif
11161117

11171118
LINT_JS_TARGETS = benchmark doc lib test tools
1118-
LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \
1119+
LINT_JS_CMD = tools/node_modules/eslint/bin/eslint.js --cache \
11191120
--rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
11201121
$(LINT_JS_TARGETS)
11211122

@@ -1206,7 +1207,7 @@ cpplint: lint-cpp
12061207

12071208
.PHONY: lint
12081209
.PHONY: lint-ci
1209-
ifneq ("","$(wildcard tools/eslint/)")
1210+
ifneq ("","$(wildcard tools/node_modules/eslint/)")
12101211
lint: ## Run JS, C++, MD and doc linters.
12111212
@EXIT_STATUS=0 ; \
12121213
$(MAKE) lint-js || EXIT_STATUS=$$? ; \

doc/api/buffer.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@ endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns
15911591
little endian).
15921592

15931593
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1594-
the result should be considered undefined behavior.
1594+
the resulting behavior is undefined.
15951595

15961596
Examples:
15971597

@@ -1627,7 +1627,7 @@ endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns
16271627
little endian).
16281628

16291629
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1630-
the result should be considered undefined behavior.
1630+
the resulting behavior is undefined.
16311631

16321632
Examples:
16331633

@@ -1660,7 +1660,7 @@ added: v0.5.0
16601660
Reads a signed 8-bit integer from `buf` at the specified `offset`.
16611661

16621662
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1663-
the result should be considered undefined behavior.
1663+
the resulting behavior is undefined.
16641664

16651665
Integers read from a `Buffer` are interpreted as two's complement signed values.
16661666

@@ -1694,7 +1694,7 @@ the specified endian format (`readInt16BE()` returns big endian,
16941694
`readInt16LE()` returns little endian).
16951695

16961696
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1697-
the result should be considered undefined behavior.
1697+
the resulting behavior is undefined.
16981698

16991699
Integers read from a `Buffer` are interpreted as two's complement signed values.
17001700

@@ -1728,7 +1728,7 @@ the specified endian format (`readInt32BE()` returns big endian,
17281728
`readInt32LE()` returns little endian).
17291729

17301730
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1731-
the result should be considered undefined behavior.
1731+
the resulting behavior is undefined.
17321732

17331733
Integers read from a `Buffer` are interpreted as two's complement signed values.
17341734

@@ -1763,7 +1763,7 @@ and interprets the result as a two's complement signed value. Supports up to 48
17631763
bits of accuracy.
17641764

17651765
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1766-
the result should be considered undefined behavior.
1766+
the resulting behavior is undefined.
17671767

17681768
Examples:
17691769

@@ -1795,7 +1795,7 @@ added: v0.5.0
17951795
Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
17961796

17971797
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1798-
the result should be considered undefined behavior.
1798+
the resulting behavior is undefined.
17991799

18001800
Examples:
18011801

@@ -1827,7 +1827,7 @@ specified endian format (`readUInt16BE()` returns big endian, `readUInt16LE()`
18271827
returns little endian).
18281828

18291829
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1830-
the result should be considered undefined behavior.
1830+
the resulting behavior is undefined.
18311831

18321832
Examples:
18331833

@@ -1865,7 +1865,7 @@ specified endian format (`readUInt32BE()` returns big endian,
18651865
`readUInt32LE()` returns little endian).
18661866

18671867
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1868-
the result should be considered undefined behavior.
1868+
the resulting behavior is undefined.
18691869

18701870
Examples:
18711871

@@ -1898,7 +1898,7 @@ and interprets the result as an unsigned integer. Supports up to 48
18981898
bits of accuracy.
18991899

19001900
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
1901-
the result should be considered undefined behavior.
1901+
the resulting behavior is undefined.
19021902

19031903
Examples:
19041904

@@ -2236,7 +2236,7 @@ endian). `value` *should* be a valid 64-bit double. Behavior is undefined when
22362236
`value` is anything other than a 64-bit double.
22372237

22382238
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2239-
the end of `buf`, but the result should be considered undefined behavior.
2239+
the end of `buf`, but the resulting behavior is undefined.
22402240

22412241
Examples:
22422242

@@ -2271,7 +2271,7 @@ endian). `value` *should* be a valid 32-bit float. Behavior is undefined when
22712271
`value` is anything other than a 32-bit float.
22722272

22732273
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2274-
the end of `buf`, but the result should be considered undefined behavior.
2274+
the end of `buf`, but the resulting behavior is undefined.
22752275

22762276
Examples:
22772277

@@ -2304,7 +2304,7 @@ signed 8-bit integer. Behavior is undefined when `value` is anything other than
23042304
a signed 8-bit integer.
23052305

23062306
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2307-
the end of `buf`, but the result should be considered undefined behavior.
2307+
the end of `buf`, but the resulting behavior is undefined.
23082308

23092309
`value` is interpreted and written as a two's complement signed integer.
23102310

@@ -2337,7 +2337,7 @@ endian). `value` *should* be a valid signed 16-bit integer. Behavior is undefine
23372337
when `value` is anything other than a signed 16-bit integer.
23382338

23392339
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2340-
the end of `buf`, but the result should be considered undefined behavior.
2340+
the end of `buf`, but the resulting behavior is undefined.
23412341

23422342
`value` is interpreted and written as a two's complement signed integer.
23432343

@@ -2370,7 +2370,7 @@ endian). `value` *should* be a valid signed 32-bit integer. Behavior is undefine
23702370
when `value` is anything other than a signed 32-bit integer.
23712371

23722372
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2373-
the end of `buf`, but the result should be considered undefined behavior.
2373+
the end of `buf`, but the resulting behavior is undefined.
23742374

23752375
`value` is interpreted and written as a two's complement signed integer.
23762376

@@ -2404,7 +2404,7 @@ Supports up to 48 bits of accuracy. Behavior is undefined when `value` is
24042404
anything other than a signed integer.
24052405

24062406
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2407-
the end of `buf`, but the result should be considered undefined behavior.
2407+
the end of `buf`, but the resulting behavior is undefined.
24082408

24092409
Examples:
24102410

@@ -2437,7 +2437,7 @@ valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
24372437
other than an unsigned 8-bit integer.
24382438

24392439
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2440-
the end of `buf`, but the result should be considered undefined behavior.
2440+
the end of `buf`, but the resulting behavior is undefined.
24412441

24422442
Examples:
24432443

@@ -2470,7 +2470,7 @@ endian). `value` should be a valid unsigned 16-bit integer. Behavior is
24702470
undefined when `value` is anything other than an unsigned 16-bit integer.
24712471

24722472
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2473-
the end of `buf`, but the result should be considered undefined behavior.
2473+
the end of `buf`, but the resulting behavior is undefined.
24742474

24752475
Examples:
24762476

@@ -2507,7 +2507,7 @@ endian). `value` should be a valid unsigned 32-bit integer. Behavior is
25072507
undefined when `value` is anything other than an unsigned 32-bit integer.
25082508

25092509
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2510-
the end of `buf`, but the result should be considered undefined behavior.
2510+
the end of `buf`, but the resulting behavior is undefined.
25112511

25122512
Examples:
25132513

@@ -2543,7 +2543,7 @@ Supports up to 48 bits of accuracy. Behavior is undefined when `value` is
25432543
anything other than an unsigned integer.
25442544

25452545
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
2546-
the end of `buf`, but the result should be considered undefined behavior.
2546+
the end of `buf`, but the resulting behavior is undefined.
25472547

25482548
Examples:
25492549

doc/api/stream.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,31 @@ readable stream will release any internal resources.
11651165
Implementors should not override this method, but instead implement
11661166
[`readable._destroy`][readable-_destroy].
11671167

1168+
##### readable[@@asyncIterator]
1169+
<!-- YAML
1170+
added: REPLACEME
1171+
-->
1172+
1173+
> Stability: 1 - Experimental
1174+
1175+
Returns an [AsyncIterator][async-iterator] to fully consume the stream.
1176+
1177+
```js
1178+
async function print(readable) {
1179+
readable.setEncoding('utf8');
1180+
let data = '';
1181+
for await (const k of readable) {
1182+
data += k;
1183+
}
1184+
console.log(data);
1185+
}
1186+
1187+
print(fs.createReadStream('file')).catch(console.log);
1188+
```
1189+
1190+
If the loop terminates with a `break` or a `throw`, the stream will be destroyed.
1191+
In other terms, iterating over a stream will consume the stream fully.
1192+
11681193
### Duplex and Transform Streams
11691194

11701195
#### Class: stream.Duplex
@@ -2328,3 +2353,4 @@ contain multi-byte characters.
23282353
[readable-destroy]: #stream_readable_destroy_error
23292354
[writable-_destroy]: #stream_writable_destroy_err_callback
23302355
[writable-destroy]: #stream_writable_destroy_error
2356+
[async-iterator]: https://github.com/tc39/proposal-async-iteration

0 commit comments

Comments
 (0)