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

Commit

Permalink
meta: merge node/master into node-chakracore/master
Browse files Browse the repository at this point in the history
Merge 088bba3 as of 2017-11-23
This commit was automatically generated. For any problems, please contact jackhorton

Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
  • Loading branch information
chakrabot authored and kfarnung committed Dec 1, 2017
2 parents e60e469 + 088bba3 commit 223a260
Show file tree
Hide file tree
Showing 83 changed files with 542 additions and 404 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test/addons/??_*
test/fixtures
tools/eslint
tools/icu
tools/remark-*
node_modules
benchmark/tmp
doc/**/*.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ node_g
icu_config.gypi
.eslintcache
node_trace.*.log
coverage/

/out

Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Michael Dawson <michael_dawson@ca.ibm.com> <mdawson@devrus.com>
Michael Wilber <gcr@sneakygcr.net>
Michaël Zasso <targos@protonmail.com> <mic.besace@gmail.com>
Michael-Rainabba Richardson <rainabba@gmail.com> rainabba <rainabba@gmail.com>
Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Micheil Smith <micheil@brandedcode.com> <micheil@yettobebranded.net>
Micleusanu Nicu <micnic90@gmail.com>
Miguel Angel Asencio Hurtado <maasencioh@gmail.com> maasencioh <maasencioh@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ Salman Aljammaz <s@0x65.net>
Thomas Reggi <thomas@reggi.com>
Laurent Fortin <laurent.fortin@gmail.com>
Fabio Oliveira <fabio.an.oliveira@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com>
Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Johann Hofmann <git@johann-hofmann.com>
Charles Rudolph <charles.rudolph@originate.com>
Dave Eddy <dave@daveeddy.com>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ coverage-clean:
$(RM) -r node_modules
$(RM) -r gcovr testing
$(RM) -r out/$(BUILDTYPE)/.coverage
$(RM) -r .cov_tmp coverage
$(RM) -r .cov_tmp
$(RM) out/$(BUILDTYPE)/obj.target/node/{src,gen}/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node/{src,gen}/*.gcno
Expand Down
2 changes: 1 addition & 1 deletion benchmark/fs/read-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function main(conf) {
throw new Error(`invalid encodingType: ${encodingType}`);
}

makeFile(runTest);
makeFile();
}

function runTest() {
Expand Down
3 changes: 3 additions & 0 deletions doc/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
* Function returns should use the following format:
* <code>* Returns: {type|type2} Optional description.</code>
* E.g. <code>* Returns: {AsyncHook} A reference to `asyncHook`.</code>
* Use official styling for capitalization in products and projects.
* OK: JavaScript, Google's V8
* NOT OK: Javascript, Google's v8

[Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash
[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types
Expand Down
1 change: 1 addition & 0 deletions doc/api/all.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--lint disable prohibited-strings-->
@include documentation
@include synopsis
@include assert
Expand Down
49 changes: 16 additions & 33 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
The `assert` module provides a simple set of assertion tests that can be used to
test invariants.

For more information about the used equality comparisons see
[MDN's guide on equality comparisons and sameness][mdn-equality-guide].

## assert(value[, message])
<!-- YAML
added: v0.5.9
Expand Down Expand Up @@ -531,13 +534,16 @@ parameter is an instance of an `Error` then it will be thrown instead of the
## assert.notStrictEqual(actual, expected[, message])
<!-- YAML
added: v0.1.21
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/17003
description: Used comparison changed from Strict Equality to `Object.is()`
-->
* `actual` {any}
* `expected` {any}
* `message` {any}

Tests strict inequality as determined by the [Strict Equality Comparison][]
( `!==` ).
Tests equality determined by the [`Object.is()`][] comparison.

```js
const assert = require('assert');
Expand All @@ -546,7 +552,7 @@ assert.notStrictEqual(1, 2);
// OK

assert.notStrictEqual(1, 1);
// AssertionError: 1 !== 1
// AssertionError: 1 notStrictEqual 1

assert.notStrictEqual(1, '1');
// OK
Expand Down Expand Up @@ -592,25 +598,28 @@ assert.ok(false, 'it\'s false');
## assert.strictEqual(actual, expected[, message])
<!-- YAML
added: v0.1.21
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/17003
description: Used comparison changed from Strict Equality to `Object.is()`
-->
* `actual` {any}
* `expected` {any}
* `message` {any}

Tests strict equality as determined by the [Strict Equality Comparison][]
( `===` ).
Tests equality determined by the [`Object.is()`][] comparison.

```js
const assert = require('assert');

assert.strictEqual(1, 2);
// AssertionError: 1 === 2
// AssertionError: 1 strictEqual 2

assert.strictEqual(1, 1);
// OK

assert.strictEqual(1, '1');
// AssertionError: 1 === '1'
// AssertionError: 1 strictEqual '1'
```

If the values are not strictly equal, an `AssertionError` is thrown with a
Expand Down Expand Up @@ -690,32 +699,6 @@ assert.throws(myFunction, 'missing foo', 'did not throw with expected message');
assert.throws(myFunction, /missing foo/, 'did not throw with expected message');
```

## Caveats

For the following cases, consider using ES2015 [`Object.is()`][],
which uses the [SameValueZero][] comparison.

```js
const a = 0;
const b = -a;
assert.notStrictEqual(a, b);
// AssertionError: 0 !== -0
// Strict Equality Comparison doesn't distinguish between -0 and +0...
assert(!Object.is(a, b));
// but Object.is() does!

const str1 = 'foo';
const str2 = 'foo';
assert.strictEqual(str1 / 1, str2 / 1);
// AssertionError: NaN === NaN
// Strict Equality Comparison can't be used to check NaN...
assert(Object.is(str1 / 1, str2 / 1));
// but Object.is() can!
```

For more information, see
[MDN's guide on equality comparisons and sameness][mdn-equality-guide].

[`Error.captureStackTrace`]: errors.html#errors_error_capturestacktrace_targetobject_constructoropt
[`Map`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map
[`Object.is()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
Expand Down
32 changes: 17 additions & 15 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ differently based on what arguments are provided:
memory.
* Passing a string, array, or `Buffer` as the first argument copies the
passed object's data into the `Buffer`.
* Passing an [`ArrayBuffer`] returns a `Buffer` that shares allocated memory with
the given [`ArrayBuffer`].
* Passing an [`ArrayBuffer`] or a [`SharedArrayBuffer`] returns a `Buffer` that
shares allocated memory with the given array buffer.

Because the behavior of `new Buffer()` changes significantly based on the type
of value passed as the first argument, applications that do not properly
Expand Down Expand Up @@ -361,16 +361,16 @@ changes:
> [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`]
> instead.
* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a
[`TypedArray`].
* `arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An [`ArrayBuffer`],
[`SharedArrayBuffer`] or the `.buffer` property of a [`TypedArray`].
* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`
* `length` {integer} Number of bytes to expose.
**Default:** `arrayBuffer.length - byteOffset`

This creates a view of the [`ArrayBuffer`] without copying the underlying
memory. For example, when passed a reference to the `.buffer` property of a
[`TypedArray`] instance, the newly created `Buffer` will share the same
allocated memory as the [`TypedArray`].
This creates a view of the [`ArrayBuffer`] or [`SharedArrayBuffer`] without
copying the underlying memory. For example, when passed a reference to the
`.buffer` property of a [`TypedArray`] instance, the newly created `Buffer` will
share the same allocated memory as the [`TypedArray`].

The optional `byteOffset` and `length` arguments specify a memory range within
the `arrayBuffer` that will be shared by the `Buffer`.
Expand Down Expand Up @@ -679,8 +679,8 @@ changes:
or `ArrayBuffer`.
-->

* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer} A value to
calculate the length of.
* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer|SharedArrayBuffer} A
value to calculate the length of.
* `encoding` {string} If `string` is a string, this is its encoding.
**Default:** `'utf8'`
* Returns: {integer} The number of bytes contained within `string`.
Expand All @@ -703,8 +703,8 @@ console.log(`${str}: ${str.length} characters, ` +
`${Buffer.byteLength(str, 'utf8')} bytes`);
```

When `string` is a `Buffer`/[`DataView`]/[`TypedArray`]/[`ArrayBuffer`], the
actual byte length is returned.
When `string` is a `Buffer`/[`DataView`]/[`TypedArray`]/[`ArrayBuffer`]/
[`SharedArrayBuffer`], the actual byte length is returned.

### Class Method: Buffer.compare(buf1, buf2)
<!-- YAML
Expand Down Expand Up @@ -807,8 +807,8 @@ A `TypeError` will be thrown if `array` is not an `Array`.
added: v5.10.0
-->

* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a
[`TypedArray`].
* `arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An [`ArrayBuffer`],
[`SharedArrayBuffer`], or the `.buffer` property of a [`TypedArray`].
* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`
* `length` {integer} Number of bytes to expose.
**Default:** `arrayBuffer.length - byteOffset`
Expand Down Expand Up @@ -852,7 +852,8 @@ const buf = Buffer.from(ab, 0, 2);
console.log(buf.length);
```

A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`].
A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`] or a
[`SharedArrayBuffer`].

### Class Method: Buffer.from(buffer)
<!-- YAML
Expand Down Expand Up @@ -2712,6 +2713,7 @@ This value may depend on the JS engine that is being used.
[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
[`RangeError`]: errors.html#errors_class_rangeerror
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
[`String#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
[`String#lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
Expand Down
99 changes: 99 additions & 0 deletions doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ undefined
### console.debug(data[, ...args])
<!-- YAML
added: v8.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/17033
description: "`console.debug` is now an alias for `console.log`."
-->
* `data` {any}
* `...args` {any}
Expand Down Expand Up @@ -426,15 +430,110 @@ added: v0.1.100

The `console.warn()` function is an alias for [`console.error()`][].

## Inspector only methods
The following methods are exposed by the V8 engine in the general API but do
not display anything unless used in conjunction with the [inspector][]
(`--inspect` flag).

### console.dirxml(object)
<!-- YAML
added: v8.0.0
-->
* `object` {string}

This method does not display anything unless used in the inspector. The
`console.dirxml()` method displays in `stdout` an XML interactive tree
representation of the descendants of the specified `object` if possible, or the
JavaScript representation if not. Calling `console.dirxml()` on an HTML or XML
element is equivalent to calling `console.log()`.

### console.markTimeline(label)
<!-- YAML
added: v8.0.0
-->
* `label` {string} Defaults to `'default'`.

This method does not display anything unless used in the inspector. The
`console.markTimeline()` method is the deprecated form of [`console.timeStamp()`][].

### console.profile([label])
<!-- YAML
added: v8.0.0
-->
* `label` {string}

This method does not display anything unless used in the inspector. The
`console.profile()` method starts a JavaScript CPU profile with an optional
label until [`console.profileEnd()`][] is called. The profile is then added to
the **Profile** panel of the inspector.
```js
console.profile('MyLabel');
// Some code
console.profileEnd();
// Adds the profile 'MyLabel' to the Profiles panel of the inspector.
```

### console.profileEnd()
<!-- YAML
added: v8.0.0
-->

This method does not display anything unless used in the inspector. Stops the
current JavaScript CPU profiling session if one has been started and prints
the report to the **Profiles** panel of the inspector. See
[`console.profile()`][] for an example.

### console.table(array[, columns])
<!-- YAML
added: v8.0.0
-->
* `array` {Array|Object}
* `columns` {Array}

This method does not display anything unless used in the inspector. Prints to
`stdout` the array `array` formatted as a table.

### console.timeStamp([label])
<!-- YAML
added: v8.0.0
-->
* `label` {string}

This method does not display anything unless used in the inspector. The
`console.timeStamp()` method adds an event with the label `label` to the
**Timeline** panel of the inspector.

### console.timeline([label])
<!-- YAML
added: v8.0.0
-->
* `label` {string} Defaults to `'default'`.

This method does not display anything unless used in the inspector. The
`console.timeline()` method is the deprecated form of [`console.time()`][].

### console.timelineEnd([label])
<!-- YAML
added: v8.0.0
-->
* `label` {string} Defaults to `'default'`.

This method does not display anything unless used in the inspector. The
`console.timelineEnd()` method is the deprecated form of [`console.timeEnd()`][].

[`console.error()`]: #console_console_error_data_args
[`console.group()`]: #console_console_group_label
[`console.log()`]: #console_console_log_data_args
[`console.profile()`]: #console_console_profile_label
[`console.profileEnd()`]: #console_console_profileend
[`console.time()`]: #console_console_time_label
[`console.timeEnd()`]: #console_console_timeend_label
[`console.timeStamp()`]: #console_console_timestamp_label
[`process.stderr`]: process.html#process_process_stderr
[`process.stdout`]: process.html#process_process_stdout
[`util.format()`]: util.html#util_util_format_format_args
[`util.inspect()`]: util.html#util_util_inspect_object_options
[customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors
[inspector]: debugger.html
[note on process I/O]: process.html#process_a_note_on_process_i_o
[web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert
Loading

0 comments on commit 223a260

Please sign in to comment.