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

[v6.x backport] Repl: do not consider ... as a REPL command #14915

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
2a9e9d4
tools: use no-use-before-define ESLint rule
vsemozhetbyt Jul 1, 2017
7b53be0
test: fix flaky test-https-set-timeout-server
Trott Jul 8, 2017
d35e5c7
test: fix flaky http(s)-set-server-timeout tests
Trott Jul 20, 2017
194836f
v8: handle proxy objects in MakeMirror(), v1
bnoordhuis Jul 24, 2017
5a93c16
v8: handle proxy objects in MakeMirror(), v2
bnoordhuis Jul 24, 2017
ae3e7be
v8: fix RegExp nits in v8_prof_polyfill.js
vsemozhetbyt Jun 15, 2017
c96e938
tools: update to ESLint 4.1.0
Trott Jun 24, 2017
58e0c5c
tools: add script to update ESLint
Trott Jun 24, 2017
05ee559
tools: update to ESLint 4.1.1
Trott Jun 27, 2017
175d46e
test: skip test-fs-readdir-ucs2 if no support
Trott Jul 1, 2017
9320db0
tools: remove align-multiline-assignment lint rule
Trott Jul 5, 2017
e8c0e0f
lib: use consistent indentation for ternaries
Trott Jul 5, 2017
5e6c711
lib: remove excess indentation
Trott Jul 5, 2017
a75ba80
lib: normalize indentation in parentheses
Trott Jul 7, 2017
5ef17b7
lib: update indentation of ternaries
Trott Jul 15, 2017
b0f8bc9
test: adjust indentation for stricter linting
Trott Jul 25, 2017
5f7827d
doc: fix indentation issues in sample code
Trott Jun 27, 2017
f46e14c
tools: remove legacy indentation linting
Trott Aug 15, 2017
e0f8b18
src: remove GTEST_DONT_DEFINE_ASSERT_EQ in util.h
danbev Apr 25, 2017
44d3047
test: simplify test skipping
vsemozhetbyt Jun 30, 2017
162bc81
build,windows: implement PEP514 python detection
refack Jun 24, 2017
970fe59
build,windows: restore DISTTYPEDIR
refack Jun 28, 2017
1b9563a
build,win: fix python detection script
jasongin Jul 31, 2017
124d5e1
tools: generate template literal for addon tests
Trott Jul 5, 2017
f868b75
doc,test: fs - reserved characters under win32
XadillaX Jul 4, 2017
7a1ff59
doc: fix mistake in http.md
galeo Jul 7, 2017
6624a02
doc: note 'resize' event conditions on Windows
Dean-Coakley Jun 9, 2017
584f0f4
doc: correct stream Duplex allowHalfOpen doc
Trott Jul 7, 2017
5c3fd35
test: add get/set effective uid/gid tests
evanlucas Jul 5, 2017
3bd0c7c
test: remove common.noop
Trott May 4, 2017
ec68f07
tools: update ESLint to 4.2.0
Trott Aug 16, 2017
f395b48
tools: update package.json `engine` field
strugee Jul 12, 2017
98466c5
doc: update umask for clarity
jsumners Jul 11, 2017
b646c2a
benchmark: fix typo in inspect-proxy
vsemozhetbyt Jul 14, 2017
b89e806
test: fix flaky test-net-can-reset-timeout
Trott Jul 15, 2017
ed6d4f0
test: check complete error message
fraserxu Jul 16, 2017
b64fe2e
test: use regular expression to match error msg
Amunu Jul 16, 2017
a71e23a
test: use regluar expression in vm test
AkiraXue Jul 16, 2017
49312cb
test: use regexp to confir error message
bangwu Jul 16, 2017
d462267
test: simplify string concatenation
jiangplus Jul 16, 2017
a4281c6
test: use template literal for string concat
whatwewant Jul 16, 2017
f84a7a6
test: use regex error checks in test-util-format
superwoods Jul 16, 2017
41e4e46
doc: move LTS README link to increase prominence
gibfahn Jul 16, 2017
5303db7
http: OutgoingMessage change writable after end
Kasher Jun 30, 2017
01d7d30
gyp: implement LD/LDXX for ninja and FIPS
sam-github Jul 13, 2017
2039435
test: check error with regex in test-signal-safety
shaman2009 Jul 16, 2017
3148bc7
test: use regex error check in test-crypto-random
f48vj Jul 16, 2017
1e10f9f
test: fix error handling test-http-full-response
Trott Jul 15, 2017
3be54c8
test: replace concatenation with template literals
csvwolf Jul 16, 2017
1a8bf8a
doc,stream: _transform happens one at a time
mcollina Jul 17, 2017
1703871
doc: replace dead link in v8 module
drboyer Jul 19, 2017
028f650
docs: add note about fs.rmdir()
Oleksandr-Kushchak-i2 Jul 17, 2017
49662f3
build,tools: do not force codesign prefix
evanlucas Jul 12, 2017
1209832
build: codesign tarball binary on macOS
evanlucas Jul 12, 2017
bc1d4c5
test: use path.join for long path concatenation
jankjn Jul 16, 2017
b21a42d
doc: add XadillaX to collaborators
XadillaX Jul 20, 2017
9aa4a5b
test: replace string concatenation with template
Jul 16, 2017
6e08ae0
test: replace concatenation with template literals
leizongmin Jul 16, 2017
c3bb07c
doc: describe labelling process for backports
addaleax Apr 15, 2017
6e65501
deps: cherry-pick 18ea996 from c-ares upstream
addaleax Jul 15, 2017
ad86c26
doc: update experimental status to reflect use
jasnell Apr 28, 2017
fd5d6c9
test: replace concatenation with template literal
HSUCHING Jul 16, 2017
cdcec0c
test: replace concatenation with template literal
rockcoder23 Jul 16, 2017
b9a5253
test: fix flaky test-force-repl
Trott Jul 23, 2017
baa11a1
test: improve error logging for inspector test
Trott Jul 27, 2017
7c542ab
buffer: remove a wrongly added attribute specifier
hujiajie Jul 24, 2017
1232d9d
linkedlist: correct grammar in comments
alexbostock Jul 30, 2017
9132f37
test: add check on an addon that does not register
ezequielgarcia Jun 28, 2017
435ab00
test: refactor test-vm-new-script-new-context
Trott Jul 29, 2017
014a9bd
test: refactor test-domain-abort-on-uncaught
Trott Jul 30, 2017
071018e
src: use existing strings over creating new ones
addaleax Aug 2, 2017
403c465
doc: add gabrielschulhof to collaborators
Aug 8, 2017
567acf6
tools: update to ESLint 4.3.0
Trott Jul 21, 2017
1e07864
repl: do not consider `...` as a REPL command
shivanth Jul 23, 2017
4aa1af7
Revert as per comments
shivanth Aug 22, 2017
9b28ab8
fix else position
shivanth Aug 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 10 additions & 13 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ rules:
no-delete-var: 2
no-undef: 2
no-unused-vars: [2, {args: none}]
no-use-before-define: [2, {classes: true,
functions: false,
variables: false}]

# Node.js and CommonJS
# http://eslint.org/docs/rules/#nodejs-and-commonjs
Expand Down Expand Up @@ -96,18 +99,13 @@ rules:
func-call-spacing: 2
func-name-matching: 2
func-style: [2, declaration, {allowArrowFunctions: true}]
# indent: [2, 2, {ArrayExpression: first,
# CallExpression: {arguments: first},
# FunctionDeclaration: {parameters: first},
# FunctionExpression: {parameters: first},
# MemberExpression: off,
# ObjectExpression: first,
# SwitchCase: 1}]
indent-legacy: [2, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
MemberExpression: 1,
ObjectExpression: first,
SwitchCase: 1}]
indent: [2, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first},
MemberExpression: off,
ObjectExpression: first,
SwitchCase: 1}]
key-spacing: [2, {mode: minimum}]
keyword-spacing: 2
linebreak-style: [2, unix]
Expand Down Expand Up @@ -163,7 +161,6 @@ rules:
template-curly-spacing: 2

# Custom rules in tools/eslint-rules
align-multiline-assignment: 2
assert-throws-arguments: [2, { requireTwo: true }]

# Global scoped method and vars
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ $(PKG): release-only
--release-urlbase=$(RELEASE_URLBASE) \
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)/usr/local" bash \
tools/osx-codesign.sh
cat tools/osx-pkg.pmdoc/index.xml.tmpl \
| sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \
| sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
Expand Down Expand Up @@ -670,6 +671,9 @@ $(BINARYTAR): release-only
cp README.md $(BINARYNAME)
cp LICENSE $(BINARYNAME)
cp CHANGELOG.md $(BINARYNAME)
ifeq ($(OSTYPE),darwin)
SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" bash tools/osx-codesign.sh
endif
tar -cf $(BINARYNAME).tar $(BINARYNAME)
$(RM) -r $(BINARYNAME)
gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ The Node.js project maintains multiple types of releases:
ordered codenames, beginning with v4 Argon. LTS releases are less frequent
and will attempt to maintain consistent major and minor version numbers,
only incrementing patch version numbers. There are no breaking changes or
feature additions, except in some special circumstances. More information
can be found in the [LTS README](https://github.com/nodejs/LTS/).
feature additions, except in some special circumstances.
* **Nightly**: Versions of code in this repository on the current Current
branch, automatically built every 24-hours where changes exist. Use with
caution.

More information can be found in the [LTS README](https://github.com/nodejs/LTS/).

## Download

Binaries, installers, and source tarballs are available at
Expand Down Expand Up @@ -294,6 +295,8 @@ more information about the governance of the Node.js project, see
**Daniel Wang** <[email protected]>
* [Fishrock123](https://github.com/Fishrock123) -
**Jeremiah Senkpiel** <[email protected]>
* [gabrielschulhof](https://github.com/gabrielschulhof) -
**Gabriel Schulhof** <[email protected]>
* [geek](https://github.com/geek) -
**Wyatt Preul** <[email protected]>
* [gibfahn](https://github.com/gibfahn) -
Expand Down Expand Up @@ -448,6 +451,8 @@ more information about the governance of the Node.js project, see
**Daijiro Wachi** <[email protected]> (he/him)
* [whitlockjc](https://github.com/whitlockjc) -
**Jeremy Whitlock** <[email protected]>
* [XadillaX](https://github.com/XadillaX) -
**Khaidi Chu** <[email protected]> (he/him)
* [yorkie](https://github.com/yorkie) -
**Yorkie Liu** <[email protected]>
* [yosuke-furukawa](https://github.com/yosuke-furukawa) -
Expand Down
18 changes: 9 additions & 9 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ example, buffers/buffer-read.js has the following configuration:
<!-- eslint-disable strict, no-undef, no-unused-vars -->
```js
var bench = common.createBenchmark(main, {
noAssert: [false, true],
buffer: ['fast', 'slow'],
type: ['UInt8', 'UInt16LE', 'UInt16BE',
'UInt32LE', 'UInt32BE',
'Int8', 'Int16LE', 'Int16BE',
'Int32LE', 'Int32BE',
'FloatLE', 'FloatBE',
'DoubleLE', 'DoubleBE'],
millions: [1]
noAssert: [false, true],
buffer: ['fast', 'slow'],
type: ['UInt8', 'UInt16LE', 'UInt16BE',
'UInt32LE', 'UInt32BE',
'Int8', 'Int16LE', 'Int16BE',
'Int32LE', 'Int32BE',
'FloatLE', 'FloatBE',
'DoubleLE', 'DoubleBE'],
millions: [1]
});
```
The runner takes one item from each of the property array value to build a list
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-compare-offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function main(conf) {
const iter = (conf.millions >>> 0) * 1e6;
const size = (conf.size >>> 0);
const method = conf.method === 'slice' ?
compareUsingSlice : compareUsingOffset;
compareUsingSlice : compareUsingOffset;
method(Buffer.alloc(size, 'a'),
Buffer.alloc(size, 'b'),
size >> 1,
Expand Down
2 changes: 1 addition & 1 deletion benchmark/child_process/child-process-read-ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (process.argv[2] === 'child') {

const options = { 'stdio': ['ignore', 1, 2, 'ipc'] };
const child = spawn(process.argv[0],
[process.argv[1], 'child', len], options);
[process.argv[1], 'child', len], options);

var bytes = 0;
child.on('message', function(msg) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/inspect-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
});

function twoDifferentProxies(n) {
// This one should be slower between we're looking up multiple proxies.
// This one should be slower because we're looking up multiple proxies.
const proxyA = new Proxy({}, {get: () => {}});
const proxyB = new Proxy({}, {get: () => {}});
bench.start();
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,11 @@ def configure_openssl(o):
o['variables']['openssl_fips'] = options.openssl_fips
fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
# LINK is for Makefiles, LD/LDXX is for ninja
o['make_fips_settings'] = [
['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'],
['LD', fips_ld + ' <(openssl_fips)/bin/fipsld'],
['LDXX', fips_ld + ' <(openssl_fips)/bin/fipsld'],
]
else:
o['variables']['openssl_fips'] = ''
Expand Down
13 changes: 7 additions & 6 deletions deps/cares/src/ares_parse_naptr_reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,19 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
status = ARES_EBADRESP;
break;
}
/* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
if (rr_len < 7)
{
status = ARES_EBADRESP;
break;
}

/* Check if we are really looking at a NAPTR record */
if (rr_class == C_IN && rr_type == T_NAPTR)
{
/* parse the NAPTR record itself */

/* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
if (rr_len < 7)
{
status = ARES_EBADRESP;
break;
}

/* Allocate storage for this NAPTR answer appending it to the list */
naptr_curr = ares_malloc_data(ARES_DATATYPE_NAPTR_REPLY);
if (!naptr_curr)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 281
#define V8_PATCH_LEVEL 105
#define V8_PATCH_LEVEL 107

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/debug/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ Debug.debuggerFlags = function() {
};

Debug.MakeMirror = MakeMirror;
Debug.MakeMirrorSerializer = MakeMirrorSerializer;

function MakeExecutionState(break_id) {
return new ExecutionState(break_id);
Expand Down
36 changes: 36 additions & 0 deletions deps/v8/src/debug/mirrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ utils.Import(function(from) {
// - FrameMirror
// - ScriptMirror
// - ScopeMirror
// - ProxyMirror

// Type names of the different mirrors.
var MirrorType = {
Expand All @@ -84,6 +85,7 @@ var MirrorType = {
SET_TYPE : 'set',
ITERATOR_TYPE : 'iterator',
GENERATOR_TYPE : 'generator',
PROXY_TYPE : 'proxy',
}


Expand Down Expand Up @@ -157,6 +159,8 @@ function MakeMirror(value, opt_transient) {
mirror = new StringMirror(value);
} else if (IS_SYMBOL(value)) {
mirror = new SymbolMirror(value);
} else if (IS_PROXY(value)) {
mirror = new ProxyMirror(value);
} else if (IS_ARRAY(value)) {
mirror = new ArrayMirror(value);
} else if (IS_DATE(value)) {
Expand Down Expand Up @@ -342,6 +346,15 @@ Mirror.prototype.isSymbol = function() {
};


/**
* Check whether the mirror reflects a proxy object.
* @returns {boolean} True if the mirror reflects a proxy object.
*/
Mirror.prototype.isProxy = function() {
return this instanceof ProxyMirror;
};


/**
* Check whether the mirror reflects an object.
* @returns {boolean} True if the mirror reflects an object
Expand Down Expand Up @@ -2439,6 +2452,29 @@ ContextMirror.prototype.data = function() {
};


/**
* Mirror object for proxies.
* @param {value} value The value reflected by this mirror.
* @constructor
* @extends Mirror
*/
function ProxyMirror(value) {
%_Call(Mirror, this, MirrorType.PROXY_TYPE);
this.value_ = value;
}
inherits(ProxyMirror, Mirror);


ProxyMirror.prototype.value = function() {
return this.value_;
};


ProxyMirror.prototype.toText = function() {
return '#<Proxy>';
};


/**
* Returns a mirror serializer
*
Expand Down
8 changes: 5 additions & 3 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ const aliceSecret = alice.computeSecret(bobKey);
const bobSecret = bob.computeSecret(aliceKey);

assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
// OK
// OK
```

### ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding])
Expand Down Expand Up @@ -684,10 +684,11 @@ const hash = crypto.createHash('sha256');

hash.on('readable', () => {
const data = hash.read();
if (data)
if (data) {
console.log(data.toString('hex'));
// Prints:
// 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
}
});

hash.write('some data to hash');
Expand Down Expand Up @@ -767,10 +768,11 @@ const hmac = crypto.createHmac('sha256', 'a secret');

hmac.on('readable', () => {
const data = hmac.read();
if (data)
if (data) {
console.log(data.toString('hex'));
// Prints:
// 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
}
});

hmac.write('some data to hash');
Expand Down
32 changes: 22 additions & 10 deletions doc/api/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<!-- type=misc -->

The goal of this documentation is to comprehensively explain the Node.js
API, both from a reference as well as a conceptual point of view. Each
API, both from a reference as well as a conceptual point of view. Each
section describes a built-in module or high-level concept.

Where appropriate, property types, method arguments, and the arguments
provided to event handlers are detailed in a list underneath the topic
heading.

Every `.html` document has a corresponding `.json` document presenting
the same information in a structured manner. This feature is
the same information in a structured manner. This feature is
experimental, and added for the benefit of IDEs and other utilities that
wish to do programmatic things with the documentation.

Every `.html` and `.json` file is generated based on the corresponding
`.md` file in the `doc/api/` folder in Node.js's source tree. The
`.md` file in the `doc/api/` folder in Node.js's source tree. The
documentation is generated using the `tools/doc/generate.js` program.
The HTML template is located at `doc/template.html`.

Expand All @@ -39,17 +39,29 @@ The stability indices are as follows:

```txt
Stability: 0 - Deprecated
This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
This feature is known to be problematic, and changes may be planned. Do
not rely on it. Use of the feature may cause warnings to be emitted.
Backwards compatibility across major versions should not be expected.
```

```txt
Stability: 1 - Experimental
This feature is subject to change, and is gated by a command line flag.
It may change or be removed in future versions.
This feature is still under active development and subject to non-backwards
compatible changes, or even removal, in any future version. Use of the feature
is not recommended in production environments. Experimental features are not
subject to the Node.js Semantic Versioning model.
```

*Note*: Caution must be used when making use of `Experimental` features,
particularly within modules that may be used as dependencies (or dependencies
of dependencies) within a Node.js application. End users may not be aware that
experimental features are being used, and therefore may experience unexpected
failures or behavioral changes when changes occur. To help avoid such surprises,
`Experimental` features may require a command-line flag to explicitly enable
them, or may cause a process warning to be emitted. By default, such warnings
are printed to `stderr` and may be handled by attaching a listener to the
`process.on('warning')` event.

```txt
Stability: 2 - Stable
The API has proven satisfactory. Compatibility with the npm ecosystem
Expand All @@ -63,7 +75,7 @@ is a high priority, and will not be broken unless absolutely necessary.
Every HTML file in the markdown has a corresponding JSON file with the
same data.

This feature was added in Node.js v0.6.12. It is experimental.
This feature was added in Node.js v0.6.12. It is experimental.

## Syscalls and man pages

Expand All @@ -72,7 +84,7 @@ and the underlying operating system. Node functions which simply wrap a syscall,
like `fs.open()`, will document that. The docs link to the corresponding man
pages (short for manual pages) which describe how the syscalls work.

**Caveat:** some syscalls, like lchown(2), are BSD-specific. That means, for
**Note:** some syscalls, like lchown(2), are BSD-specific. That means, for
example, that `fs.lchown()` only works on macOS and other BSD-derived systems,
and is not available on Linux.

Expand Down
Loading