-
-Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. For
-more information on using Node.js, see the
-[Node.js Website][].
-
-The Node.js project is supported by the
-[Node.js Foundation](https://nodejs.org/en/foundation/). Contributions,
-policies, and releases are managed under an
-[open governance model](./GOVERNANCE.md).
-
-**This project is bound by a [Code of Conduct][].**
-
-
-# Table of Contents
-
-* [Support](#support)
-* [Release Types](#release-types)
- * [Download](#download)
- * [Current and LTS Releases](#current-and-lts-releases)
- * [Nightly Releases](#nightly-releases)
- * [API Documentation](#api-documentation)
- * [Verifying Binaries](#verifying-binaries)
-* [Building Node.js](#building-nodejs)
-* [Security](#security)
-* [Current Project Team Members](#current-project-team-members)
- * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee)
- * [Collaborators](#collaborators)
- * [Release Team](#release-team)
-* [Contributing to Node.js](#contributing-to-nodejs)
-
-## Support
-
-Node.js contributors have limited availability to address general support
-questions. Please make sure you are using a [currently-supported version of
-Node.js](https://github.com/nodejs/Release#release-schedule).
-
-When looking for support, please first search for your question in these venues:
-
-* [Node.js Website][]
-* [Node.js Help][]
-* [Open or closed issues in the Node.js GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Anodejs+is%3Aissue)
-
-If you didn't find an answer in one of the official resources above, you can
-search these unofficial resources:
-
-* [Questions tagged 'node.js' on StackOverflow][]
-* [#node.js channel on chat.freenode.net][]. See for more
- information.
-* [Node.js Discord Community](https://discordapp.com/invite/v7rrPdE)
-* [Node.js Slack Community](https://node-js.slack.com/): Visit
- [nodeslackers.com](http://www.nodeslackers.com/) to register.
-
-GitHub issues are meant for tracking enhancements and bugs, not general support.
-
-Remember, libre != gratis; the open source license grants you the freedom to use
-and modify, but not commitments of other people's time. Please be respectful,
-and set your expectations accordingly.
-
-## Release Types
-
-The Node.js project maintains multiple types of releases:
-
-* **Current**: Released from active development branches of this repository,
- versioned by [SemVer](https://semver.org) and signed by a member of the
- [Release Team](#release-team).
- Code for Current releases is organized in this repository by major version
- number. For example: [v4.x](https://github.com/nodejs/node/tree/v4.x).
- The major version number of Current releases will increment every 6 months
- allowing for breaking changes to be introduced. This happens in April and
- October every year. Current release lines beginning in October each year have
- a maximum support life of 8 months. Current release lines beginning in April
- each year will convert to LTS (see below) after 6 months and receive further
- support for 30 months.
-* **LTS**: Releases that receive Long-term Support, with a focus on stability
- and security. Every second Current release line (major version) will become an
- LTS line and receive 18 months of _Active LTS_ support and a further 12
- months of _Maintenance_. LTS release lines are given alphabetically
- 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.
-* **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
-.
-
-#### Current and LTS Releases
-**Current** and **LTS** releases are available at
-, listed under their version strings.
-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
-, listed under their version
-string which includes their date (in UTC time) and the commit SHA at
-the HEAD of the release.
-
-#### API Documentation
-**API documentation** is available in each release and nightly
-directory under _docs_. points to the API
-documentation of the latest stable version.
-
-### Verifying Binaries
-
-Current, LTS, and Nightly download directories all contain a SHASUMS256.txt
-file that lists the SHA checksums for each file available for
-download.
-
-The SHASUMS256.txt can be downloaded using `curl`.
+This is the official [V8](https://github.com/v8/v8/wiki) fork of [Node.js](https://github.com/nodejs/node) with a recent V8 version.
+To build from source, run
```console
-$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
+git clone https://github.com/v8/node v8-node
+cd v8-node
+./configure --build-v8-with-gn
+make -j4 node
```
-To check that a downloaded file matches the checksum, run
-it through `sha256sum` with a command such as:
+Or download the latest build for Ubuntu from this [build bot](https://build.chromium.org/p/client.v8.fyi/builders/V8%20-%20node.js%20integration). Select a build, then use *Archive link download*.
+To check the V8 version in Node, have a look at [`v8-version.h`](https://github.com/v8/node/blob/vee-eight-lkgr/deps/v8/include/v8-version.h) or run
```console
-$ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
-```
-
-Current and LTS releases (but not Nightlies) also have the GPG detached
-signature of SHASUMS256.txt available as SHASUMS256.txt.sig. You can use `gpg`
-to verify that SHASUMS256.txt has not been tampered with.
-
-To verify SHASUMS256.txt has not been altered, you will first need to import
-all of the GPG keys of individuals authorized to create releases. They are
-listed at the bottom of this README under [Release Team](#release-team).
-Use a command such as this to import the keys:
-
-```console
-$ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
-```
-
-See the bottom of this README for a full script to import active release keys.
-
-Next, download the SHASUMS256.txt.sig for the release:
-
-```console
-$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig
-```
-
-After downloading the appropriate SHASUMS256.txt and SHASUMS256.txt.sig files,
-you can then use `gpg --verify SHASUMS256.txt.sig SHASUMS256.txt` to verify
-that the file has been signed by an authorized member of the Node.js team.
-
-Once verified, use the SHASUMS256.txt file to get the checksum for
-the binary verification command above.
-
-## Building Node.js
-
-See [BUILDING.md](BUILDING.md) for instructions on how to build
-Node.js from source. The document also contains a list of
-officially supported platforms.
-
-## Security
-
-Security flaws in Node.js should be reported by emailing security@nodejs.org.
-Please do not disclose security bugs publicly until they have been handled by
-the security team.
-
-Your email will be acknowledged within 24 hours, and you will receive a more
-detailed response to your email within 48 hours indicating the next steps in
-handling your report.
-
-There are no hard and fast rules to determine if a bug is worth reporting as
-a security issue. The general rule is an issue worth reporting should allow an
-attacker to compromise the confidentiality, integrity, or availability of the
-Node.js application or its system for which the attacker does not already have
-the capability.
-
-To illustrate the point, here are some examples of past issues and what the
-Security Response Team thinks of them. When in doubt, however, please do send
-us a report nonetheless.
-
-
-### Public disclosure preferred
-
-- [#14519](https://github.com/nodejs/node/issues/14519): _Internal domain
- function can be used to cause segfaults_. Causing program termination using
- either the public JavaScript APIs or the private bindings layer APIs requires
- the ability to execute arbitrary JavaScript code, which is already the highest
- level of privilege possible.
-
-- [#12141](https://github.com/nodejs/node/pull/12141): _buffer: zero fill
- Buffer(num) by default_. The buffer constructor behavior was documented,
- but found to be prone to [mis-use](https://snyk.io/blog/exploiting-buffer/).
- It has since been changed, but despite much debate, was not considered misuse
- prone enough to justify fixing in older release lines and breaking our
- API stability contract.
-
-### Private disclosure preferred
-
-- [CVE-2016-7099](https://nodejs.org/en/blog/vulnerability/september-2016-security-releases/):
- _Fix invalid wildcard certificate validation check_. This is a high severity
- defect that would allow a malicious TLS server to serve an invalid wildcard
- certificate for its hostname and be improperly validated by a Node.js client.
-
-- [#5507](https://github.com/nodejs/node/pull/5507): _Fix a defect that makes
- the CacheBleed Attack possible_. Many, though not all, OpenSSL vulnerabilities
- in the TLS/SSL protocols also affect Node.js.
-
-- [CVE-2016-2216](https://nodejs.org/en/blog/vulnerability/february-2016-security-releases/):
- _Fix defects in HTTP header parsing for requests and responses that can allow
- response splitting_. While the impact of this vulnerability is application and
- network dependent, it is remotely exploitable in the HTTP protocol.
-
-When in doubt, please do send us a report.
-
-
-## Current Project Team Members
-
-The Node.js project team comprises a group of core collaborators and a sub-group
-that forms the _Technical Steering Committee_ (TSC) which governs the project.
-For more information about the governance of the Node.js project, see
-[GOVERNANCE.md](./GOVERNANCE.md).
-
-### TSC (Technical Steering Committee)
-
-* [addaleax](https://github.com/addaleax) -
-**Anna Henningsen** <anna@addaleax.net> (she/her)
-* [ChALkeR](https://github.com/ChALkeR) -
-**Сковорода Никита Андреевич** <chalkerx@gmail.com> (he/him)
-* [cjihrig](https://github.com/cjihrig) -
-**Colin Ihrig** <cjihrig@gmail.com>
-* [danbev](https://github.com/danbev) -
-**Daniel Bevenius** <daniel.bevenius@gmail.com>
-* [fhinkel](https://github.com/fhinkel) -
-**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> (she/her)
-* [Fishrock123](https://github.com/Fishrock123) -
-**Jeremiah Senkpiel** <fishrock123@rocketmail.com>
-* [gibfahn](https://github.com/gibfahn) -
-**Gibson Fahnestock** <gibfahn@gmail.com> (he/him)
-* [jasnell](https://github.com/jasnell) -
-**James M Snell** <jasnell@gmail.com> (he/him)
-* [joyeecheung](https://github.com/joyeecheung) -
-**Joyee Cheung** <joyeec9h3@gmail.com> (she/her)
-* [mcollina](https://github.com/mcollina) -
-**Matteo Collina** <matteo.collina@gmail.com> (he/him)
-* [mhdawson](https://github.com/mhdawson) -
-**Michael Dawson** <michael_dawson@ca.ibm.com> (he/him)
-* [MylesBorins](https://github.com/MylesBorins) -
-**Myles Borins** <myles.borins@gmail.com> (he/him)
-* [ofrobots](https://github.com/ofrobots) -
-**Ali Ijaz Sheikh** <ofrobots@google.com> (he/him)
-* [rvagg](https://github.com/rvagg) -
-**Rod Vagg** <rod@vagg.org>
-* [targos](https://github.com/targos) -
-**Michaël Zasso** <targos@protonmail.com> (he/him)
-* [thefourtheye](https://github.com/thefourtheye) -
-**Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> (he/him)
-* [TimothyGu](https://github.com/TimothyGu) -
-**Tiancheng "Timothy" Gu** <timothygu99@gmail.com> (he/him)
-* [Trott](https://github.com/Trott) -
-**Rich Trott** <rtrott@gmail.com> (he/him)
-
-### TSC Emeriti
-
-* [bnoordhuis](https://github.com/bnoordhuis) -
-**Ben Noordhuis** <info@bnoordhuis.nl>
-* [chrisdickinson](https://github.com/chrisdickinson) -
-**Chris Dickinson** <christopher.s.dickinson@gmail.com>
-* [evanlucas](https://github.com/evanlucas) -
-**Evan Lucas** <evanlucas@me.com> (he/him)
-* [indutny](https://github.com/indutny) -
-**Fedor Indutny** <fedor.indutny@gmail.com>
-* [isaacs](https://github.com/isaacs) -
-**Isaac Z. Schlueter** <i@izs.me>
-* [joshgav](https://github.com/joshgav) -
-**Josh Gavant** <josh.gavant@outlook.com>
-* [mscdex](https://github.com/mscdex) -
-**Brian White** <mscdex@mscdex.net>
-* [nebrius](https://github.com/nebrius) -
-**Bryan Hughes** <bryan@nebri.us>
-* [orangemocha](https://github.com/orangemocha) -
-**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)
-* [trevnorris](https://github.com/trevnorris) -
-**Trevor Norris** <trev.norris@gmail.com>
-
-### Collaborators
-
-* [addaleax](https://github.com/addaleax) -
-**Anna Henningsen** <anna@addaleax.net> (she/her)
-* [ak239](https://github.com/ak239) -
-**Aleksei Koziatinskii** <ak239spb@gmail.com>
-* [andrasq](https://github.com/andrasq) -
-**Andras** <andras@kinvey.com>
-* [AndreasMadsen](https://github.com/AndreasMadsen) -
-**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)
-* [bcoe](https://github.com/bcoe) -
-**Ben Coe** <bencoe@gmail.com> (he/him)
-* [bengl](https://github.com/bengl) -
-**Bryan English** <bryan@bryanenglish.com> (he/him)
-* [benjamingr](https://github.com/benjamingr) -
-**Benjamin Gruenbaum** <benjamingr@gmail.com>
-* [BethGriggs](https://github.com/BethGriggs) -
-**Beth Griggs** <Bethany.Griggs@uk.ibm.com> (she/her)
-* [bmeck](https://github.com/bmeck) -
-**Bradley Farias** <bradley.meck@gmail.com>
-* [bmeurer](https://github.com/bmeurer) -
-**Benedikt Meurer** <benedikt.meurer@gmail.com>
-* [bnoordhuis](https://github.com/bnoordhuis) -
-**Ben Noordhuis** <info@bnoordhuis.nl>
-* [brendanashworth](https://github.com/brendanashworth) -
-**Brendan Ashworth** <brendan.ashworth@me.com>
-* [BridgeAR](https://github.com/BridgeAR) -
-**Ruben Bridgewater** <ruben@bridgewater.de>
-* [bzoz](https://github.com/bzoz) -
-**Bartosz Sosnowski** <bartosz@janeasystems.com>
-* [calvinmetcalf](https://github.com/calvinmetcalf) -
-**Calvin Metcalf** <calvin.metcalf@gmail.com>
-* [ChALkeR](https://github.com/ChALkeR) -
-**Сковорода Никита Андреевич** <chalkerx@gmail.com> (he/him)
-* [chrisdickinson](https://github.com/chrisdickinson) -
-**Chris Dickinson** <christopher.s.dickinson@gmail.com>
-* [cjihrig](https://github.com/cjihrig) -
-**Colin Ihrig** <cjihrig@gmail.com>
-* [claudiorodriguez](https://github.com/claudiorodriguez) -
-**Claudio Rodriguez** <cjrodr@yahoo.com>
-* [codebytere](https://github.com/codebytere) -
-**Shelley Vohr** <codebytere@gmail.com> (she/her)
-* [danbev](https://github.com/danbev) -
-**Daniel Bevenius** <daniel.bevenius@gmail.com>
-* [DavidCai1993](https://github.com/DavidCai1993) -
-**David Cai** <davidcai1993@yahoo.com> (he/him)
-* [davisjam](https://github.com/davisjam) -
-**Jamie Davis** <davisjam@vt.edu> (he/him)
-* [devsnek](https://github.com/devsnek) -
-**Gus Caplan** <me@gus.host> (he/him)
-* [edsadr](https://github.com/edsadr) -
-**Adrian Estrada** <edsadr@gmail.com> (he/him)
-* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
-**Robert Jefe Lindstaedt** <robert.lindstaedt@gmail.com>
-* [estliberitas](https://github.com/estliberitas) -
-**Alexander Makarenko** <estliberitas@gmail.com>
-* [eugeneo](https://github.com/eugeneo) -
-**Eugene Ostroukhov** <eostroukhov@google.com>
-* [evanlucas](https://github.com/evanlucas) -
-**Evan Lucas** <evanlucas@me.com> (he/him)
-* [fhinkel](https://github.com/fhinkel) -
-**Franziska Hinkelmann** <franziska.hinkelmann@gmail.com> (she/her)
-* [firedfox](https://github.com/firedfox) -
-**Daniel Wang** <wangyang0123@gmail.com>
-* [Fishrock123](https://github.com/Fishrock123) -
-**Jeremiah Senkpiel** <fishrock123@rocketmail.com>
-* [gabrielschulhof](https://github.com/gabrielschulhof) -
-**Gabriel Schulhof** <gabriel.schulhof@intel.com>
-* [geek](https://github.com/geek) -
-**Wyatt Preul** <wpreul@gmail.com>
-* [gibfahn](https://github.com/gibfahn) -
-**Gibson Fahnestock** <gibfahn@gmail.com> (he/him)
-* [gireeshpunathil](https://github.com/gireeshpunathil) -
-**Gireesh Punathil** <gpunathi@in.ibm.com> (he/him)
-* [guybedford](https://github.com/guybedford) -
-**Guy Bedford** <guybedford@gmail.com> (he/him)
-* [hashseed](https://github.com/hashseed) -
-**Yang Guo** <yangguo@chromium.org> (he/him)
-* [hiroppy](https://github.com/hiroppy) -
-**Yuta Hiroto** <hello@hiroppy.me> (he/him)
-* [iarna](https://github.com/iarna) -
-**Rebecca Turner** <me@re-becca.org>
-* [imyller](https://github.com/imyller) -
-**Ilkka Myller** <ilkka.myller@nodefield.com>
-* [indutny](https://github.com/indutny) -
-**Fedor Indutny** <fedor.indutny@gmail.com>
-* [italoacasas](https://github.com/italoacasas) -
-**Italo A. Casas** <me@italoacasas.com> (he/him)
-* [JacksonTian](https://github.com/JacksonTian) -
-**Jackson Tian** <shyvo1987@gmail.com>
-* [jasnell](https://github.com/jasnell) -
-**James M Snell** <jasnell@gmail.com> (he/him)
-* [jasongin](https://github.com/jasongin) -
-**Jason Ginchereau** <jasongin@microsoft.com>
-* [jbergstroem](https://github.com/jbergstroem) -
-**Johan Bergström** <bugs@bergstroem.nu>
-* [jdalton](https://github.com/jdalton) -
-**John-David Dalton** <john.david.dalton@gmail.com>
-* [jhamhader](https://github.com/jhamhader) -
-**Yuval Brik** <yuval@brik.org.il>
-* [jkrems](https://github.com/jkrems) -
-**Jan Krems** <jan.krems@gmail.com> (he/him)
-* [joaocgreis](https://github.com/joaocgreis) -
-**João Reis** <reis@janeasystems.com>
-* [joshgav](https://github.com/joshgav) -
-**Josh Gavant** <josh.gavant@outlook.com>
-* [joyeecheung](https://github.com/joyeecheung) -
-**Joyee Cheung** <joyeec9h3@gmail.com> (she/her)
-* [julianduque](https://github.com/julianduque) -
-**Julian Duque** <julianduquej@gmail.com> (he/him)
-* [JungMinu](https://github.com/JungMinu) -
-**Minwoo Jung** <minwoo@nodesource.com> (he/him)
-* [kfarnung](https://github.com/kfarnung) -
-**Kyle Farnung** <kfarnung@microsoft.com> (he/him)
-* [kunalspathak](https://github.com/kunalspathak) -
-**Kunal Pathak** <kunal.pathak@microsoft.com>
-* [lance](https://github.com/lance) -
-**Lance Ball** <lball@redhat.com>
-* [Leko](https://github.com/Leko) -
-**Shingo Inoue** <leko.noor@gmail.com> (he/him)
-* [lpinca](https://github.com/lpinca) -
-**Luigi Pinca** <luigipinca@gmail.com> (he/him)
-* [lucamaraschi](https://github.com/lucamaraschi) -
-**Luca Maraschi** <luca.maraschi@gmail.com> (he/him)
-* [maclover7](https://github.com/maclover7) -
-**Jon Moss** <me@jonathanmoss.me> (he/him)
-* [mafintosh](https://github.com/mafintosh)
-**Mathias Buus** <mathiasbuus@gmail.com> (he/him)
-* [mcollina](https://github.com/mcollina) -
-**Matteo Collina** <matteo.collina@gmail.com> (he/him)
-* [mhdawson](https://github.com/mhdawson) -
-**Michael Dawson** <michael_dawson@ca.ibm.com> (he/him)
-* [misterdjules](https://github.com/misterdjules) -
-**Julien Gilli** <jgilli@nodejs.org>
-* [mmarchini](https://github.com/mmarchini) -
-**Matheus Marchini** <matheus@sthima.com>
-* [MoonBall](https://github.com/MoonBall) -
-**Chen Gang** <gangc.cxy@foxmail.com>
-* [mscdex](https://github.com/mscdex) -
-**Brian White** <mscdex@mscdex.net>
-* [MylesBorins](https://github.com/MylesBorins) -
-**Myles Borins** <myles.borins@gmail.com> (he/him)
-* [not-an-aardvark](https://github.com/not-an-aardvark) -
-**Teddy Katz** <teddy.katz@gmail.com>
-* [ofrobots](https://github.com/ofrobots) -
-**Ali Ijaz Sheikh** <ofrobots@google.com> (he/him)
-* [orangemocha](https://github.com/orangemocha) -
-**Alexis Campailla** <orangemocha@nodejs.org>
-* [othiym23](https://github.com/othiym23) -
-**Forrest L Norvell** <ogd@aoaioxxysz.net> (he/him)
-* [phillipj](https://github.com/phillipj) -
-**Phillip Johnsen** <johphi@gmail.com>
-* [pmq20](https://github.com/pmq20) -
-**Minqi Pan** <pmq2001@gmail.com>
-* [princejwesley](https://github.com/princejwesley) -
-**Prince John Wesley** <princejohnwesley@gmail.com>
-* [Qard](https://github.com/Qard) -
-**Stephen Belanger** <admin@stephenbelanger.com> (he/him)
-* [refack](https://github.com/refack) -
-**Refael Ackermann** <refack@gmail.com> (he/him)
-* [richardlau](https://github.com/richardlau) -
-**Richard Lau** <riclau@uk.ibm.com>
-* [ronkorving](https://github.com/ronkorving) -
-**Ron Korving** <ron@ronkorving.nl>
-* [RReverser](https://github.com/RReverser) -
-**Ingvar Stepanyan** <me@rreverser.com>
-* [rvagg](https://github.com/rvagg) -
-**Rod Vagg** <rod@vagg.org>
-* [ryzokuken](https://github.com/ryzokuken) -
-**Ujjwal Sharma** <usharma1998@gmail.com> (he/him)
-* [saghul](https://github.com/saghul) -
-**Saúl Ibarra Corretgé** <saghul@gmail.com>
-* [sam-github](https://github.com/sam-github) -
-**Sam Roberts** <vieuxtech@gmail.com>
-* [santigimeno](https://github.com/santigimeno) -
-**Santiago Gimeno** <santiago.gimeno@gmail.com>
-* [sebdeckers](https://github.com/sebdeckers) -
-**Sebastiaan Deckers** <sebdeckers83@gmail.com>
-* [seishun](https://github.com/seishun) -
-**Nikolai Vavilov** <vvnicholas@gmail.com>
-* [shigeki](https://github.com/shigeki) -
-**Shigeki Ohtsu** <ohtsu@ohtsu.org> (he/him)
-* [silverwind](https://github.com/silverwind) -
-**Roman Reiss** <me@silverwind.io>
-* [srl295](https://github.com/srl295) -
-**Steven R Loomis** <srloomis@us.ibm.com>
-* [starkwang](https://github.com/starkwang) -
-**Weijia Wang** <starkwang@126.com>
-* [stefanmb](https://github.com/stefanmb) -
-**Stefan Budeanu** <stefan@budeanu.com>
-* [targos](https://github.com/targos) -
-**Michaël Zasso** <targos@protonmail.com> (he/him)
-* [thefourtheye](https://github.com/thefourtheye) -
-**Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> (he/him)
-* [thekemkid](https://github.com/thekemkid) -
-**Glen Keane** <glenkeane.94@gmail.com> (he/him)
-* [thlorenz](https://github.com/thlorenz) -
-**Thorsten Lorenz** <thlorenz@gmx.de>
-* [TimothyGu](https://github.com/TimothyGu) -
-**Tiancheng "Timothy" Gu** <timothygu99@gmail.com> (he/him)
-* [tniessen](https://github.com/tniessen) -
-**Tobias Nießen** <tniessen@tnie.de>
-* [trevnorris](https://github.com/trevnorris) -
-**Trevor Norris** <trev.norris@gmail.com>
-* [trivikr](https://github.com/trivikr) -
-**Trivikram Kamat** <trivikr.dev@gmail.com>
-* [Trott](https://github.com/Trott) -
-**Rich Trott** <rtrott@gmail.com> (he/him)
-* [vdeturckheim](https://github.com/vdeturckheim) -
-**Vladimir de Turckheim** <vlad2t@hotmail.com> (he/him)
-* [vkurchatkin](https://github.com/vkurchatkin) -
-**Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com>
-* [vsemozhetbyt](https://github.com/vsemozhetbyt) -
-**Vse Mozhet Byt** <vsemozhetbyt@gmail.com> (he/him)
-* [watilde](https://github.com/watilde) -
-**Daijiro Wachi** <daijiro.wachi@gmail.com> (he/him)
-* [watson](https://github.com/watson) -
-**Thomas Watson** <w@tson.dk>
-* [whitlockjc](https://github.com/whitlockjc) -
-**Jeremy Whitlock** <jwhitlock@apache.org>
-* [XadillaX](https://github.com/XadillaX) -
-**Khaidi Chu** <i@2333.moe> (he/him)
-* [yhwang](https://github.com/yhwang) -
-**Yihong Wang** <yh.wang@ibm.com>
-* [yorkie](https://github.com/yorkie) -
-**Yorkie Liu** <yorkiefixer@gmail.com>
-* [yosuke-furukawa](https://github.com/yosuke-furukawa) -
-**Yosuke Furukawa** <yosuke.furukawa@gmail.com>
-
-### Collaborator Emeriti
-
-* [imran-iq](https://github.com/imran-iq) -
-**Imran Iqbal** <imran@imraniqbal.org>
-* [isaacs](https://github.com/isaacs) -
-**Isaac Z. Schlueter** <i@izs.me>
-* [lxe](https://github.com/lxe) -
-**Aleksey Smolenchuk** <lxe@lxe.co>
-* [matthewloring](https://github.com/matthewloring) -
-**Matthew Loring** <mattloring@google.com>
-* [micnic](https://github.com/micnic) -
-**Nicu Micleușanu** <micnic90@gmail.com> (he/him)
-* [mikeal](https://github.com/mikeal) -
-**Mikeal Rogers** <mikeal.rogers@gmail.com>
-* [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>
-* [rmg](https://github.com/rmg) -
-**Ryan Graham** <r.m.graham@gmail.com>
-* [robertkowalski](https://github.com/robertkowalski) -
-**Robert Kowalski** <rok@kowalski.gd>
-* [romankl](https://github.com/romankl) -
-**Roman Klauke** <romaaan.git@gmail.com>
-* [tellnes](https://github.com/tellnes) -
-**Christian Tellnes** <christian@tellnes.no>
-* [tunniclm](https://github.com/tunniclm) -
-**Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com>
-
-Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in
-maintaining the Node.js project.
-
-### Release Team
-
-Node.js releases are signed with one of the following GPG keys:
-
-* **Colin Ihrig** <cjihrig@gmail.com>
-`94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
-* **Evan Lucas** <evanlucas@me.com>
-`B9AE9905FFD7803F25714661B63B535A4C206CA9`
-* **Gibson Fahnestock** <gibfahn@gmail.com>
-`77984A986EBC2AA786BC0F66B01FBB92821C587A`
-* **James M Snell** <jasnell@keybase.io>
-`71DCFD284A79C3B38668286BC97EC7A07EDE3FC1`
-* **Jeremiah Senkpiel** <fishrock@keybase.io>
-`FD3A5288F042B6850C66B31F09FE44734EB7990E`
-* **Michaël Zasso** <targos@protonmail.com>
-`8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600`
-* **Myles Borins** <myles.borins@gmail.com>
-`C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8`
-* **Rod Vagg** <rod@vagg.org>
-`DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
-
-The full set of trusted release keys can be imported by running:
-
-```shell
-gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
-gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9
-gpg --keyserver pool.sks-keyservers.net --recv-keys 77984A986EBC2AA786BC0F66B01FBB92821C587A
-gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
-gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E
-gpg --keyserver pool.sks-keyservers.net --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600
-gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8
-gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+node -e "console.log(process.versions.v8)"
```
-
-See the section above on [Verifying Binaries](#verifying-binaries) for details
-on what to do with these keys to verify that a downloaded file is official.
-
-Previous releases may also have been signed with one of the following GPG keys:
-
-* **Chris Dickinson** <christopher.s.dickinson@gmail.com>
-`9554F04D7259F04124DE6B476D5A82AC7E37093B`
-* **Isaac Z. Schlueter** <i@izs.me>
-`93C7E9E91B49E432C2F75674B0A78B0A6C481CF6`
-* **Italo A. Casas** <me@italoacasas.com>
-`56730D5401028683275BD23C23EFEFE93C4CFFFE`
-* **Julien Gilli** <jgilli@fastmail.fm>
-`114F43EE0176B71C7BC219DD50A3051F888C628D`
-* **Timothy J Fontaine** <tjfontaine@gmail.com>
-`7937DFD2AB06298B2293C3187D33FF9D0246406D`
-
-## Contributing to Node.js
-
-* [Contributing to the project][]
-* [Working Groups][]
-* [Strategic Initiatives][]
-
-[Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md
-[Contributing to the project]: CONTRIBUTING.md
-[Node.js Help]: https://github.com/nodejs/help
-[Node.js Website]: https://nodejs.org/en/
-[Questions tagged 'node.js' on StackOverflow]: https://stackoverflow.com/questions/tagged/node.js
-[Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md
-[Strategic Initiatives]: https://github.com/nodejs/TSC/blob/master/Strategic-Initiatives.md
-[#node.js channel on chat.freenode.net]: https://webchat.freenode.net?channels=node.js&uio=d4
diff --git a/common.gypi b/common.gypi
index 65eb7caf575498..ae957786d43466 100644
--- a/common.gypi
+++ b/common.gypi
@@ -77,9 +77,9 @@
['build_v8_with_gn == "true"', {
'conditions': [
['GENERATOR == "ninja"', {
- 'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/libv8_monolith.a',
+ 'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/<(STATIC_LIB_PREFIX)v8_monolith<(STATIC_LIB_SUFFIX)',
}, {
- 'v8_base': '<(PRODUCT_DIR)/obj.target/v8_monolith/geni/gn/obj/libv8_monolith.a',
+ 'v8_base': '<(PRODUCT_DIR)/obj.target/v8_monolith/geni/gn/obj/<(STATIC_LIB_PREFIX)v8_monolith<(STATIC_LIB_SUFFIX)',
}],
],
}],
diff --git a/configure b/configure
index 094d8e09f745d9..ae6cc12ca94668 100755
--- a/configure
+++ b/configure
@@ -561,6 +561,28 @@ parser.add_option('--build-v8-with-gn',
dest='build_v8_with_gn',
default=False,
help='build V8 using GN instead of gyp')
+parser.add_option('--build-v8-with-gn-max-jobs',
+ dest='build_v8_with_gn_max_jobs',
+ default='',
+ help='Value for the -j parameter for the ninja invocation.')
+parser.add_option('--build-v8-with-gn-max-load',
+ dest='build_v8_with_gn_max_load',
+ default='',
+ help='Value for the -l parameter for the ninja invocation.')
+parser.add_option('--build-v8-with-gn-extra-gn-args',
+ dest='build_v8_with_gn_extra_gn_args',
+ default='',
+ help='Extra gn args to pass add to the "gn gen --args "..." invocation')
+parser.add_option('--use-clang-cl',
+ action='store_true',
+ dest='use_clang_cl',
+ default=False,
+ help='On Windows, build using clang-cl. By default, uses the copy of '
+ 'clang-cl that is bundled with V8. Requires --ninja.')
+parser.add_option('--clang-cl-base-path',
+ dest='clang_cl_base_path',
+ help='Absolute path to a directory containing a bin\\clang-cl.exe '
+ '(requires --use-clang-cl).')
# Create compile_commands.json in out/Debug and out/Release.
parser.add_option('-C',
@@ -590,6 +612,20 @@ def warn(msg):
# track if warnings occurred
warn.warned = False
+if options.use_clang_cl:
+ if not options.use_ninja:
+ warn('--use-clang-cl requires --ninja')
+ if options.clang_cl_base_path:
+ clang_base_path = options.clang_cl_base_path
+ else:
+ clang_base_path = os.path.abspath(os.path.join(
+ 'deps', 'v8', 'third_party', 'llvm-build', 'Release+Asserts'))
+ # GN arg sets the path for --build-v8-using-gn.
+ if options.build_v8_with_gn_extra_gn_args:
+ options.build_v8_with_gn_extra_gn_args += ' '
+ options.build_v8_with_gn_extra_gn_args += 'clang_base_path="{}"'.format(
+ clang_base_path)
+
def b(value):
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
if value:
@@ -1077,11 +1113,26 @@ def configure_v8(o):
if options.without_bundled_v8 and options.build_v8_with_gn:
raise Exception(
'--build-v8-with-gn is incompatible with --without-bundled-v8.')
+ o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn)
if options.build_v8_with_gn:
v8_path = os.path.join('deps', 'v8')
print('Fetching dependencies to build V8 with GN')
- options.build_v8_with_gn = FetchDeps(v8_path)
- o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn)
+ # Default to non-Googler configuration.
+ if 'DEPOT_TOOLS_WIN_TOOLCHAIN' not in os.environ:
+ os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0'
+ depot_tools = FetchDeps(v8_path)
+
+ o['variables']['build_v8_with_gn_extra_gn_args'] = (
+ options.build_v8_with_gn_extra_gn_args)
+ o['variables']['build_v8_with_gn_max_jobs'] = (
+ options.build_v8_with_gn_max_jobs)
+ o['variables']['build_v8_with_gn_max_load'] = (
+ options.build_v8_with_gn_max_load)
+ o['variables']['build_v8_with_gn_bundled_win_toolchain'] = (
+ os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', ''))
+ o['variables']['build_v8_with_gn_bundled_win_toolchain_root'] = (
+ os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN_ROOT', ''))
+ o['variables']['build_v8_with_gn_depot_tools'] = b(depot_tools)
def configure_openssl(o):
@@ -1514,6 +1565,11 @@ if 'make_fips_settings' in output:
write('config_fips.gypi', do_not_edit +
pprint.pformat(config_fips, indent=2) + '\n')
+if options.use_clang_cl:
+ make_global_settings = output.setdefault('make_global_settings', [])
+ make_global_settings.append(
+ ['CC', os.path.join(clang_base_path, 'bin', 'clang-cl')])
+
# make_global_settings should be a root level element too
if 'make_global_settings' in output:
make_global_settings = output['make_global_settings']
diff --git a/deps/inspector_protocol/CheckProtocolCompatibility.py b/deps/inspector_protocol/CheckProtocolCompatibility.py
new file mode 100755
index 00000000000000..adbc74addb551d
--- /dev/null
+++ b/deps/inspector_protocol/CheckProtocolCompatibility.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+
+import check_protocol_compatibility
+
+
+sys.exit(check_protocol_compatibility.main())
diff --git a/deps/inspector_protocol/CodeGenerator.py b/deps/inspector_protocol/CodeGenerator.py
new file mode 100755
index 00000000000000..4882ed9da5820e
--- /dev/null
+++ b/deps/inspector_protocol/CodeGenerator.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import code_generator
diff --git a/deps/inspector_protocol/ConvertProtocolToJSON.py b/deps/inspector_protocol/ConvertProtocolToJSON.py
new file mode 100755
index 00000000000000..6cfdc7fa07f058
--- /dev/null
+++ b/deps/inspector_protocol/ConvertProtocolToJSON.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import convert_protocol_to_json
+
+
+def main():
+ convert_protocol_to_json.main()
diff --git a/deps/inspector_protocol/LICENSE b/deps/inspector_protocol/LICENSE
new file mode 100644
index 00000000000000..800468e5763479
--- /dev/null
+++ b/deps/inspector_protocol/LICENSE
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/deps/inspector_protocol/OWNERS b/deps/inspector_protocol/OWNERS
new file mode 100644
index 00000000000000..8d0b6d90cb233b
--- /dev/null
+++ b/deps/inspector_protocol/OWNERS
@@ -0,0 +1,8 @@
+set noparent
+
+alph@chromium.org
+caseq@chromium.org
+dgozman@chromium.org
+kozyatinskiy@chromium.org
+pfeldman@chromium.org
+yangguo@chromium.org
diff --git a/deps/inspector_protocol/README.md b/deps/inspector_protocol/README.md
new file mode 100644
index 00000000000000..54b7c129292ecf
--- /dev/null
+++ b/deps/inspector_protocol/README.md
@@ -0,0 +1,10 @@
+# Chromium inspector (devtools) protocol
+
+This package contains code generators and templates for the Chromium
+inspector protocol.
+
+In the Chromium tree, it's rolled into
+https://cs.chromium.org/chromium/src/third_party/inspector_protocol/
+
+In the V8 tree, it's rolled into
+https://cs.chromium.org/chromium/src/v8/third_party/inspector_protocol/
diff --git a/deps/inspector_protocol/README.v8 b/deps/inspector_protocol/README.v8
new file mode 100644
index 00000000000000..1ae51d18a27640
--- /dev/null
+++ b/deps/inspector_protocol/README.v8
@@ -0,0 +1,16 @@
+Name: inspector protocol
+Short Name: inspector_protocol
+URL: https://chromium.googlesource.com/deps/inspector_protocol/
+Version: 0
+Revision: 0d4255502019144a5dec5669d7992165ae8924e7
+License: BSD
+License File: LICENSE
+Security Critical: no
+
+Description:
+src/inspector uses these scripts to generate handlers from protocol
+description.
+
+Local modifications:
+- This only includes the lib/ and templates/ directories, scripts, build
+ and the LICENSE files.
diff --git a/deps/inspector_protocol/check_protocol_compatibility.py b/deps/inspector_protocol/check_protocol_compatibility.py
new file mode 100755
index 00000000000000..7e7d9af3d63c1d
--- /dev/null
+++ b/deps/inspector_protocol/check_protocol_compatibility.py
@@ -0,0 +1,482 @@
+#!/usr/bin/env python
+# Copyright (c) 2011 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Inspector protocol validator.
+#
+# Tests that subsequent protocol changes are not breaking backwards compatibility.
+# Following violations are reported:
+#
+# - Domain has been removed
+# - Command has been removed
+# - Required command parameter was added or changed from optional
+# - Required response parameter was removed or changed to optional
+# - Event has been removed
+# - Required event parameter was removed or changed to optional
+# - Parameter type has changed.
+#
+# For the parameters with composite types the above checks are also applied
+# recursively to every property of the type.
+#
+# Adding --show_changes to the command line prints out a list of valid public API changes.
+
+import copy
+import os.path
+import optparse
+import sys
+
+import pdl
+
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
+
+def list_to_map(items, key):
+ result = {}
+ for item in items:
+ if "experimental" not in item and "hidden" not in item:
+ result[item[key]] = item
+ return result
+
+
+def named_list_to_map(container, name, key):
+ if name in container:
+ return list_to_map(container[name], key)
+ return {}
+
+
+def removed(reverse):
+ if reverse:
+ return "added"
+ return "removed"
+
+
+def required(reverse):
+ if reverse:
+ return "optional"
+ return "required"
+
+
+def compare_schemas(d_1, d_2, reverse):
+ errors = []
+ domains_1 = copy.deepcopy(d_1)
+ domains_2 = copy.deepcopy(d_2)
+ types_1 = normalize_types_in_schema(domains_1)
+ types_2 = normalize_types_in_schema(domains_2)
+
+ domains_by_name_1 = list_to_map(domains_1, "domain")
+ domains_by_name_2 = list_to_map(domains_2, "domain")
+
+ for name in domains_by_name_1:
+ domain_1 = domains_by_name_1[name]
+ if name not in domains_by_name_2:
+ errors.append("%s: domain has been %s" % (name, removed(reverse)))
+ continue
+ compare_domains(domain_1, domains_by_name_2[name], types_1, types_2, errors, reverse)
+ return errors
+
+
+def compare_domains(domain_1, domain_2, types_map_1, types_map_2, errors, reverse):
+ domain_name = domain_1["domain"]
+ commands_1 = named_list_to_map(domain_1, "commands", "name")
+ commands_2 = named_list_to_map(domain_2, "commands", "name")
+ for name in commands_1:
+ command_1 = commands_1[name]
+ if name not in commands_2:
+ errors.append("%s.%s: command has been %s" % (domain_1["domain"], name, removed(reverse)))
+ continue
+ compare_commands(domain_name, command_1, commands_2[name], types_map_1, types_map_2, errors, reverse)
+
+ events_1 = named_list_to_map(domain_1, "events", "name")
+ events_2 = named_list_to_map(domain_2, "events", "name")
+ for name in events_1:
+ event_1 = events_1[name]
+ if name not in events_2:
+ errors.append("%s.%s: event has been %s" % (domain_1["domain"], name, removed(reverse)))
+ continue
+ compare_events(domain_name, event_1, events_2[name], types_map_1, types_map_2, errors, reverse)
+
+
+def compare_commands(domain_name, command_1, command_2, types_map_1, types_map_2, errors, reverse):
+ context = domain_name + "." + command_1["name"]
+
+ params_1 = named_list_to_map(command_1, "parameters", "name")
+ params_2 = named_list_to_map(command_2, "parameters", "name")
+ # Note the reversed order: we allow removing but forbid adding parameters.
+ compare_params_list(context, "parameter", params_2, params_1, types_map_2, types_map_1, 0, errors, not reverse)
+
+ returns_1 = named_list_to_map(command_1, "returns", "name")
+ returns_2 = named_list_to_map(command_2, "returns", "name")
+ compare_params_list(context, "response parameter", returns_1, returns_2, types_map_1, types_map_2, 0, errors, reverse)
+
+
+def compare_events(domain_name, event_1, event_2, types_map_1, types_map_2, errors, reverse):
+ context = domain_name + "." + event_1["name"]
+ params_1 = named_list_to_map(event_1, "parameters", "name")
+ params_2 = named_list_to_map(event_2, "parameters", "name")
+ compare_params_list(context, "parameter", params_1, params_2, types_map_1, types_map_2, 0, errors, reverse)
+
+
+def compare_params_list(context, kind, params_1, params_2, types_map_1, types_map_2, depth, errors, reverse):
+ for name in params_1:
+ param_1 = params_1[name]
+ if name not in params_2:
+ if "optional" not in param_1:
+ errors.append("%s.%s: required %s has been %s" % (context, name, kind, removed(reverse)))
+ continue
+
+ param_2 = params_2[name]
+ if param_2 and "optional" in param_2 and "optional" not in param_1:
+ errors.append("%s.%s: %s %s is now %s" % (context, name, required(reverse), kind, required(not reverse)))
+ continue
+ type_1 = extract_type(param_1, types_map_1, errors)
+ type_2 = extract_type(param_2, types_map_2, errors)
+ compare_types(context + "." + name, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse)
+
+
+def compare_types(context, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse):
+ if depth > 5:
+ return
+
+ base_type_1 = type_1["type"]
+ base_type_2 = type_2["type"]
+
+ if base_type_1 != base_type_2:
+ errors.append("%s: %s base type mismatch, '%s' vs '%s'" % (context, kind, base_type_1, base_type_2))
+ elif base_type_1 == "object":
+ params_1 = named_list_to_map(type_1, "properties", "name")
+ params_2 = named_list_to_map(type_2, "properties", "name")
+ # If both parameters have the same named type use it in the context.
+ if "id" in type_1 and "id" in type_2 and type_1["id"] == type_2["id"]:
+ type_name = type_1["id"]
+ else:
+ type_name = "