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

Commit 57f7bf0

Browse files
chakrabotjackhorton
authored andcommitted
meta: merge node/master into node-chakracore/master
Merge 78a7536 as of 2018-03-06 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Jack Horton <jahorto@microsoft.com>
2 parents 678fffb + 78a7536 commit 57f7bf0

File tree

92 files changed

+1348
-995
lines changed

Some content is hidden

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

92 files changed

+1348
-995
lines changed

.eslintrc.js

Lines changed: 88 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -42,43 +42,80 @@ module.exports = {
4242
},
4343
],
4444
rules: {
45-
// Possible Errors
46-
// http://eslint.org/docs/rules/#possible-errors
45+
// ESLint built-in rules
46+
// http://eslint.org/docs/rules
47+
'accessor-pairs': 'error',
48+
'array-callback-return': 'error',
49+
'arrow-parens': ['error', 'always'],
50+
'arrow-spacing': ['error', { before: true, after: true }],
51+
'block-spacing': 'error',
52+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
53+
'comma-dangle': ['error', 'only-multiline'],
54+
'comma-spacing': 'error',
55+
'comma-style': 'error',
56+
'computed-property-spacing': 'error',
57+
'constructor-super': 'error',
58+
'dot-location': ['error', 'property'],
59+
'dot-notation': 'error',
60+
'eol-last': 'error',
61+
eqeqeq: ['error', 'smart'],
4762
'for-direction': 'error',
63+
'func-call-spacing': 'error',
64+
'func-name-matching': 'error',
65+
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
66+
indent: ['error', 2, {
67+
ArrayExpression: 'first',
68+
CallExpression: { arguments: 'first' },
69+
FunctionDeclaration: { parameters: 'first' },
70+
FunctionExpression: { parameters: 'first' },
71+
MemberExpression: 'off',
72+
ObjectExpression: 'first',
73+
SwitchCase: 1,
74+
}],
75+
'key-spacing': ['error', { mode: 'strict' }],
76+
'keyword-spacing': 'error',
77+
'linebreak-style': ['error', 'unix'],
78+
'max-len': ['error', {
79+
code: 80,
80+
ignorePattern: '^// Flags:',
81+
ignoreRegExpLiterals: true,
82+
ignoreUrls: true,
83+
tabWidth: 2,
84+
}],
85+
'new-parens': 'error',
86+
'no-class-assign': 'error',
87+
'no-confusing-arrow': 'error',
88+
'no-const-assign': 'error',
4889
'no-control-regex': 'error',
4990
'no-debugger': 'error',
91+
'no-delete-var': 'error',
5092
'no-dupe-args': 'error',
93+
'no-dupe-class-members': 'error',
5194
'no-dupe-keys': 'error',
5295
'no-duplicate-case': 'error',
5396
'no-empty-character-class': 'error',
5497
'no-ex-assign': 'error',
5598
'no-extra-boolean-cast': 'error',
5699
'no-extra-parens': ['error', 'functions'],
57100
'no-extra-semi': 'error',
101+
'no-fallthrough': 'error',
58102
'no-func-assign': 'error',
103+
'no-global-assign': 'error',
59104
'no-invalid-regexp': 'error',
60105
'no-irregular-whitespace': 'error',
61-
'no-obj-calls': 'error',
62-
'no-template-curly-in-string': 'error',
63-
'no-unexpected-multiline': 'error',
64-
'no-unreachable': 'error',
65-
'no-unsafe-negation': 'error',
66-
'use-isnan': 'error',
67-
'valid-typeof': 'error',
68-
69-
// Best Practices
70-
// http://eslint.org/docs/rules/#best-practices
71-
'accessor-pairs': 'error',
72-
'array-callback-return': 'error',
73-
'dot-location': ['error', 'property'],
74-
'dot-notation': 'error',
75-
eqeqeq: ['error', 'smart'],
76-
'no-fallthrough': 'error',
77-
'no-global-assign': 'error',
106+
'no-lonely-if': 'error',
107+
'no-mixed-requires': 'error',
108+
'no-mixed-spaces-and-tabs': 'error',
78109
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
110+
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
111+
'no-new-require': 'error',
112+
'no-new-symbol': 'error',
113+
'no-obj-calls': 'error',
79114
'no-octal': 'error',
115+
'no-path-concat': 'error',
80116
'no-proto': 'error',
81117
'no-redeclare': 'error',
118+
'no-restricted-modules': ['error', 'sys'],
82119
'no-restricted-properties': [
83120
'error',
84121
{
@@ -110,76 +147,6 @@ module.exports = {
110147
message: '__defineSetter__ is deprecated.',
111148
}
112149
],
113-
'no-return-await': 'error',
114-
'no-self-assign': 'error',
115-
'no-self-compare': 'error',
116-
'no-throw-literal': 'error',
117-
'no-unused-labels': 'error',
118-
'no-useless-call': 'error',
119-
'no-useless-concat': 'error',
120-
'no-useless-escape': 'error',
121-
'no-useless-return': 'error',
122-
'no-void': 'error',
123-
'no-with': 'error',
124-
125-
// Strict Mode
126-
// http://eslint.org/docs/rules/#strict-mode
127-
strict: ['error', 'global'],
128-
129-
// Variables
130-
// http://eslint.org/docs/rules/#variables
131-
'no-delete-var': 'error',
132-
'no-undef': 'error',
133-
'no-undef-init': 'error',
134-
'no-unused-vars': ['error', { args: 'none' }],
135-
'no-use-before-define': ['error', {
136-
classes: true,
137-
functions: false,
138-
variables: false,
139-
}],
140-
141-
// Node.js and CommonJS
142-
// http://eslint.org/docs/rules/#nodejs-and-commonjs
143-
'no-mixed-requires': 'error',
144-
'no-new-require': 'error',
145-
'no-path-concat': 'error',
146-
'no-restricted-modules': ['error', 'sys'],
147-
148-
// Stylistic Issues
149-
// http://eslint.org/docs/rules/#stylistic-issues'
150-
'block-spacing': 'error',
151-
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
152-
'comma-dangle': ['error', 'only-multiline'],
153-
'comma-spacing': 'error',
154-
'comma-style': 'error',
155-
'computed-property-spacing': 'error',
156-
'eol-last': 'error',
157-
'func-call-spacing': 'error',
158-
'func-name-matching': 'error',
159-
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
160-
indent: ['error', 2, {
161-
ArrayExpression: 'first',
162-
CallExpression: { arguments: 'first' },
163-
FunctionDeclaration: { parameters: 'first' },
164-
FunctionExpression: { parameters: 'first' },
165-
MemberExpression: 'off',
166-
ObjectExpression: 'first',
167-
SwitchCase: 1,
168-
}],
169-
'key-spacing': ['error', { mode: 'strict' }],
170-
'keyword-spacing': 'error',
171-
'linebreak-style': ['error', 'unix'],
172-
'max-len': ['error', {
173-
code: 80,
174-
ignorePattern: '^// Flags:',
175-
ignoreRegExpLiterals: true,
176-
ignoreUrls: true,
177-
tabWidth: 2,
178-
}],
179-
'new-parens': 'error',
180-
'no-lonely-if': 'error',
181-
'no-mixed-spaces-and-tabs': 'error',
182-
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
183150
/* eslint-disable max-len, quotes */
184151
'no-restricted-syntax': [
185152
'error',
@@ -209,15 +176,41 @@ module.exports = {
209176
}
210177
],
211178
/* eslint-enable max-len, quotes */
179+
'no-return-await': 'error',
180+
'no-self-assign': 'error',
181+
'no-self-compare': 'error',
212182
'no-tabs': 'error',
183+
'no-template-curly-in-string': 'error',
184+
'no-this-before-super': 'error',
185+
'no-throw-literal': 'error',
213186
'no-trailing-spaces': 'error',
187+
'no-undef': 'error',
188+
'no-undef-init': 'error',
189+
'no-unexpected-multiline': 'error',
190+
'no-unreachable': 'error',
214191
'no-unsafe-finally': 'error',
192+
'no-unsafe-negation': 'error',
193+
'no-unused-labels': 'error',
194+
'no-unused-vars': ['error', { args: 'none' }],
195+
'no-use-before-define': ['error', {
196+
classes: true,
197+
functions: false,
198+
variables: false,
199+
}],
200+
'no-useless-call': 'error',
201+
'no-useless-concat': 'error',
202+
'no-useless-escape': 'error',
203+
'no-useless-return': 'error',
204+
'no-void': 'error',
215205
'no-whitespace-before-property': 'error',
206+
'no-with': 'error',
216207
'object-curly-spacing': ['error', 'always'],
217208
'one-var': ['error', { initialized: 'never' }],
218209
'one-var-declaration-per-line': 'error',
219210
'operator-linebreak': ['error', 'after'],
211+
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
220212
quotes: ['error', 'single', { avoidEscape: true }],
213+
'rest-spread-spacing': 'error',
221214
semi: 'error',
222215
'semi-spacing': 'error',
223216
'space-before-blocks': ['error', 'always'],
@@ -229,25 +222,14 @@ module.exports = {
229222
'space-in-parens': ['error', 'never'],
230223
'space-infix-ops': 'error',
231224
'space-unary-ops': 'error',
232-
'unicode-bom': 'error',
233-
234-
// ECMAScript 6
235-
// http://eslint.org/docs/rules/#ecmascript-6
236-
'arrow-parens': ['error', 'always'],
237-
'arrow-spacing': ['error', { before: true, after: true }],
238-
'constructor-super': 'error',
239-
'no-class-assign': 'error',
240-
'no-confusing-arrow': 'error',
241-
'no-const-assign': 'error',
242-
'no-dupe-class-members': 'error',
243-
'no-new-symbol': 'error',
244-
'no-this-before-super': 'error',
245-
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
246-
'rest-spread-spacing': 'error',
225+
strict: ['error', 'global'],
247226
'symbol-description': 'error',
248227
'template-curly-spacing': 'error',
228+
'unicode-bom': 'error',
229+
'use-isnan': 'error',
230+
'valid-typeof': 'error',
249231

250-
// Custom rules in from eslint-plugin-node-core
232+
// Custom rules from eslint-plugin-node-core
251233
'node-core/no-unescaped-regexp-dot': 'error',
252234
},
253235
globals: {
@@ -262,7 +244,6 @@ module.exports = {
262244
DTRACE_HTTP_SERVER_REQUEST: false,
263245
DTRACE_HTTP_SERVER_RESPONSE: false,
264246
DTRACE_NET_SERVER_CONNECTION: false,
265-
DTRACE_NET_STREAM_END: false,
266-
internalBinding: false,
247+
DTRACE_NET_STREAM_END: false
267248
},
268249
};

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md
1414
- [ ] tests and/or benchmarks are included
1515
- [ ] documentation is changed or added
1616
- [ ] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)
17-
18-
##### Affected core subsystem(s)
19-
<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ lint-md:
11011101
@echo "To install (requires internet access) run: $ make lint-md-build"
11021102
endif
11031103

1104-
LINT_JS_TARGETS = benchmark doc lib test tools
1104+
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools
11051105

11061106
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
11071107
--ext=.js,.mjs,.md $(LINT_JS_TARGETS) --ignore-pattern '!.eslintrc.js'

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Reset this number to 0 on major V8 upgrades.
3131
# Increment by one for each non-official patch applied to deps/v8.
32-
'v8_embedder_string': '-node.4',
32+
'v8_embedder_string': '-node.5',
3333

3434
# Enable disassembler for `--print-code` v8 options
3535
'v8_enable_disassembler': 1,

deps/v8/src/bootstrapper.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5475,6 +5475,11 @@ Genesis::Genesis(
54755475
if (!InstallDebuggerNatives()) return;
54765476
}
54775477

5478+
if (FLAG_disallow_code_generation_from_strings) {
5479+
native_context()->set_allow_code_gen_from_strings(
5480+
isolate->heap()->false_value());
5481+
}
5482+
54785483
ConfigureUtilsObject(context_type);
54795484

54805485
// Check that the script context table is empty except for the 'this' binding.

deps/v8/src/flag-definitions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ DEFINE_BOOL(builtins_in_stack_traces, false,
768768
"show built-in functions in stack traces")
769769
DEFINE_BOOL(enable_experimental_builtins, true,
770770
"enable new csa-based experimental builtins")
771+
DEFINE_BOOL(disallow_code_generation_from_strings, false,
772+
"disallow eval and friends")
771773

772774
// builtins.cc
773775
DEFINE_BOOL(allow_unsafe_function_constructor, false,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2017 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --disallow-code-generation-from-strings
6+
7+
assertThrows("1 + 1", EvalError);
8+
assertThrows(() => eval("1 + 1"), EvalError);
9+
assertThrows(() => Function("x", "return x + 1"), EvalError);

doc/api/_toc.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@// NB(chrisdickinson): if you move this file, be sure to update
22
@// tools/doc/html.js to point at the new location.
3+
4+
<!--introduced_in=v0.10.0-->
5+
36
* [About these Docs](documentation.html)
47
* [Usage & Example](synopsis.html)
58

doc/api/deprecations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,8 @@ Using the `noAssert` argument has no functionality anymore. All input is going
932932
to be verified, no matter if it is set to true or not. Skipping the verification
933933
could lead to hard to find errors and crashes.
934934
935-
<a id="DEP0XXX"></a>
936-
### DEP0XXX: process.binding('util').is[...] typechecks
935+
<a id="DEP0103"></a>
936+
### DEP0103: process.binding('util').is[...] typechecks
937937
938938
Type: Documentation-only (supports [`--pending-deprecation`][])
939939

doc/api/errors.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,12 @@ An unspecified or non-specific system error has occurred within the Node.js
14491449
process. The error object will have an `err.info` object property with
14501450
additional details.
14511451

1452+
<a id="ERR_STREAM_DESTROYED"></a>
1453+
### ERR_STREAM_DESTROYED
1454+
1455+
A stream method was called that cannot complete because the stream was
1456+
destroyed using `stream.destroy()`.
1457+
14521458
<a id="ERR_TLS_CERT_ALTNAME_INVALID"></a>
14531459
### ERR_TLS_CERT_ALTNAME_INVALID
14541460

@@ -1615,11 +1621,6 @@ The fulfilled value of a linking promise is not a `vm.Module` object.
16151621
The current module's status does not allow for this operation. The specific
16161622
meaning of the error depends on the specific function.
16171623

1618-
<a id="ERR_ZLIB_BINDING_CLOSED"></a>
1619-
### ERR_ZLIB_BINDING_CLOSED
1620-
1621-
An attempt was made to use a `zlib` object after it has already been closed.
1622-
16231624
<a id="ERR_ZLIB_INITIALIZATION_FAILED"></a>
16241625
### ERR_ZLIB_INITIALIZATION_FAILED
16251626

0 commit comments

Comments
 (0)