diff --git a/BUILDING.md b/BUILDING.md index 4de36f5a398d32..5095a036c05f73 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -60,6 +60,12 @@ note1 - The gcc4.8-libs package needs to be installed, because node by Joyent. SmartOS images >= 16.4 are not supported because GCC 4.8 runtime libraries are not available in their pkgsrc repository +*Note*: On Windows, running Node.js in windows terminal emulators like `mintty` + requires the usage of [winpty](https://github.com/rprichard/winpty) for + Node's tty channels to work correctly (e.g. `winpty node.exe script.js`). + In "Git bash" if you call the node shell alias (`node` without the `.exe` + extension), `winpty` is used automatically. + ### Supported toolchains Depending on host platform, the selection of toolchains may vary. diff --git a/CHANGELOG.md b/CHANGELOG.md index 68ae334fd51fb0..fbe6611679bf73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,8 @@ release. -6.12.0
+6.12.1
+6.12.0
6.11.5
6.11.4
6.11.3
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 285a7d932fa549..8f84f6f9f78baa 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -24,8 +24,9 @@ understand the project governance model as outlined in ## Issues and Pull Requests -Courtesy should always be shown to individuals submitting issues and -pull requests to the Node.js project. +Courtesy should **always** be shown to individuals submitting issues and pull +requests to the Node.js project. Be welcoming to first time contributors, +identified by the GitHub ![badge](./doc/first_timer_badge.png) badge. Collaborators should feel free to take full responsibility for managing issues and pull requests they feel qualified to handle, as @@ -64,7 +65,12 @@ from other Collaborators. Leave at least 48 hours during the week and 72 hours over weekends to account for international time differences and work schedules. Trivial changes (e.g. those which fix minor bugs or improve performance without affecting API or causing other -wide-reaching impact) may be landed after a shorter delay. +wide-reaching impact), and focused changes that affect only documentation +and/or the test suite, may be landed after a shorter delay if they have +multiple approvals. + +For first time contributors, ask the author if they have configured their git +username and email to their liking as per [this guide][git-username]. For non-breaking changes, if there is no disagreement amongst Collaborators, a pull request may be landed given appropriate review. @@ -354,32 +360,16 @@ The TSC should serve as the final arbiter where required. * If you do, please force-push removing the merge. * Reasons for not using the web interface button: * The merge method will add an unnecessary merge commit. - * The rebase & merge method adds metadata to the commit title. - * The rebase method changes the author. * The squash & merge method has been known to add metadata to the - commit title. + commit title (the PR #). * If more than one author has contributed to the PR, keep the most recent author when squashing. -Always modify the original commit message to include additional meta -information regarding the change process: - -- A `PR-URL:` line that references the *full* GitHub URL of the original - pull request being merged so it's easy to trace a commit back to the - conversation that led up to that change. -- A `Fixes: X` line, where _X_ either includes the *full* GitHub URL - for an issue, and/or the hash and commit message if the commit fixes - a bug in a previous commit. Multiple `Fixes:` lines may be added if - appropriate. -- A `Refs:` line referencing a URL for any relevant background. -- A `Reviewed-By: Name ` line for yourself and any - other Collaborators who have reviewed the change. - - Useful for @mentions / contact list if something goes wrong in the PR. - - Protects against the assumption that GitHub will be around forever. - Review the commit message to ensure that it adheres to the guidelines outlined in the [contributing](./CONTRIBUTING.md#commit-message-guidelines) guide. +Add all necessary [metadata](#metadata) to commit messages before landing. + See the commit log for examples such as [this one](https://github.com/nodejs/node/commit/b636ba8186) if unsure exactly how to format your commit messages. @@ -387,34 +377,33 @@ exactly how to format your commit messages. Additionally: - Double check PRs to make sure the person's _full name_ and email address are correct before merging. -- Except when updating dependencies, all commits should be self - contained (meaning every commit should pass all tests). This makes - it much easier when bisecting to find a breaking change. +- All commits should be self-contained (meaning every commit should pass all + tests). This makes it much easier when bisecting to find a breaking change. ### Technical HOWTO -Clear any `am`/`rebase` that may already be underway. +Clear any `am`/`rebase` that may already be underway: ```text $ git am --abort $ git rebase --abort ``` -Checkout proper target branch +Checkout proper target branch: ```text $ git checkout master ``` Update the tree (assumes your repo is set up as detailed in -[CONTRIBUTING.md](CONTRIBUTING.md#step-1-fork)) +[CONTRIBUTING.md](CONTRIBUTING.md#step-1-fork)): ```text $ git fetch upstream $ git merge --ff-only upstream/master ``` -Apply external patches +Apply external patches: ```text $ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix @@ -432,21 +421,19 @@ against the original PR carefully and build/test on at least one platform before landing. If the 3-way merge fails, then it is most likely that a conflicting PR has landed since the CI run and you will have to ask the author to rebase. -Check and re-review the changes +Check and re-review the changes: ```text $ git diff upstream/master ``` -Check number of commits and commit messages +Check number of commits and commit messages: ```text $ git log upstream/master...master ``` -If there are multiple commits that relate to the same feature or -one with a feature and separate with a test for that feature, -you'll need to use `squash` or `fixup`: +Squash commits and add metadata: ```text $ git rebase -i upstream/master @@ -502,13 +489,39 @@ Save the file and close the editor. You'll be asked to enter a new commit message for that commit. This is a good moment to fix incorrect commit logs, ensure that they are properly formatted, and add `Reviewed-By` lines. + * The commit message text must conform to the [commit message guidelines](./CONTRIBUTING.md#commit-message-guidelines). + +* Modify the original commit message to include additional metadata regarding + the change process. ([`node-core-utils`][] fetches the metadata for you.) + + * Required: A `PR-URL:` line that references the *full* GitHub URL of the + original pull request being merged so it's easy to trace a commit back to + the conversation that led up to that change. + * Optional: A `Fixes: X` line, where _X_ either includes the *full* GitHub URL + for an issue, and/or the hash and commit message if the commit fixes + a bug in a previous commit. Multiple `Fixes:` lines may be added if + appropriate. + * Optional: One or more `Refs:` lines referencing a URL for any relevant + background. + * Required: A `Reviewed-By: Name ` line for yourself and any + other Collaborators who have reviewed the change. + * Useful for @mentions / contact list if something goes wrong in the PR. + * Protects against the assumption that GitHub will be around forever. + Run tests (`make -j4 test` or `vcbuild test`). Even though there was a successful continuous integration run, other changes may have landed on master since then, so running the tests one last time locally is a good practice. +Validate that the commit message is properly formatted using +[core-validate-commit](https://github.com/evanlucas/core-validate-commit). + +```text +$ git rev-list upstream/master...HEAD | xargs core-validate-commit +``` + Time to push it: ```text @@ -660,3 +673,5 @@ LTS working group and the Release team. [backporting guide]: doc/guides/backporting-to-release-lines.md [Stability Index]: doc/api/documentation.md#stability-index [Enhancement Proposal]: https://github.com/nodejs/node-eps +[git-username]: https://help.github.com/articles/setting-your-username-in-git/ +[`node-core-utils`]: https://github.com/nodejs/node-core-utils diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b69f2e0708fa9c..9d60ae5c92e815 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,10 @@ Create a branch and start hacking: ```text $ git checkout -b my-branch -t origin/master ``` +Please make sure this local email is also added to your +[GitHub email list](https://github.com/settings/emails) so that your commits +will be properly associated with your account and you will be promoted +to Contributor once your first commit is landed. Any text you write should follow the [Style Guide](doc/STYLE_GUIDE.md), including comments and API documentation. @@ -99,8 +103,8 @@ Writing good commit logs is important. A commit log should describe what changed and why. Follow these guidelines when writing one: 1. The first line should: - - contain a short description of the change - - be 50 characters or less + - contain a short description of the change (preferably 50 characters or less, + and no more than 72 characters) - be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, like function/variable names - be prefixed with the name of the changed subsystem and start with an diff --git a/Makefile b/Makefile index d9c24a4afad2f1..7f4b0fe7e2fa97 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,10 @@ test/addons/.buildstamp: config.gypi \ test/addons/.docbuildstamp # Cannot use $(wildcard test/addons/*/) here, it's evaluated before # embedded addons have been generated from the documentation. +# Ignore folders without binding.gyp (#14843) @for dirname in test/addons/*/; do \ + if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \ + continue; fi ; \ printf "\nBuilding addon $$PWD/$$dirname\n" ; \ env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \ --loglevel=$(LOGLEVEL) rebuild \ diff --git a/README.md b/README.md index fb581680c2250c..12f9ed93875240 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Binaries, installers, and source tarballs are available at The [latest](https://nodejs.org/download/release/latest/) directory is an alias for the latest Current release. The latest LTS release from an LTS line is available in the form: latest-_codename_. For example: - +. #### Nightly Releases **Nightly** builds are available at @@ -242,7 +242,7 @@ For more information about the governance of the Node.js project, see * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> (he/him) * [fhinkel](https://github.com/fhinkel) - -**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> +**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> (she/her) * [Fishrock123](https://github.com/Fishrock123) - **Jeremiah Senkpiel** <fishrock123@rocketmail.com> * [indutny](https://github.com/indutny) - @@ -265,8 +265,6 @@ For more information about the governance of the Node.js project, see **Ali Ijaz Sheikh** <ofrobots@google.com> * [rvagg](https://github.com/rvagg) - **Rod Vagg** <rod@vagg.org> -* [shigeki](https://github.com/shigeki) - -**Shigeki Ohtsu** <ohtsu@ohtsu.org> (he/him) * [targos](https://github.com/targos) - **Michaël Zasso** <targos@protonmail.com> (he/him) * [thefourtheye](https://github.com/thefourtheye) - @@ -290,6 +288,8 @@ For more information about the governance of the Node.js project, see **Alexis Campailla** <orangemocha@nodejs.org> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <bertbelder@gmail.com> +* [shigeki](https://github.com/shigeki) - +**Shigeki Ohtsu** <ohtsu@ohtsu.org> (he/him) ### Collaborators @@ -305,6 +305,8 @@ For more information about the governance of the Node.js project, see **Andreas Madsen** <amwebdk@gmail.com> (he/him) * [AnnaMag](https://github.com/AnnaMag) - **Anna M. Kedzierska** <anna.m.kedzierska@gmail.com> +* [apapirovski](https://github.com/apapirovski) - +**Anatoli Papirovski** <apapirovski@mac.com> (he/him) * [aqrln](https://github.com/aqrln) - **Alexey Orlenko** <eaglexrlnk@gmail.com> (he/him) * [bengl](https://github.com/bengl) - @@ -348,7 +350,7 @@ For more information about the governance of the Node.js project, see * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> (he/him) * [fhinkel](https://github.com/fhinkel) - -**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> +**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> (she/her) * [firedfox](https://github.com/firedfox) - **Daniel Wang** <wangyang0123@gmail.com> * [Fishrock123](https://github.com/Fishrock123) - @@ -369,8 +371,6 @@ For more information about the governance of the Node.js project, see **Ilkka Myller** <ilkka.myller@nodefield.com> * [indutny](https://github.com/indutny) - **Fedor Indutny** <fedor.indutny@gmail.com> -* [isaacs](https://github.com/isaacs) - -**Isaac Z. Schlueter** <i@izs.me> * [italoacasas](https://github.com/italoacasas) - **Italo A. Casas** <me@italoacasas.com> (he/him) * [JacksonTian](https://github.com/JacksonTian) - @@ -407,8 +407,6 @@ For more information about the governance of the Node.js project, see **Luigi Pinca** <luigipinca@gmail.com> (he/him) * [lucamaraschi](https://github.com/lucamaraschi) - **Luca Maraschi** <luca.maraschi@gmail.com> (he/him) -* [lxe](https://github.com/lxe) - -**Aleksey Smolenchuk** <lxe@lxe.co> * [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <mattloring@google.com> * [mcollina](https://github.com/mcollina) - @@ -421,8 +419,6 @@ For more information about the governance of the Node.js project, see **Mikeal Rogers** <mikeal.rogers@gmail.com> * [misterdjules](https://github.com/misterdjules) - **Julien Gilli** <jgilli@nodejs.org> -* [monsanto](https://github.com/monsanto) - -**Christopher Monsanto** <chris@monsan.to> * [mscdex](https://github.com/mscdex) - **Brian White** <mscdex@mscdex.net> * [MylesBorins](https://github.com/MylesBorins) - @@ -431,18 +427,12 @@ For more information about the governance of the Node.js project, see **Teddy Katz** <teddy.katz@gmail.com> * [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** <ofrobots@google.com> -* [Olegas](https://github.com/Olegas) - -**Oleg Elifantiev** <oleg@elifantiev.ru> * [orangemocha](https://github.com/orangemocha) - **Alexis Campailla** <orangemocha@nodejs.org> * [othiym23](https://github.com/othiym23) - **Forrest L Norvell** <ogd@aoaioxxysz.net> (he/him) -* [petkaantonov](https://github.com/petkaantonov) - -**Petka Antonov** <petka_antonov@hotmail.com> * [phillipj](https://github.com/phillipj) - **Phillip Johnsen** <johphi@gmail.com> -* [piscisaureus](https://github.com/piscisaureus) - -**Bert Belder** <bertbelder@gmail.com> * [pmq20](https://github.com/pmq20) - **Minqi Pan** <pmq2001@gmail.com> * [princejwesley](https://github.com/princejwesley) - @@ -453,8 +443,6 @@ For more information about the governance of the Node.js project, see **Refael Ackermann** <refack@gmail.com> (he/him) * [richardlau](https://github.com/richardlau) - **Richard Lau** <riclau@uk.ibm.com> -* [rlidwka](https://github.com/rlidwka) - -**Alex Kocharin** <alex@kocharin.ru> * [rmg](https://github.com/rmg) - **Ryan Graham** <r.m.graham@gmail.com> * [robertkowalski](https://github.com/robertkowalski) - @@ -487,8 +475,6 @@ For more information about the governance of the Node.js project, see **Stefan Budeanu** <stefan@budeanu.com> * [targos](https://github.com/targos) - **Michaël Zasso** <targos@protonmail.com> (he/him) -* [tellnes](https://github.com/tellnes) - -**Christian Tellnes** <christian@tellnes.no> * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> (he/him) * [thekemkid](https://github.com/thekemkid) - @@ -520,6 +506,25 @@ For more information about the governance of the Node.js project, see * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <yosuke.furukawa@gmail.com> +### Collaborator Emeriti + +* [isaacs](https://github.com/isaacs) - +**Isaac Z. Schlueter** <i@izs.me> +* [lxe](https://github.com/lxe) - +**Aleksey Smolenchuk** <lxe@lxe.co> +* [monsanto](https://github.com/monsanto) - +**Christopher Monsanto** <chris@monsan.to> +* [Olegas](https://github.com/Olegas) - +**Oleg Elifantiev** <oleg@elifantiev.ru> +* [petkaantonov](https://github.com/petkaantonov) - +**Petka Antonov** <petka_antonov@hotmail.com> +* [piscisaureus](https://github.com/piscisaureus) - +**Bert Belder** <bertbelder@gmail.com> +* [rlidwka](https://github.com/rlidwka) - +**Alex Kocharin** <alex@kocharin.ru> +* [tellnes](https://github.com/tellnes) - +**Christian Tellnes** <christian@tellnes.no> + Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in maintaining the Node.js project. @@ -531,6 +536,8 @@ Node.js releases are signed with one of the following GPG keys: `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` * **Evan Lucas** <evanlucas@me.com> `B9AE9905FFD7803F25714661B63B535A4C206CA9` +* **Gibson Fahnestock** <gibfahn@gmail.com> +`77984A986EBC2AA786BC0F66B01FBB92821C587A` * **Italo A. Casas** <me@italoacasas.com> `56730D5401028683275BD23C23EFEFE93C4CFFFE` * **James M Snell** <jasnell@keybase.io> @@ -552,6 +559,7 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273 gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 gpg --keyserver pool.sks-keyservers.net --recv-keys 56730D5401028683275BD23C23EFEFE93C4CFFFE +gpg --keyserver pool.sks-keyservers.net --recv-keys 77984A986EBC2AA786BC0F66B01FBB92821C587A ``` See the section above on [Verifying Binaries](#verifying-binaries) for details diff --git a/benchmark/misc/console.js b/benchmark/misc/console.js index 9a08a411c51f82..40c073b19bc98d 100644 --- a/benchmark/misc/console.js +++ b/benchmark/misc/console.js @@ -106,6 +106,8 @@ function runUsingArgumentsAndApply(n, concat) { function main(conf) { const n = +conf.n; switch (conf.method) { + // '' is a default case for tests + case '': case 'restAndSpread': runUsingRestAndSpread(n, conf.concat); break; diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 8ac7683cd54d7e..d6afd4e9c0bcbb 100644 --- a/benchmark/misc/object-property-bench.js +++ b/benchmark/misc/object-property-bench.js @@ -63,6 +63,8 @@ function main(conf) { const n = +conf.millions * 1e6; switch (conf.method) { + // '' is a default case for tests + case '': case 'property': runProperty(n); break; diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js index f4d22557ac5d65..fd9f074b9e11f0 100644 --- a/benchmark/misc/punycode.js +++ b/benchmark/misc/punycode.js @@ -63,6 +63,8 @@ function main(conf) { const n = +conf.n; const val = conf.val; switch (conf.method) { + // '' is a default case for tests + case '': case 'punycode': runPunycode(n, val); break; diff --git a/common.gypi b/common.gypi index de8cfc660d4229..50fd3d1bd866b1 100644 --- a/common.gypi +++ b/common.gypi @@ -110,6 +110,10 @@ 'MinimalRebuild': 'false', 'OmitFramePointers': 'false', 'BasicRuntimeChecks': 3, # /RTC1 + 'AdditionalOptions': [ + '/bigobj', # prevent error C1128 in VS2015 + '/MP', # compile across multiple CPUs + ], }, 'VCLinkerTool': { 'LinkIncremental': 2, # enable incremental linking diff --git a/configure b/configure index 1eaf26c0955575..fac604a01ed251 100755 --- a/configure +++ b/configure @@ -12,10 +12,10 @@ exec python "$0" "$@" del _ import sys +from distutils.spawn import find_executable as which if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7): sys.stderr.write('Please use either Python 2.6 or 2.7') - from distutils.spawn import find_executable as which python2 = which('python2') or which('python2.6') or which('python2.7') if python2: @@ -350,7 +350,7 @@ parser.add_option('--with-dtrace', parser.add_option('--with-lttng', action='store_true', dest='with_lttng', - help='build with Lttng (Only available to Linux)') + help='build with Lttng (Only supported on Linux)') parser.add_option('--with-etw', action='store_true', @@ -1318,6 +1318,40 @@ def configure_inspector(o): options.without_ssl) o['variables']['v8_inspector'] = b(not disable_inspector) + +def make_bin_override(): + if sys.platform == 'win32': + raise Exception('make_bin_override should not be called on win32.') + # If the system python is not the python we are running (which should be + # python 2), then create a directory with a symlink called `python` to our + # sys.executable. This directory will be prefixed to the PATH, so that + # other tools that shell out to `python` will use the appropriate python + + which_python = which('python') + if (which_python and + os.path.realpath(which_python) == os.path.realpath(sys.executable)): + return + + bin_override = os.path.abspath('out/tools/bin') + try: + os.makedirs(bin_override) + except OSError as e: + if e.errno != errno.EEXIST: raise e + + python_link = os.path.join(bin_override, 'python') + try: + os.unlink(python_link) + except OSError as e: + if e.errno != errno.ENOENT: raise e + os.symlink(sys.executable, python_link) + + # We need to set the environment right now so that when gyp (in run_gyp) + # shells out, it finds the right python (specifically at + # https://github.com/nodejs/node/blob/d82e107/deps/v8/gypfiles/toolchain.gypi#L43) + os.environ['PATH'] = bin_override + ':' + os.environ['PATH'] + + return bin_override + output = { 'variables': {}, 'include_dirs': [], @@ -1394,6 +1428,11 @@ if options.prefix: config = '\n'.join(map('='.join, config.iteritems())) + '\n' +# On Windows there's no reason to search for a different python binary. +bin_override = None if sys.platform == 'win32' else make_bin_override() +if bin_override: + config = 'export PATH:=' + bin_override + ':$(PATH)\n' + config + write('config.mk', do_not_edit + config) gyp_args = ['--no-parallel'] diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index e7931da11e423f..f5e1bcbd30bd20 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 1 #define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 108 +#define V8_PATCH_LEVEL 109 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/compiler/ast-graph-builder.cc b/deps/v8/src/compiler/ast-graph-builder.cc index 89bb61949a0b04..e67a5236447dff 100644 --- a/deps/v8/src/compiler/ast-graph-builder.cc +++ b/deps/v8/src/compiler/ast-graph-builder.cc @@ -1620,7 +1620,8 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) { jsgraph()->Constant(property->NeedsSetFunctionName()); const Operator* op = javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); - NewNode(op, receiver, key, value, attr, set_function_name); + Node* call = NewNode(op, receiver, key, value, attr, set_function_name); + PrepareFrameState(call, BailoutId::None()); break; } case ObjectLiteral::Property::GETTER: { @@ -1870,7 +1871,8 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { jsgraph()->Constant(property->NeedsSetFunctionName()); const Operator* op = javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); - NewNode(op, receiver, key, value, attr, set_function_name); + Node* call = NewNode(op, receiver, key, value, attr, set_function_name); + PrepareFrameState(call, expr->GetIdForPropertySet(property_index)); break; } case ObjectLiteral::Property::PROTOTYPE: diff --git a/deps/v8/src/compiler/linkage.cc b/deps/v8/src/compiler/linkage.cc index 105bd353fca480..7627f09d150642 100644 --- a/deps/v8/src/compiler/linkage.cc +++ b/deps/v8/src/compiler/linkage.cc @@ -145,7 +145,6 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { switch (function) { case Runtime::kAllocateInTargetSpace: case Runtime::kCreateIterResultObject: - case Runtime::kDefineDataPropertyInLiteral: case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe? diff --git a/deps/v8/src/full-codegen/arm/full-codegen-arm.cc b/deps/v8/src/full-codegen/arm/full-codegen-arm.cc index 81c5ff2ae7704a..f687da72624cbc 100644 --- a/deps/v8/src/full-codegen/arm/full-codegen-arm.cc +++ b/deps/v8/src/full-codegen/arm/full-codegen-arm.cc @@ -1572,6 +1572,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc index aa67117a7f4920..547863125d1420 100644 --- a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc +++ b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc @@ -1557,6 +1557,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc b/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc index f1945c897cf2e2..3e56b615a43bf2 100644 --- a/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc +++ b/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc @@ -1493,6 +1493,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/mips/full-codegen-mips.cc b/deps/v8/src/full-codegen/mips/full-codegen-mips.cc index f329a23d00c97a..91a856b8c51217 100644 --- a/deps/v8/src/full-codegen/mips/full-codegen-mips.cc +++ b/deps/v8/src/full-codegen/mips/full-codegen-mips.cc @@ -1569,6 +1569,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc b/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc index 681abd12303222..278f589089eecc 100644 --- a/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc +++ b/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc @@ -1570,6 +1570,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc b/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc index 301ccf53cc3000..9f403f4ac8198e 100644 --- a/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc @@ -1532,6 +1532,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/s390/full-codegen-s390.cc b/deps/v8/src/full-codegen/s390/full-codegen-s390.cc index 88bec4cab6e63f..8c8a84707771e1 100644 --- a/deps/v8/src/full-codegen/s390/full-codegen-s390.cc +++ b/deps/v8/src/full-codegen/s390/full-codegen-s390.cc @@ -1491,6 +1491,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/x64/full-codegen-x64.cc b/deps/v8/src/full-codegen/x64/full-codegen-x64.cc index 992e7fe4f72dd8..775c721db374d7 100644 --- a/deps/v8/src/full-codegen/x64/full-codegen-x64.cc +++ b/deps/v8/src/full-codegen/x64/full-codegen-x64.cc @@ -1518,6 +1518,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/src/full-codegen/x87/full-codegen-x87.cc b/deps/v8/src/full-codegen/x87/full-codegen-x87.cc index f14aaf69b02d97..54130e9f630c97 100644 --- a/deps/v8/src/full-codegen/x87/full-codegen-x87.cc +++ b/deps/v8/src/full-codegen/x87/full-codegen-x87.cc @@ -1485,6 +1485,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { PushOperand(Smi::FromInt(NONE)); PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); + PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), + NO_REGISTERS); } else { DropOperands(3); } diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-621816.js b/deps/v8/test/mjsunit/regress/regress-crbug-621816.js new file mode 100644 index 00000000000000..ca7f5ac6df314f --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-621816.js @@ -0,0 +1,18 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --allow-natives-syntax --turbo + +function f() { + var o = {}; + o.a = 1; +} +function g() { + var o = { ['a']: function(){} }; + f(); +} +f(); +f(); +%OptimizeFunctionOnNextCall(g); +g(); diff --git a/doc/STYLE_GUIDE.md b/doc/STYLE_GUIDE.md index 5a05544d931bee..ef96a801a96ea8 100644 --- a/doc/STYLE_GUIDE.md +++ b/doc/STYLE_GUIDE.md @@ -1,10 +1,9 @@ # Style Guide -* Documents are written in markdown files. -* Those files should be written in **`lowercase-with-dashes.md`**. +* Documentation is written in markdown files with names formatted as + `lowercase-with-dashes.md`. * Underscores in filenames are allowed only when they are present in the topic the document will describe (e.g., `child_process`). - * Filenames should be **lowercase**. * Some files, such as top-level markdown files, are exceptions. * Documents should be word-wrapped at 80 characters. * The formatting described in `.editorconfig` is preferred. @@ -19,10 +18,10 @@ * Generally avoid personal pronouns in reference documentation ("I", "you", "we"). * Pronouns are acceptable in more colloquial documentation, like guides. - * Use **gender-neutral pronouns** and **mass nouns**. Non-comprehensive + * Use gender-neutral pronouns and mass nouns. Non-comprehensive examples: - * **OK**: "they", "their", "them", "folks", "people", "developers", "cats" - * **NOT OK**: "his", "hers", "him", "her", "guys", "dudes" + * OK: "they", "their", "them", "folks", "people", "developers", "cats" + * NOT OK: "his", "hers", "him", "her", "guys", "dudes" * When combining wrapping elements (parentheses and quotes), terminal punctuation should be placed: * Inside the wrapping element if the wrapping element contains a complete @@ -54,7 +53,7 @@ is necessary, include it as an asset in `assets/code-examples` and link to it. * When using underscores, asterisks, and backticks, please use proper escaping - (**\\\_**, **\\\*** and **\\\`** instead of **\_**, **\*** and **\`**). + (`\_`, `\*` and ``\` `` instead of `_`, `*` and `` ` ``). * References to constructor functions should use PascalCase. * References to constructor instances should use camelCase. * References to methods should be used with parentheses: for example, diff --git a/doc/api/assert.md b/doc/api/assert.md index bf69de826c521c..58d44272705cb5 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -304,7 +304,7 @@ assert.notDeepEqual(obj1, obj3); // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } assert.notDeepEqual(obj1, obj4); -// OK, obj1 and obj2 are not deeply equal +// OK, obj1 and obj4 are not deeply equal ``` If the values are deeply equal, an `AssertionError` is thrown with a `message` diff --git a/doc/api/buffer.md b/doc/api/buffer.md index a561f0c6cc932e..442ed6204e3fab 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2408,12 +2408,12 @@ Examples: ```js const buf = Buffer.allocUnsafe(6); -buf.writeUIntBE(0x1234567890ab, 0, 6); +buf.writeIntBE(0x1234567890ab, 0, 6); // Prints: console.log(buf); -buf.writeUIntLE(0x1234567890ab, 0, 6); +buf.writeIntLE(0x1234567890ab, 0, 6); // Prints: console.log(buf); diff --git a/doc/api/child_process.md b/doc/api/child_process.md index b3484de5762890..a8baf56c69b2ba 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -304,6 +304,9 @@ output on this fd is expected to be line delimited JSON objects. *Note: Unlike the fork(2) POSIX system call, `child_process.fork()` does not clone the current process.* +*Note*: The `shell` option available in [`child_process.spawn()`][] is not +supported by `child_process.fork()` and will be ignored if set. + ### child_process.spawn(command[, args][, options]) * {boolean} Set to `true` after `subprocess.kill()` is used to successfully - terminate the child process. + send a signal to the child process. -The `subprocess.killed` property indicates whether the child process was -successfully terminated using `subprocess.kill()`. +The `subprocess.killed` property indicates whether the child process +successfully received a signal from `subprocess.kill()`. The `killed` property +does not indicate that the child process has been terminated. ### subprocess.pid diff --git a/doc/api/cli.md b/doc/api/cli.md index 41c747c1c3da75..f1b33e883ae883 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -372,7 +372,7 @@ Node options that are allowed are: V8 options that are allowed are: - `--abort-on-uncaught-exception` -- `--max_old_space_size` +- `--max-old-space-size` ### `NODE_REPL_HISTORY=file` diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 6edd92c263989b..5ac4d6730c82b5 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -5,7 +5,7 @@ > Stability: 2 - Stable A single instance of Node.js runs in a single thread. To take advantage of -multi-core systems the user will sometimes want to launch a cluster of Node.js +multi-core systems, the user will sometimes want to launch a cluster of Node.js processes to handle the load. The cluster module allows you to easily create child processes that diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 4fe8ab95ed5e17..4a7488ba6f2f70 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1102,7 +1102,11 @@ rapidly. In line with OpenSSL's recommendation to use pbkdf2 instead of [`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] -to create the `Cipher` object. +to create the `Cipher` object. Users should not use ciphers with counter mode +(e.g. CTR, GCM or CCM) in `crypto.createCipher()`. A warning is emitted when +they are used in order to avoid the risk of IV reuse that causes +vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting +Adversaries][] for details. ### crypto.createCipheriv(algorithm, key, iv) @@ -1465,6 +1469,7 @@ All paddings are defined in `crypto.constants`. added: v6.6.0 --> +This function is based on a constant-time algorithm. Returns true if `a` is equal to `b`, without leaking timing information that would allow an attacker to guess one of the values. This is suitable for comparing HMAC digests or secret values like authentication cookies or @@ -2023,6 +2028,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL. [NIST SP 800-131A]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf [NIST SP 800-132]: http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf [OpenSSL cipher list format]: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT +[Nonce-Disrespecting Adversaries]: https://github.com/nonce-disrespect/nonce-disrespect [OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/man1.0.2/apps/spkac.html [publicly trusted list of CAs]: https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt [RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt diff --git a/doc/api/events.md b/doc/api/events.md index 1cffb5e2d5855f..9e6cd371bba506 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -77,7 +77,7 @@ myEmitter.emit('event', 'a', 'b'); ## Asynchronous vs. Synchronous -The `EventListener` calls all listeners synchronously in the order in which +The `EventEmitter` calls all listeners synchronously in the order in which they were registered. This is important to ensure the proper sequencing of events and to avoid race conditions or logic errors. When appropriate, listener functions can switch to an asynchronous mode of operation using @@ -262,7 +262,7 @@ for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners` property can be used. Take caution when setting the `EventEmitter.defaultMaxListeners` because the -change effects *all* `EventEmitter` instances, including those created before +change affects *all* `EventEmitter` instances, including those created before the change is made. However, calling [`emitter.setMaxListeners(n)`][] still has precedence over `EventEmitter.defaultMaxListeners`. diff --git a/doc/api/fs.md b/doc/api/fs.md index 08fbf62b9363cf..689f38af3c4758 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -954,7 +954,7 @@ If the file previously was shorter than `len` bytes, it is extended, and the extended part is filled with null bytes ('\0'). For example, ```js -console.log(fs.readFileSync('temp.txt', 'utf-8')); +console.log(fs.readFileSync('temp.txt', 'utf8')); // Prints: Node.js // get the file descriptor of the file to be truncated @@ -1925,6 +1925,15 @@ you need to compare `curr.mtime` and `prev.mtime`. `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. +*Note:* When a file being watched by `fs.watchFile()` disappears and reappears, +then the `previousStat` reported in the second callback event (the file's +reappearance) will be the same as the `previousStat` of the first callback +event (its disappearance). + +This happens when: +- the file is deleted, followed by a restore +- the file is renamed twice - the second time back to its original name + ## fs.write(fd, buffer[, offset[, length[, position]]], callback) -* `src` {[Readable][] Stream} The source stream that +* `src` {stream.Readable} The source stream that [unpiped][`stream.unpipe()`] this writable The `'unpipe'` event is emitted when the [`stream.unpipe()`][] method is called @@ -1407,6 +1407,47 @@ class MyWritable extends Writable { } ``` +#### Decoding buffers in a Writable Stream + +Decoding buffers is a common task, for instance, when using transformers whose +input is a string. This is not a trivial process when using multi-byte +characters encoding, such as UTF-8. The following example shows how to decode +multi-byte strings using `StringDecoder` and [Writable][]. + +```js +const { Writable } = require('stream'); +const { StringDecoder } = require('string_decoder'); + +class StringWritable extends Writable { + constructor(options) { + super(options); + const state = this._writableState; + this._decoder = new StringDecoder(state.defaultEncoding); + this.data = ''; + } + _write(chunk, encoding, callback) { + if (encoding === 'buffer') { + chunk = this._decoder.write(chunk); + } + this.data += chunk; + callback(); + } + _final(callback) { + this.data += this._decoder.end(); + callback(); + } +} + +const euro = [[0xE2, 0x82], [0xAC]].map(Buffer.from); +const w = new StringWritable(); + +w.write('currency: '); +w.write(euro[0]); +w.end(euro[1]); + +console.log(w.data); // currency: € +``` + ### Implementing a Readable Stream The `stream.Readable` class is extended to implement a [Readable][] stream. diff --git a/doc/api/tty.md b/doc/api/tty.md index 2950eb6db1a396..497f53509d5a16 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -90,15 +90,6 @@ process.stdout.on('resize', () => { }); ``` -*Note*: On Windows resize events will be emitted only if stdin is unpaused -(by a call to `resume()` or by adding a data listener) and in raw mode. It can -also be triggered if a terminal control sequence that moves the cursor is -written to the screen. Also, the resize event will only be signaled if the -console screen buffer height was also changed. For example shrinking the -console window height will not cause the resize event to be emitted. Increasing -the console window height will only be registered when the new console window -height is greater than the current console buffer size. - ### writeStream.columns The `vm` module provides APIs for compiling and running code within V8 Virtual -Machine contexts. It can be accessed using: +Machine contexts. + +JavaScript code can be compiled and run immediately or +compiled, saved, and run later. + +A common use case is to run the code in a sandboxed environment. +The sandboxed code uses a different V8 Context, meaning that +it has a different global object than the rest of the code. + +One can provide the context by ["contextifying"][contextified] a sandbox +object. The sandboxed code treats any property on the sandbox like a +global variable. Any changes on global variables caused by the sandboxed +code are reflected in the sandbox object. ```js const vm = require('vm'); -``` -JavaScript code can be compiled and run immediately or compiled, saved, and run -later. +const x = 1; + +const sandbox = { x: 2 }; +vm.createContext(sandbox); // Contextify the sandbox. + +const code = 'x += 40; var y = 17;'; +// x and y are global variables in the sandboxed environment. +// Initially, x has the value 2 because that is the value of sandbox.x. +vm.runInContext(code, sandbox); + +console.log(sandbox.x); // 42 +console.log(sandbox.y); // 17 + +console.log(x); // 1; y is not defined. +``` *Note*: The vm module is not a security mechanism. **Do not use it to run untrusted code**. diff --git a/doc/api/zlib.md b/doc/api/zlib.md index a042379fba42c5..6cef23824977c9 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -363,6 +363,13 @@ added: v0.5.8 Not exported by the `zlib` module. It is documented here because it is the base class of the compressor/decompressor classes. +### zlib.close([callback]) + + +Close the underlying handle. + ### zlib.flush([kind], callback) \n` + - inc + `\n\n`; - input = input.split(include + '\n').join(includeData[fname] + '\n'); + `${inc}\n\n`; + input = input.split(`${include}\n`).join(`${includeData[fname]}\n`); if (incCount === 0) { return cb(null, input); } diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 3f1ea9597c4fbe..c2bca80641152e 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -40,6 +40,8 @@ const typeMap = { 'http.ServerResponse': 'http.html#http_class_http_serverresponse', }; +const arrayPart = /(?:\[])+$/; + module.exports = { toLink: function(typeInput) { const typeLinks = []; @@ -51,12 +53,10 @@ module.exports = { if (typeText) { let typeUrl = null; - // To support type[], we store the full string and use - // the bracket-less version to lookup the type URL + // To support type[], type[][] etc., we store the full string + // and use the bracket-less version to lookup the type URL const typeTextFull = typeText; - if (/\[]$/.test(typeText)) { - typeText = typeText.slice(0, -2); - } + typeText = typeText.replace(arrayPart, ''); const primitive = jsPrimitives[typeText.toLowerCase()]; diff --git a/tools/install.py b/tools/install.py index 131f5be8833afc..5abcde49c16a2d 100755 --- a/tools/install.py +++ b/tools/install.py @@ -33,6 +33,7 @@ def try_unlink(path): def try_symlink(source_path, link_path): print 'symlinking %s -> %s' % (source_path, link_path) try_unlink(link_path) + try_mkdir_r(os.path.dirname(link_path)) os.symlink(source_path, link_path) def try_mkdir_r(path): diff --git a/tools/test.py b/tools/test.py index 207f39ebfce1ed..e7c01c8658b23d 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1578,7 +1578,7 @@ def Main(): } test_list = root.ListTests([], path, context, arch, mode) unclassified_tests += test_list - (cases, unused_rules, all_outcomes) = ( + (cases, unused_rules, _) = ( config.ClassifyTests(test_list, env)) if globally_unused_rules is None: globally_unused_rules = set(unused_rules) diff --git a/vcbuild.bat b/vcbuild.bat index 78f3c242455f3c..e6a6d0d20f7ac2 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -383,8 +383,10 @@ if %errorlevel% equ 0 goto exit echo %1 | findstr /c:"src\tree.h" if %errorlevel% equ 0 goto exit -@rem skip subfolders under /src -echo %1 | findstr /r /c:"src\\.*\\.*" +echo %1 | findstr /r /c:"src\\tracing\\trace_event.h" +if %errorlevel% equ 0 goto exit + +echo %1 | findstr /r /c:"src\\tracing\\trace_event_common.h" if %errorlevel% equ 0 goto exit echo %1 | findstr /r /c:"test\\addons\\[0-9].*_.*\.h"