content_type stringclasses 8 values | main_lang stringclasses 7 values | message stringlengths 1 50 | sha stringlengths 40 40 | patch stringlengths 52 962k | file_count int64 1 300 |
|---|---|---|---|---|---|
Text | Text | remove empty line in yaml block | b809792931ec89c67eabd3efb082847171c3e690 | <ide><path>doc/api/process.md
<ide> changes:
<ide> - v12.19.0
<ide> pr-url: https://github.com/nodejs/node/pull/32499
<ide> description: Calling `process.umask()` with no arguments is deprecated.
<del>
<ide> -->
<ide>
<ide> > Stability: 0 - Deprecated. Calling `process.umask()` with no argument causes | 1 |
Text | Text | turn names into links | 1e2cb0fd650a5b5990d82541251585425b2d62fe | <ide><path>SUPPORTERS.md
<ide> until then.
<ide> These wonderful people supported our Kickstarter by giving us £10 or more:
<ide>
<ide> * Simon Rascovsky
<del>* silsha (http://felixarndt.de)
<del>* Martin Kopischke (http://martin.kopischke.net)
<del>* John Kary (http://johnkary.net)
<del>* David M. Carr (http://david.carrclan.us)
<del>* Dale Tournemille (http://www.tournemille.com)
<del>* VirtualWolf (http://virtualwolf.org)
<del>* Lovingly Handmade Pornography (http://lovinglyhandmadepornography.com/)
<del>* Ben Handzo (http://handzo.com)
<del>* Jean-Philippe Sirois (http://jpsirois.com)
<del>* Sindre Sorhus (http://sindresorhus.com)
<del>* Nick Ruest (http://ruebot.net)
<del>* Steven Huey (https://twitter.com/stevehuey)
<del>* Craig Bernstein (http://cwb.us/)
<del>* Peter Murray (http://dltj.org/)
<del>* Andrew Madsen (http://www.openreelsoftware.com)
<del>* pb30 (http://pb30.com)
<del>* squaredesign (http://squaredesign.com)
<del>* Alex Burka (http://www.alexburka.com)
<add>* [silsha](http://felixarndt.de)
<add>* [Martin Kopischke](http://martin.kopischke.net)
<add>* [John Kary](http://johnkary.net)
<add>* [David M. Carr](http://david.carrclan.us)
<add>* [Dale Tournemille](http://www.tournemille.com)
<add>* [VirtualWolf](http://virtualwolf.org)
<add>* [Lovingly Handmade Pornography](http://lovinglyhandmadepornography.com/)
<add>* [Ben Handzo](http://handzo.com)
<add>* [Jean-Philippe Sirois](http://jpsirois.com)
<add>* [Sindre Sorhus](http://sindresorhus.com)
<add>* [Nick Ruest](http://ruebot.net)
<add>* [Steven Huey](https://twitter.com/stevehuey)
<add>* [Craig Bernstein](http://cwb.us/)
<add>* [Peter Murray](http://dltj.org/)
<add>* [Andrew Madsen](http://www.openreelsoftware.com)
<add>* [pb30](http://pb30.com)
<add>* [squaredesign](http://squaredesign.com)
<add>* [Alex Burka](http://www.alexburka.com)
<ide> * Ciarán Walsh
<del>* Andrew Brown (http://pvalu.es)
<del>* Bethany Sumner (http://www.bethanysumner.com/)
<del>* Orta (http://orta.github.com)
<del>* Michał Gołębiowski (http://mgol.eu)
<del>* Adam C. Foltzer (http://www.acfoltzer.net/)
<del>* Steve Hiemstra (http://www.speg.com)
<del>* Anton Sipos (http://www.softwarefuturism.com)
<del>* Sergey Nebolsin (http://fedot.com)
<del>* Dan Poltawski (http://blog.danpoltawski.co.uk)
<del>* Dieter Komendera (http://www.komendera.com/)
<del>* Lukas Westermann, at-point ag (http://at-point.ch/)
<del>* Milan Cermak (http://milancermak.com)
<del>* Sebastian Krysmanski (http://manski.net)
<del>* Mike Stenhouse (http://mikesten.com)
<del>* Alastair Stuart (http://eurotalk.com)
<del>* David Rekowski (http://rekowski.info)
<del>* Roland Leth (http://rolandleth.com)
<del>* Maurice Kelly (http://blog.chatswood.org.uk/)
<del>* Daryl Spitzer (http://twitter.com/yacitus)
<del>* Jose Peleteiro (http://peleteiro.net)
<del>* Mikael Hultgren (http://www.artsoftheinsane.com)
<del>* Richard Japenga (http://japenga.eu)
<del>* Pierre Riteau (https://github.com/priteau)
<del>* Nathan Vander Wilt (http://exts.ch)
<del>* Jean-Baptiste Escoyez (http://www.inspirationfactory.be)
<del>* Tobias Müller (http://www.twam.info)
<del>* Boris Mann (http://www.bmannconsulting.com)
<del>* Zach A. Thomas (https://github.com/zathomas)
<del>* Andrey Yunoshev (http://yunoshev.ru)
<del>* David McFarland (www.dcmcfarland.com)
<del>* Roland Tanglao (http://rolandtanglao.com)
<del>* Jacob Elder (http://jacobelder.com)
<del>* ToWatchList (http://towatchlist.com/)
<del>* Joshua Jabbour (http://about.me/joshuajabbour)
<del>* Daniel Giribet (http://dani.calidos.com)
<del>* Eric Wallmander (http://wallmander.net/)
<del>* Teakhouten meubelen (http://teakmeubelen.nl/)
<del>* Gerard "smeevil" de Brieder (http://www.govannon.nl)
<del>* Marius Ciocanel (http://mariusciocanel.com)
<del>* David Sommers (http://davidsommers.com/)
<del>* Ray Grasso (http://raygrasso.com)
<del>* Tim Uruski (http://tim.uruski.name)
<del>* Robert Clark (http://www.touchtech.co.nz)
<del>* Wes Oldenbeuving (http://narnach.com/)
<del>* Jon Fuller (http://erg7.com)
<del>* PredictionIO (Open-source machine learning server) (http://prediction.io)
<add>* [Andrew Brown](http://pvalu.es)
<add>* [Bethany Sumner](http://www.bethanysumner.com/)
<add>* [Orta](http://orta.github.com)
<add>* [Michał Gołębiowski](http://mgol.eu)
<add>* [Adam C. Foltzer](http://www.acfoltzer.net/)
<add>* [Steve Hiemstra](http://www.speg.com)
<add>* [Anton Sipos](http://www.softwarefuturism.com)
<add>* [Sergey Nebolsin](http://fedot.com)
<add>* [Dan Poltawski](http://blog.danpoltawski.co.uk)
<add>* [Dieter Komendera](http://www.komendera.com/)
<add>* [Lukas Westermann, at-point ag](http://at-point.ch/)
<add>* [Milan Cermak](http://milancermak.com)
<add>* [Sebastian Krysmanski](http://manski.net)
<add>* [Mike Stenhouse](http://mikesten.com)
<add>* [Alastair Stuart](http://eurotalk.com)
<add>* [David Rekowski](http://rekowski.info)
<add>* [Roland Leth](http://rolandleth.com)
<add>* [Maurice Kelly](http://blog.chatswood.org.uk/)
<add>* [Daryl Spitzer](http://twitter.com/yacitus)
<add>* [Jose Peleteiro](http://peleteiro.net)
<add>* [Mikael Hultgren](http://www.artsoftheinsane.com)
<add>* [Richard Japenga](http://japenga.eu)
<add>* [Pierre Riteau](https://github.com/priteau)
<add>* [Nathan Vander Wilt](http://exts.ch)
<add>* [Jean-Baptiste Escoyez](http://www.inspirationfactory.be)
<add>* [Tobias Müller](http://www.twam.info)
<add>* [Boris Mann](http://www.bmannconsulting.com)
<add>* [Zach A. Thomas](https://github.com/zathomas)
<add>* [Andrey Yunoshev](http://yunoshev.ru)
<add>* [David McFarland](www.dcmcfarland.com)
<add>* [Roland Tanglao](http://rolandtanglao.com)
<add>* [Jacob Elder](http://jacobelder.com)
<add>* [ToWatchList](http://towatchlist.com/)
<add>* [Joshua Jabbour](http://about.me/joshuajabbour)
<add>* [Daniel Giribet](http://dani.calidos.com)
<add>* [Eric Wallmander](http://wallmander.net/)
<add>* [Teakhouten meubelen](http://teakmeubelen.nl/)
<add>* [Gerard "smeevil" de Brieder](http://www.govannon.nl)
<add>* [Marius Ciocanel](http://mariusciocanel.com)
<add>* [David Sommers](http://davidsommers.com/)
<add>* [Ray Grasso](http://raygrasso.com)
<add>* [Tim Uruski](http://tim.uruski.name)
<add>* [Robert Clark](http://www.touchtech.co.nz)
<add>* [Wes Oldenbeuving](http://narnach.com/)
<add>* [Jon Fuller](http://erg7.com)
<add>* [PredictionIO (Open-source machine learning server)](http://prediction.io)
<ide> * Nikolaus Wittenstein
<del>* StormMQ (http://stormmq.com/)
<del>* Barry Hoggard (http://www.tristanmedia.com/)
<del>* Purplish Tree (http://PurplishTree.com)
<del>* Stefan Huber (http://signalwerk.ch/
<add>* [StormMQ](http://stormmq.com/)
<add>* [Barry Hoggard](http://www.tristanmedia.com/)
<add>* [Purplish Tree](http://PurplishTree.com)
<add>* [Stefan Huber](http://signalwerk.ch/)
<ide> * Julien Palmas
<del>* Cameron Spencer (http://eusonic.com)
<del>* alesdotio (https://github.com/alesdotio)
<del>* version2.io (http://version2.io)
<del>* Jeremy Clarke (http://jeremyclarke.org)
<del>* Dimitar Dimitrov (http://ddimitrov.name/)
<del>* Hacker School (https://www.hackerschool.com/)
<del>* Franklin (http://frankl.in)
<add>* [Cameron Spencer](http://eusonic.com)
<add>* [alesdotio](https://github.com/alesdotio)
<add>* [version2.io](http://version2.io)
<add>* [Jeremy Clarke](http://jeremyclarke.org)
<add>* [Dimitar Dimitrov](http://ddimitrov.name/)
<add>* [Hacker School](https://www.hackerschool.com/)
<add>* [Franklin](http://frankl.in)
<ide> * Wes Garrison
<del>* Braulio Carreno (http://carreno.me)
<del>* Derek Croft (http://www.kiindly.com)
<del>* Doc Ritezel (http://ritezel.com)
<del>* Christoph Heer (http://christophheer.me)
<add>* [Braulio Carreno](http://carreno.me)
<add>* [Derek Croft](http://www.kiindly.com)
<add>* [Doc Ritezel](http://ritezel.com)
<add>* [Christoph Heer](http://christophheer.me)
<ide> * Jakub Suder
<del>* Jason Garber (http://sixtwothree.org)
<del>* Alejandro Caceres (http://punkspider.hyperiongray.com)
<del>* Slobodan Miskovic (http://www.taskforce-1.com)
<del>* Kurt Ostergaard (http://KurtOstergaard.com)
<del>* Simply Business (http://www.simplybusiness.co.uk/)
<add>* [Jason Garber](http://sixtwothree.org)
<add>* [Alejandro Caceres](http://punkspider.hyperiongray.com)
<add>* [Slobodan Miskovic](http://www.taskforce-1.com)
<add>* [Kurt Ostergaard](http://KurtOstergaard.com)
<add>* [Simply Business](http://www.simplybusiness.co.uk/)
<ide> * Tate Johnson
<del>* Gerry Cardinal III (http://gerrycardinal.com/)
<del>* Andrew Kalek (http://anlek.com)
<del>* Bryan Coe (http://www.BryanACoe.com)
<del>* 360 Virtual Tours (http://www.360virtualtours.co.uk)
<del>* James Turnbull (http://www.kartar.net)
<del>* Dominic Morgan (http://d3r.com)
<del>* Mario Witte (http://www.mariowitte.com)
<del>* Studio NAND (http://www.nand.io)
<del>* Per Sandström (http://www.helloper.com)
<del>* Jochen Schäfer (http://www.joschs-robotics.de)
<del>* Jökull Sólberg Auðunsson (http://www.solberg.is)
<del>* kolpax (http://kolpax.io)
<del>* Matt Davis (http://penandpants.com)
<del>* Scott Chamberlain (http://ropensci.org/)
<del>* Jaehoon You (https://github.com/teslamint)
<del>* Wayne Robinson (http://www.wayne-robinson.com)
<del>* Kitt Hodsden (https://kitt.hodsden.org/)
<del>* Justin Johnson (http://justinjohnson.org/)
<del>* David Cristofaro (http://davidcristofaro.com/)
<add>* [Gerry Cardinal III](http://gerrycardinal.com/)
<add>* [Andrew Kalek](http://anlek.com)
<add>* [Bryan Coe](http://www.BryanACoe.com)
<add>* [360 Virtual Tours](http://www.360virtualtours.co.uk)
<add>* [James Turnbull](http://www.kartar.net)
<add>* [Dominic Morgan](http://d3r.com)
<add>* [Mario Witte](http://www.mariowitte.com)
<add>* [Studio NAND](http://www.nand.io)
<add>* [Per Sandström](http://www.helloper.com)
<add>* [Jochen Schäfer](http://www.joschs-robotics.de)
<add>* [Jökull Sólberg Auðunsson](http://www.solberg.is)
<add>* [kolpax](http://kolpax.io)
<add>* [Matt Davis](http://penandpants.com)
<add>* [Scott Chamberlain](http://ropensci.org/)
<add>* [Jaehoon You](https://github.com/teslamint)
<add>* [Wayne Robinson](http://www.wayne-robinson.com)
<add>* [Kitt Hodsden](https://kitt.hodsden.org/)
<add>* [Justin Johnson](http://justinjohnson.org/)
<add>* [David Cristofaro](http://davidcristofaro.com/)
<ide> * Steve Salkin
<del>* Kristopher Johnson (http://undefinedvalue.com/)
<del>* Kumar McMillan (http://twitter.com/kumar303)
<del>* Brannon Sherry (http://code-junkie.com)
<del>* Neo Innovation - Lean Consultancy (http://neo.com/)
<del>* Jeff Warner (http://www.stormysoftware.com)
<del>* Jeremy Walker (http://www.ihid.co.uk)
<del>* Michael Sanders (http://msanders.com)
<del>* Zulfiqar Ali (http://www.simplerses.com)
<del>* Josh Hepworth (http://friendsoftheweb.com)
<del>* Michael Dippery (http://monkey-robot.com/)
<del>* Jonathan Beavers (https://jon4than.com)
<del>* Jason Nourse (http://jasonnourse.com)
<del>* cj little (http://cjlittle.com)
<del>* Nicholas Mott (http://www.discovilante.com)
<del>* Jean-Luc Geering (http://www.ufirstgroup.com/)
<del>* Ingo Kampe (http://kreuzwerker.de/)
<del>* Jason Rasmussen (http://www.sourcefire.com)
<del>* Reni Margold (http://renimargold.com)
<del>* Jacopo (https://github.com/dedalusj)
<del>* Incremental Productions Ltd (http://www.incremental.co.uk/)
<del>* condero Aktiengesellschaft (http://www.condero.com)
<del>* Mintrus (http://mintrus.com)
<del>* Ezekiel Templin (http://zeke.templ.in/)
<del>* Matt Robinson (https://www.lazycat.org/)
<del>* Greg Kaufman (http://gregkaufman.com)
<del>* Chris Wilkes (https://github.com/cwilkes)
<del>* Maven Security Consulting (http://www.mavensecurity.com)
<del>* Christopher Vander Poel (http://www.wlvrn.com)
<del>* Weiyin LIANG (http://pyology.com)
<del>* Epic Awesome (http://epicawesome.co/)
<del>* Evan Oxfeld (http://twitter.com/evanoxfeld)
<del>* Alexander Lash (http://alexla.sh)
<del>* Ferran Selles (http://www.nulltrace.com)
<del>* Rick Companje (http://www.companje.nl)
<del>* Alexander Zubko (http://www.youtube.com/watch?v=jqxENMKaeCU)
<del>* Iain Beeston (http://iainbeeston.com/)
<del>* Geoff Bowers (http://www.daemon.com.au)
<del>* Logan Cox (http://lo5an.com)
<del>* Helmwind (http://helmwind.com)
<del>* José Tiburcio Ribeiro Netto (http://mineiro.org)
<del>* Cloudier (http://www.cloudier.com)
<del>* Adam Merrifield (http://seydesign.com)
<del>* Alan Chiang (http://itsnotvalid.com)
<add>* [Kristopher Johnson](http://undefinedvalue.com/)
<add>* [Kumar McMillan](http://twitter.com/kumar303)
<add>* [Brannon Sherry](http://code-junkie.com)
<add>* [Neo Innovation - Lean Consultancy](http://neo.com/)
<add>* [Jeff Warner](http://www.stormysoftware.com)
<add>* [Jeremy Walker](http://www.ihid.co.uk)
<add>* [Michael Sanders](http://msanders.com)
<add>* [Zulfiqar Ali](http://www.simplerses.com)
<add>* [Josh Hepworth](http://friendsoftheweb.com)
<add>* [Michael Dippery](http://monkey-robot.com/)
<add>* [Jonathan Beavers](https://jon4than.com)
<add>* [Jason Nourse](http://jasonnourse.com)
<add>* [cj little](http://cjlittle.com)
<add>* [Nicholas Mott](http://www.discovilante.com)
<add>* [Jean-Luc Geering](http://www.ufirstgroup.com/)
<add>* [Ingo Kampe](http://kreuzwerker.de/)
<add>* [Jason Rasmussen](http://www.sourcefire.com)
<add>* [Reni Margold](http://renimargold.com)
<add>* [Jacopo](https://github.com/dedalusj)
<add>* [Incremental Productions Ltd](http://www.incremental.co.uk/)
<add>* [condero Aktiengesellschaft](http://www.condero.com)
<add>* [Mintrus](http://mintrus.com)
<add>* [Ezekiel Templin](http://zeke.templ.in/)
<add>* [Matt Robinson](https://www.lazycat.org/)
<add>* [Greg Kaufman](http://gregkaufman.com)
<add>* [Chris Wilkes](https://github.com/cwilkes)
<add>* [Maven Security Consulting](http://www.mavensecurity.com)
<add>* [Christopher Vander Poel](http://www.wlvrn.com)
<add>* [Weiyin LIANG](http://pyology.com)
<add>* [Epic Awesome](http://epicawesome.co/)
<add>* [Evan Oxfeld](http://twitter.com/evanoxfeld)
<add>* [Alexander Lash](http://alexla.sh)
<add>* [Ferran Selles](http://www.nulltrace.com)
<add>* [Rick Companje](http://www.companje.nl)
<add>* [Alexander Zubko](http://www.youtube.com/watch?v=jqxENMKaeCU)
<add>* [Iain Beeston](http://iainbeeston.com/)
<add>* [Geoff Bowers](http://www.daemon.com.au)
<add>* [Logan Cox](http://lo5an.com)
<add>* [Helmwind](http://helmwind.com)
<add>* [José Tiburcio Ribeiro Netto](http://mineiro.org)
<add>* [Cloudier](http://www.cloudier.com)
<add>* [Adam Merrifield](http://seydesign.com)
<add>* [Alan Chiang](http://itsnotvalid.com)
<ide> * Ralf Norbert Sooth
<del>* Cameron Tod (http://camerontod.com)
<del>* Paul McLanahan (http://pmac.io)
<del>* Lance Ulmer (http://lanceulmer.com)
<del>* Thomas Jachmann (http://thomasjachmann.com)
<del>* Jonathan Foster (http://fostertheweb.com)
<del>* Diogo Neves (http://diogoneves.com)
<del>* Arvy (http://www.codingepiphany.com)
<del>* James Pellerano (http://jamespellerano.com)
<del>* Birger J. Nordølum (http://mindtooth.me)
<del>* Bob Saska (http://r35.net)
<del>* Michael McCarthy (https://github.com/mikeycmccarthy)
<del>* Scott Courtney (http://www.sinenomine.net/)
<del>* Courtney Wilburn (http://blog.cjwilburn.com)
<del>* Gregory Man (http://gregory-m.github.com/)
<del>* Sean Porter (http://seanporter.com)
<del>* Jerome Glacken (http://www.jeromeglacken.com)
<add>* [Cameron Tod](http://camerontod.com)
<add>* [Paul McLanahan](http://pmac.io)
<add>* [Lance Ulmer](http://lanceulmer.com)
<add>* [Thomas Jachmann](http://thomasjachmann.com)
<add>* [Jonathan Foster](http://fostertheweb.com)
<add>* [Diogo Neves](http://diogoneves.com)
<add>* [Arvy](http://www.codingepiphany.com)
<add>* [James Pellerano](http://jamespellerano.com)
<add>* [Birger J. Nordølum](http://mindtooth.me)
<add>* [Bob Saska](http://r35.net)
<add>* [Michael McCarthy](https://github.com/mikeycmccarthy)
<add>* [Scott Courtney](http://www.sinenomine.net/)
<add>* [Courtney Wilburn](http://blog.cjwilburn.com)
<add>* [Gregory Man](http://gregory-m.github.com/)
<add>* [Sean Porter](http://seanporter.com)
<add>* [Jerome Glacken](http://www.jeromeglacken.com)
<ide> * Chris Severs
<del>* Joacim Löwgren (http://www.jorum.se)
<del>* Shawn Price (http://shawnprice.com/)
<del>* Dominick LoBraico (http://dominick.me)
<del>* Denis Wolf (http://deniswolf.net)
<add>* [Joacim Löwgren](http://www.jorum.se)
<add>* [Shawn Price](http://shawnprice.com/)
<add>* [Dominick LoBraico](http://dominick.me)
<add>* [Denis Wolf](http://deniswolf.net)
<ide>
<ide> These lovely people supported our Kickstarter by giving us £5 or more:
<ide> | 1 |
Ruby | Ruby | convert x11requirement test to spec | 23767a378bf4c10d2e78e49050ab566d9f8cdaed | <ide><path>Library/Homebrew/test/x11_requirement_spec.rb
<add>require "requirements/x11_requirement"
<add>
<add>describe X11Requirement do
<add> let(:default_name) { "x11" }
<add>
<add> describe "#name" do
<add> it "defaults to x11" do
<add> expect(subject.name).to eq(default_name)
<add> end
<add> end
<add>
<add> describe "#eql?" do
<add> it "returns true if the names are equal" do
<add> other = described_class.new(default_name)
<add> expect(subject).to eql(other)
<add> end
<add>
<add> it "and returns false if the names differ" do
<add> other = described_class.new("foo")
<add> expect(subject).not_to eql(other)
<add> end
<add>
<add> it "returns false if the minimum version differs" do
<add> other = described_class.new(default_name, ["2.5"])
<add> expect(subject).not_to eql(other)
<add> end
<add> end
<add>
<add> describe "#modify_build_environment" do
<add> it "calls ENV#x11" do
<add> allow(subject).to receive(:satisfied?).and_return(true)
<add> expect(ENV).to receive(:x11)
<add> subject.modify_build_environment
<add> end
<add> end
<add>end
<ide><path>Library/Homebrew/test/x11_requirement_test.rb
<del>require "testing_env"
<del>require "requirements/x11_requirement"
<del>
<del>class X11RequirementTests < Homebrew::TestCase
<del> def test_eql_instances_are_eql
<del> x = X11Requirement.new
<del> y = X11Requirement.new
<del> assert_eql x, y
<del> assert_equal x.hash, y.hash
<del> end
<del>
<del> def test_not_eql_when_hashes_differ
<del> x = X11Requirement.new("foo")
<del> y = X11Requirement.new
<del> refute_eql x, y
<del> refute_equal x.hash, y.hash
<del> end
<del>
<del> def test_different_min_version
<del> x = X11Requirement.new
<del> y = X11Requirement.new("x11", %w[2.5])
<del> refute_eql x, y
<del> end
<del>
<del> def test_x_env
<del> x = X11Requirement.new
<del> x.stubs(:satisfied?).returns(true)
<del> ENV.expects(:x11)
<del> x.modify_build_environment
<del> end
<del>end | 2 |
Ruby | Ruby | skip the formula in .brew/formula.rb | 03ae6aae3b95447bc79398b3c58a9fcee67e98ef | <ide><path>Library/Homebrew/keg_relocate.rb
<ide> def text_files
<ide> next true if pn.symlink?
<ide> next true if pn.directory?
<ide> next false if pn.basename.to_s == "orig-prefix.txt" # for python virtualenvs
<add> next true if pn == self/".brew/#{name}.rb"
<ide> next true if Metafiles::EXTENSIONS.include?(pn.extname)
<ide> if pn.text_executable?
<ide> text_files << pn | 1 |
Javascript | Javascript | add conda install for lookups [ci skip] | e7ddc6f6629fde9475ae97945ddf423d1dbfb3be | <ide><path>website/src/widgets/quickstart-install.js
<ide> const QuickstartInstall = ({ id, title }) => (
<ide> set PYTHONPATH=/path/to/spaCy
<ide> </QS>
<ide> <QS package="source">pip install -r requirements.txt</QS>
<del> <QS data="lookups">pip install -U spacy-lookups-data</QS>
<add> <QS data="lookups" package="pip">
<add> pip install -U spacy-lookups-data
<add> </QS>
<add> <QS data="lookups" package="source">
<add> pip install -U spacy-lookups-data
<add> </QS>
<add> <QS data="lookups" package="conda">
<add> conda install -c conda-forge spacy-lookups-data
<add> </QS>
<ide> <QS package="source">python setup.py build_ext --inplace</QS>
<ide> {models.map(({ code, models: modelOptions }) => (
<ide> <QS models={code} key={code}> | 1 |
Go | Go | remove cli-only tests from integration-cli | 98d8c96885593f8f085bf9607b7d817e23d7164c | <ide><path>integration-cli/docker_cli_help_test.go
<del>package main
<del>
<del>import (
<del> "fmt"
<del> "runtime"
<del> "strings"
<del> "unicode"
<del>
<del> "github.com/docker/docker/integration-cli/checker"
<del> "github.com/docker/docker/integration-cli/cli"
<del> "github.com/docker/docker/pkg/homedir"
<del> icmd "github.com/docker/docker/pkg/testutil/cmd"
<del> "github.com/go-check/check"
<del>)
<del>
<del>func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
<del> // FIXME(vdemeester) should be a unit test, probably using golden files ?
<del> testRequires(c, DaemonIsLinux)
<del>
<del> // Make sure main help text fits within 80 chars and that
<del> // on non-windows system we use ~ when possible (to shorten things).
<del> // Test for HOME set to its default value and set to "/" on linux
<del> // Yes on windows setting up an array and looping (right now) isn't
<del> // necessary because we just have one value, but we'll need the
<del> // array/loop on linux so we might as well set it up so that we can
<del> // test any number of home dirs later on and all we need to do is
<del> // modify the array - the rest of the testing infrastructure should work
<del> homes := []string{homedir.Get()}
<del>
<del> // Non-Windows machines need to test for this special case of $HOME
<del> if runtime.GOOS != "windows" {
<del> homes = append(homes, "/")
<del> }
<del>
<del> homeKey := homedir.Key()
<del> baseEnvs := appendBaseEnv(true)
<del>
<del> // Remove HOME env var from list so we can add a new value later.
<del> for i, env := range baseEnvs {
<del> if strings.HasPrefix(env, homeKey+"=") {
<del> baseEnvs = append(baseEnvs[:i], baseEnvs[i+1:]...)
<del> break
<del> }
<del> }
<del>
<del> for _, home := range homes {
<del>
<del> // Dup baseEnvs and add our new HOME value
<del> newEnvs := make([]string, len(baseEnvs)+1)
<del> copy(newEnvs, baseEnvs)
<del> newEnvs[len(newEnvs)-1] = homeKey + "=" + home
<del>
<del> scanForHome := runtime.GOOS != "windows" && home != "/"
<del>
<del> // Check main help text to make sure its not over 80 chars
<del> result := icmd.RunCmd(icmd.Cmd{
<del> Command: []string{dockerBinary, "help"},
<del> Env: newEnvs,
<del> })
<del> result.Assert(c, icmd.Success)
<del> lines := strings.Split(result.Combined(), "\n")
<del> for _, line := range lines {
<del> // All lines should not end with a space
<del> c.Assert(line, checker.Not(checker.HasSuffix), " ", check.Commentf("Line should not end with a space"))
<del>
<del> if scanForHome && strings.Contains(line, `=`+home) {
<del> c.Fatalf("Line should use '%q' instead of %q:\n%s", homedir.GetShortcutString(), home, line)
<del> }
<del> if runtime.GOOS != "windows" {
<del> i := strings.Index(line, homedir.GetShortcutString())
<del> if i >= 0 && i != len(line)-1 && line[i+1] != '/' {
<del> c.Fatalf("Main help should not have used home shortcut:\n%s", line)
<del> }
<del> }
<del> }
<del>
<del> // Make sure each cmd's help text fits within 90 chars and that
<del> // on non-windows system we use ~ when possible (to shorten things).
<del> // Pull the list of commands from the "Commands:" section of docker help
<del> // FIXME(vdemeester) Why re-run help ?
<del> //helpCmd = exec.Command(dockerBinary, "help")
<del> //helpCmd.Env = newEnvs
<del> //out, _, err = runCommandWithOutput(helpCmd)
<del> //c.Assert(err, checker.IsNil, check.Commentf(out))
<del> i := strings.Index(result.Combined(), "Commands:")
<del> c.Assert(i, checker.GreaterOrEqualThan, 0, check.Commentf("Missing 'Commands:' in:\n%s", result.Combined()))
<del>
<del> cmds := []string{}
<del> // Grab all chars starting at "Commands:"
<del> helpOut := strings.Split(result.Combined()[i:], "\n")
<del> // Skip first line, it is just "Commands:"
<del> helpOut = helpOut[1:]
<del>
<del> // Create the list of commands we want to test
<del> cmdsToTest := []string{}
<del> for _, cmd := range helpOut {
<del> // Stop on blank line or non-indented line
<del> if cmd == "" || !unicode.IsSpace(rune(cmd[0])) {
<del> break
<del> }
<del>
<del> // Grab just the first word of each line
<del> cmd = strings.Split(strings.TrimSpace(cmd), " ")[0]
<del> cmds = append(cmds, cmd) // Saving count for later
<del>
<del> cmdsToTest = append(cmdsToTest, cmd)
<del> }
<del>
<del> // Add some 'two word' commands - would be nice to automatically
<del> // calculate this list - somehow
<del> cmdsToTest = append(cmdsToTest, "volume create")
<del> cmdsToTest = append(cmdsToTest, "volume inspect")
<del> cmdsToTest = append(cmdsToTest, "volume ls")
<del> cmdsToTest = append(cmdsToTest, "volume rm")
<del> cmdsToTest = append(cmdsToTest, "network connect")
<del> cmdsToTest = append(cmdsToTest, "network create")
<del> cmdsToTest = append(cmdsToTest, "network disconnect")
<del> cmdsToTest = append(cmdsToTest, "network inspect")
<del> cmdsToTest = append(cmdsToTest, "network ls")
<del> cmdsToTest = append(cmdsToTest, "network rm")
<del>
<del> if testEnv.ExperimentalDaemon() {
<del> cmdsToTest = append(cmdsToTest, "checkpoint create")
<del> cmdsToTest = append(cmdsToTest, "checkpoint ls")
<del> cmdsToTest = append(cmdsToTest, "checkpoint rm")
<del> }
<del>
<del> // Divide the list of commands into go routines and run the func testcommand on the commands in parallel
<del> // to save runtime of test
<del>
<del> errChan := make(chan error)
<del>
<del> for index := 0; index < len(cmdsToTest); index++ {
<del> go func(index int) {
<del> errChan <- testCommand(cmdsToTest[index], newEnvs, scanForHome, home)
<del> }(index)
<del> }
<del>
<del> for index := 0; index < len(cmdsToTest); index++ {
<del> err := <-errChan
<del> if err != nil {
<del> c.Fatal(err)
<del> }
<del> }
<del> }
<del>}
<del>
<del>func (s *DockerSuite) TestHelpExitCodesHelpOutput(c *check.C) {
<del> // Test to make sure the exit code and output (stdout vs stderr) of
<del> // various good and bad cases are what we expect
<del>
<del> // docker : stdout=all, stderr=empty, rc=0
<del> out := cli.DockerCmd(c).Combined()
<del> // Be really pick
<del> c.Assert(out, checker.Not(checker.HasSuffix), "\n\n", check.Commentf("Should not have a blank line at the end of 'docker'\n"))
<del>
<del> // docker help: stdout=all, stderr=empty, rc=0
<del> out = cli.DockerCmd(c, "help").Combined()
<del> // Be really pick
<del> c.Assert(out, checker.Not(checker.HasSuffix), "\n\n", check.Commentf("Should not have a blank line at the end of 'docker help'\n"))
<del>
<del> // docker --help: stdout=all, stderr=empty, rc=0
<del> out = cli.DockerCmd(c, "--help").Combined()
<del> // Be really pick
<del> c.Assert(out, checker.Not(checker.HasSuffix), "\n\n", check.Commentf("Should not have a blank line at the end of 'docker --help'\n"))
<del>
<del> // docker inspect busybox: stdout=all, stderr=empty, rc=0
<del> // Just making sure stderr is empty on valid cmd
<del> out = cli.DockerCmd(c, "inspect", "busybox").Combined()
<del> // Be really pick
<del> c.Assert(out, checker.Not(checker.HasSuffix), "\n\n", check.Commentf("Should not have a blank line at the end of 'docker inspect busyBox'\n"))
<del>
<del> // docker rm: stdout=empty, stderr=all, rc!=0
<del> // testing the min arg error msg
<del> cli.Docker(cli.Args("rm")).Assert(c, icmd.Expected{
<del> ExitCode: 1,
<del> Error: "exit status 1",
<del> Out: "",
<del> // Should not contain full help text but should contain info about
<del> // # of args and Usage line
<del> Err: "requires at least 1 argument",
<del> })
<del>
<del> // docker rm NoSuchContainer: stdout=empty, stderr=all, rc=0
<del> // testing to make sure no blank line on error
<del> result := cli.Docker(cli.Args("rm", "NoSuchContainer")).Assert(c, icmd.Expected{
<del> ExitCode: 1,
<del> Error: "exit status 1",
<del> Out: "",
<del> })
<del> // Be really picky
<del> c.Assert(len(result.Stderr()), checker.Not(checker.Equals), 0)
<del> c.Assert(result.Stderr(), checker.Not(checker.HasSuffix), "\n\n", check.Commentf("Should not have a blank line at the end of 'docker rm'\n"))
<del>
<del> // docker BadCmd: stdout=empty, stderr=all, rc=0
<del> cli.Docker(cli.Args("BadCmd")).Assert(c, icmd.Expected{
<del> ExitCode: 1,
<del> Error: "exit status 1",
<del> Out: "",
<del> Err: "docker: 'BadCmd' is not a docker command.\nSee 'docker --help'\n",
<del> })
<del>}
<del>
<del>func testCommand(cmd string, newEnvs []string, scanForHome bool, home string) error {
<del>
<del> args := strings.Split(cmd+" --help", " ")
<del>
<del> // Check the full usage text
<del> result := icmd.RunCmd(icmd.Cmd{
<del> Command: append([]string{dockerBinary}, args...),
<del> Env: newEnvs,
<del> })
<del> err := result.Error
<del> out := result.Stdout()
<del> stderr := result.Stderr()
<del> if len(stderr) != 0 {
<del> return fmt.Errorf("Error on %q help. non-empty stderr:%q\n", cmd, stderr)
<del> }
<del> if strings.HasSuffix(out, "\n\n") {
<del> return fmt.Errorf("Should not have blank line on %q\n", cmd)
<del> }
<del> if !strings.Contains(out, "--help") {
<del> return fmt.Errorf("All commands should mention '--help'. Command '%v' did not.\n", cmd)
<del> }
<del>
<del> if err != nil {
<del> return fmt.Errorf(out)
<del> }
<del>
<del> // Check each line for lots of stuff
<del> lines := strings.Split(out, "\n")
<del> for _, line := range lines {
<del> i := strings.Index(line, "~")
<del> if i >= 0 && i != len(line)-1 && line[i+1] != '/' {
<del> return fmt.Errorf("Help for %q should not have used ~:\n%s", cmd, line)
<del> }
<del>
<del> // Options should NOT end with a period
<del> if strings.HasPrefix(line, " -") && strings.HasSuffix(line, ".") {
<del> return fmt.Errorf("Help for %q should not end with a period: %s", cmd, line)
<del> }
<del>
<del> // Options should NOT end with a space
<del> if strings.HasSuffix(line, " ") {
<del> return fmt.Errorf("Help for %q should not end with a space: %s", cmd, line)
<del> }
<del>
<del> }
<del>
<del> // For each command make sure we generate an error
<del> // if we give a bad arg
<del> args = strings.Split(cmd+" --badArg", " ")
<del>
<del> out, _, err = dockerCmdWithError(args...)
<del> if err == nil {
<del> return fmt.Errorf(out)
<del> }
<del>
<del> // Be really picky
<del> if strings.HasSuffix(stderr, "\n\n") {
<del> return fmt.Errorf("Should not have a blank line at the end of 'docker rm'\n")
<del> }
<del>
<del> // Now make sure that each command will print a short-usage
<del> // (not a full usage - meaning no opts section) if we
<del> // are missing a required arg or pass in a bad arg
<del>
<del> // These commands will never print a short-usage so don't test
<del> noShortUsage := map[string]string{
<del> "images": "",
<del> "login": "",
<del> "logout": "",
<del> "network": "",
<del> "stats": "",
<del> "volume create": "",
<del> }
<del>
<del> if _, ok := noShortUsage[cmd]; !ok {
<del> // skipNoArgs are ones that we don't want to try w/o
<del> // any args. Either because it'll hang the test or
<del> // lead to incorrect test result (like false negative).
<del> // Whatever the reason, skip trying to run w/o args and
<del> // jump to trying with a bogus arg.
<del> skipNoArgs := map[string]struct{}{
<del> "daemon": {},
<del> "events": {},
<del> "load": {},
<del> }
<del>
<del> var result *icmd.Result
<del> if _, ok := skipNoArgs[cmd]; !ok {
<del> result = dockerCmdWithResult(strings.Split(cmd, " ")...)
<del> }
<del>
<del> // If its ok w/o any args then try again with an arg
<del> if result == nil || result.ExitCode == 0 {
<del> result = dockerCmdWithResult(strings.Split(cmd+" badArg", " ")...)
<del> }
<del>
<del> if err := result.Compare(icmd.Expected{
<del> Out: icmd.None,
<del> Err: "\nUsage:",
<del> ExitCode: 1,
<del> }); err != nil {
<del> return err
<del> }
<del>
<del> stderr := result.Stderr()
<del> // Shouldn't have full usage
<del> if strings.Contains(stderr, "--help=false") {
<del> return fmt.Errorf("Should not have full usage on %q:%v", result.Cmd.Args, stderr)
<del> }
<del> if strings.HasSuffix(stderr, "\n\n") {
<del> return fmt.Errorf("Should not have a blank line on %q\n%v", result.Cmd.Args, stderr)
<del> }
<del> }
<del>
<del> return nil
<del>}
<ide><path>integration-cli/docker_cli_stack_test.go
<del>// +build !windows
<del>
<del>package main
<del>
<del>import (
<del> "encoding/json"
<del> "io/ioutil"
<del> "os"
<del> "sort"
<del> "strings"
<del>
<del> "github.com/docker/docker/api/types/swarm"
<del> "github.com/docker/docker/integration-cli/checker"
<del> icmd "github.com/docker/docker/pkg/testutil/cmd"
<del> "github.com/go-check/check"
<del>)
<del>
<del>var cleanSpaces = func(s string) string {
<del> lines := strings.Split(s, "\n")
<del> for i, line := range lines {
<del> spaceIx := strings.Index(line, " ")
<del> if spaceIx > 0 {
<del> lines[i] = line[:spaceIx+1] + strings.TrimLeft(line[spaceIx:], " ")
<del> }
<del> }
<del> return strings.Join(lines, "\n")
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackRemoveUnknown(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> stackArgs := append([]string{"stack", "remove", "UNKNOWN_STACK"})
<del>
<del> out, err := d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(out, check.Equals, "Nothing found in stack: UNKNOWN_STACK\n")
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackPSUnknown(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> stackArgs := append([]string{"stack", "ps", "UNKNOWN_STACK"})
<del>
<del> out, err := d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(out, check.Equals, "Nothing found in stack: UNKNOWN_STACK\n")
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackServicesUnknown(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> stackArgs := append([]string{"stack", "services", "UNKNOWN_STACK"})
<del>
<del> out, err := d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(out, check.Equals, "Nothing found in stack: UNKNOWN_STACK\n")
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackDeployComposeFile(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> testStackName := "testdeploy"
<del> stackArgs := []string{
<del> "stack", "deploy",
<del> "--compose-file", "fixtures/deploy/default.yaml",
<del> testStackName,
<del> }
<del> out, err := d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil, check.Commentf(out))
<del>
<del> out, err = d.Cmd("stack", "ls")
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(cleanSpaces(out), check.Equals, "NAME SERVICES\n"+"testdeploy 2\n")
<del>
<del> out, err = d.Cmd("stack", "rm", testStackName)
<del> c.Assert(err, checker.IsNil)
<del> out, err = d.Cmd("stack", "ls")
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(cleanSpaces(out), check.Equals, "NAME SERVICES\n")
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackDeployWithSecretsTwice(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> out, err := d.Cmd("secret", "create", "outside", "fixtures/secrets/default")
<del> c.Assert(err, checker.IsNil, check.Commentf(out))
<del>
<del> testStackName := "testdeploy"
<del> stackArgs := []string{
<del> "stack", "deploy",
<del> "--compose-file", "fixtures/deploy/secrets.yaml",
<del> testStackName,
<del> }
<del> out, err = d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil, check.Commentf(out))
<del>
<del> out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", "testdeploy_web")
<del> c.Assert(err, checker.IsNil)
<del>
<del> var refs []swarm.SecretReference
<del> c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
<del> c.Assert(refs, checker.HasLen, 3)
<del>
<del> sort.Sort(sortSecrets(refs))
<del> c.Assert(refs[0].SecretName, checker.Equals, "outside")
<del> c.Assert(refs[1].SecretName, checker.Equals, "testdeploy_special")
<del> c.Assert(refs[1].File.Name, checker.Equals, "special")
<del> c.Assert(refs[2].SecretName, checker.Equals, "testdeploy_super")
<del> c.Assert(refs[2].File.Name, checker.Equals, "foo.txt")
<del> c.Assert(refs[2].File.Mode, checker.Equals, os.FileMode(0400))
<del>
<del> // Deploy again to ensure there are no errors when secret hasn't changed
<del> out, err = d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil, check.Commentf(out))
<del>}
<del>
<del>func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
<del> d := s.AddDaemon(c, true, true)
<del>
<del> stackName := "testdeploy"
<del> stackArgs := []string{
<del> "stack", "deploy",
<del> "--compose-file", "fixtures/deploy/remove.yaml",
<del> stackName,
<del> }
<del> result := icmd.RunCmd(d.Command(stackArgs...))
<del> result.Assert(c, icmd.Expected{
<del> Err: icmd.None,
<del> Out: "Creating service testdeploy_web",
<del> })
<del>
<del> result = icmd.RunCmd(d.Command("service", "ls"))
<del> result.Assert(c, icmd.Success)
<del> c.Assert(
<del> strings.Split(strings.TrimSpace(result.Stdout()), "\n"),
<del> checker.HasLen, 2)
<del>
<del> result = icmd.RunCmd(d.Command("stack", "rm", stackName))
<del> result.Assert(c, icmd.Success)
<del> stderr := result.Stderr()
<del> c.Assert(stderr, checker.Contains, "Removing service testdeploy_web")
<del> c.Assert(stderr, checker.Contains, "Removing network testdeploy_default")
<del> c.Assert(stderr, checker.Contains, "Removing secret testdeploy_special")
<del>}
<del>
<del>type sortSecrets []swarm.SecretReference
<del>
<del>func (s sortSecrets) Len() int { return len(s) }
<del>func (s sortSecrets) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
<del>func (s sortSecrets) Less(i, j int) bool { return s[i].SecretName < s[j].SecretName }
<del>
<del>// testDAB is the DAB JSON used for testing.
<del>// TODO: Use template/text and substitute "Image" with the result of
<del>// `docker inspect --format '{{index .RepoDigests 0}}' busybox:latest`
<del>const testDAB = `{
<del> "Version": "0.1",
<del> "Services": {
<del> "srv1": {
<del> "Image": "busybox@sha256:e4f93f6ed15a0cdd342f5aae387886fba0ab98af0a102da6276eaf24d6e6ade0",
<del> "Command": ["top"]
<del> },
<del> "srv2": {
<del> "Image": "busybox@sha256:e4f93f6ed15a0cdd342f5aae387886fba0ab98af0a102da6276eaf24d6e6ade0",
<del> "Command": ["tail"],
<del> "Args": ["-f", "/dev/null"]
<del> }
<del> }
<del>}`
<del>
<del>func (s *DockerSwarmSuite) TestStackDeployWithDAB(c *check.C) {
<del> testRequires(c, ExperimentalDaemon)
<del> // setup
<del> testStackName := "test"
<del> testDABFileName := testStackName + ".dab"
<del> defer os.RemoveAll(testDABFileName)
<del> err := ioutil.WriteFile(testDABFileName, []byte(testDAB), 0444)
<del> c.Assert(err, checker.IsNil)
<del> d := s.AddDaemon(c, true, true)
<del> // deploy
<del> stackArgs := []string{
<del> "stack", "deploy",
<del> "--bundle-file", testDABFileName,
<del> testStackName,
<del> }
<del> out, err := d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(out, checker.Contains, "Loading bundle from test.dab\n")
<del> c.Assert(out, checker.Contains, "Creating service test_srv1\n")
<del> c.Assert(out, checker.Contains, "Creating service test_srv2\n")
<del> // ls
<del> stackArgs = []string{"stack", "ls"}
<del> out, err = d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(cleanSpaces(out), check.Equals, "NAME SERVICES\n"+"test 2\n")
<del> // rm
<del> stackArgs = []string{"stack", "rm", testStackName}
<del> out, err = d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(out, checker.Contains, "Removing service test_srv1\n")
<del> c.Assert(out, checker.Contains, "Removing service test_srv2\n")
<del> // ls (empty)
<del> stackArgs = []string{"stack", "ls"}
<del> out, err = d.Cmd(stackArgs...)
<del> c.Assert(err, checker.IsNil)
<del> c.Assert(cleanSpaces(out), check.Equals, "NAME SERVICES\n")
<del>} | 2 |
Javascript | Javascript | use lodash replace | e8dcc43e235133773231ba6dae78a3853bdfc735 | <ide><path>common/utils/encode-decode.js
<del>import flow from 'lodash/flow';
<add>import _ from 'lodash/fp';
<ide>
<ide> // we don't store loop protect disable key
<del>export function removeNoprotect(val) {
<del> return val.replace(/noprotect/gi, '');
<del>}
<add>export const removeNoprotect = _.replace(/noprotect/gi, '');
<ide>
<del>export function encodeScriptTags(val) {
<del> return val
<del> .replace(/<script>/gi, 'fccss')
<del> .replace(/<\/script>/gi, 'fcces');
<del>}
<add>export const encodeScriptTags = _.flow(
<add> _.replace(/<script>/gi, 'fccss'),
<add> _.replace(/<\/script>/gi, 'fcces')
<add>);
<ide>
<del>export function decodeScriptTags(val) {
<del> return val
<del> .replace(/fccss/gi, '<script>')
<del> .replace(/fcces/gi, '</script>');
<del>}
<add>export const decodeScriptTags = _.flow(
<add> _.replace(/fccss/gi, '<script>'),
<add> _.replace(/fcces/gi, '</script>')
<add>);
<ide>
<del>export function encodeFormAction(val) {
<del> return val.replace(
<del> // look for attributes in a form
<del> /<form[^>]*>/,
<del> // val is the string within the opening form tag
<del> // look for an `action` attribute, replace it with a fcc tag
<del> val => val.replace(/action(\s*?)=/, 'fccfaa$1=')
<del> );
<del>}
<add>export const encodeFormAction = _.replace(
<add> // look for attributes in a form
<add> /<form[^>]*>/,
<add> // val is the string within the opening form tag
<add> // look for an `action` attribute, replace it with a fcc tag
<add> _.replace(/action(\s*?)=/, 'fccfaa$1=')
<add>);
<ide>
<del>export function decodeFormAction(val) {
<del> return val.replace(
<del> /<form[^>]*>/,
<del> val => val.replace(/fccfaa(\s*?)=/, 'action$1=')
<del> );
<del>}
<add>export const decodeFormAction = _.replace(
<add> /<form[^>]*>/,
<add> _.replace(/fccfaa(\s*?)=/, 'action$1=')
<add>);
<ide>
<del>export const encodeFcc = flow([
<add>export const encodeFcc = _.flow(
<ide> removeNoprotect,
<ide> encodeFormAction,
<ide> encodeScriptTags
<del>]);
<add>);
<ide>
<del>export const decodeFcc = flow([
<add>export const decodeFcc = _.flow(
<ide> decodeFormAction,
<ide> decodeScriptTags
<del>]);
<add>);
<ide><path>common/utils/encode-decode.test.js
<add>import test from 'tape';
<add>import {
<add> encodeScriptTags,
<add> decodeScriptTags,
<add> encodeFormAction,
<add> decodeFormAction,
<add> encodeFcc,
<add> decodeFcc
<add>} from './encode-decode.js';
<add>
<add>const scriptDecoded = `
<add> <script>console.log('foo')</script>
<add>`;
<add>const scriptEncoded = `
<add> fccssconsole.log('foo')fcces
<add>`;
<add>test('encodeScriptTags', t => {
<add> t.plan(1);
<add> t.equal(
<add> encodeScriptTags(scriptDecoded),
<add> scriptEncoded
<add> );
<add>});
<add>
<add>test('decodeScriptTags', t => {
<add> t.plan(1);
<add> t.equal(
<add> decodeScriptTags(scriptEncoded),
<add> scriptDecoded
<add> );
<add>});
<add>
<add>const formDecoded = `
<add> <form action ='path'>foo</form>
<add>`;
<add>const formEncoded = `
<add> <form fccfaa ='path'>foo</form>
<add>`;
<add>
<add>test('encodeFormAction', t => {
<add> t.plan(1);
<add> t.equal(
<add> encodeFormAction(formDecoded),
<add> formEncoded
<add> );
<add>});
<add>
<add>test('decodeFormAction', t => {
<add> t.plan(1);
<add> t.equal(
<add> decodeFormAction(formEncoded),
<add> formDecoded
<add> );
<add>});
<add>
<add>test('encodeFcc', t => {
<add> t.plan(1);
<add> t.equal(
<add> encodeFcc('//noprotect' + scriptDecoded + formDecoded),
<add> '//' + scriptEncoded + formEncoded
<add> );
<add>});
<add>
<add>test('decodeFcc', t => {
<add> t.plan(1);
<add> t.equal(
<add> decodeFcc(scriptEncoded + formEncoded),
<add> scriptDecoded + formDecoded
<add> );
<add>}); | 2 |
Javascript | Javascript | remove unneeded runtime requirements | a105b663e97fc83314a5758e12a3cd2e445670cc | <ide><path>lib/dependencies/HarmonyExportSpecifierDependency.js
<ide>
<ide> "use strict";
<ide>
<del>const RuntimeGlobals = require("../RuntimeGlobals");
<ide> const makeSerializable = require("../util/makeSerializable");
<ide> const HarmonyExportInitFragment = require("./HarmonyExportInitFragment");
<ide> const NullDependency = require("./NullDependency");
<ide> HarmonyExportSpecifierDependency.Template = class HarmonyExportSpecifierDependen
<ide> return;
<ide> }
<ide>
<del> runtimeRequirements.add(RuntimeGlobals.exports);
<del> runtimeRequirements.add(RuntimeGlobals.definePropertyGetters);
<del>
<ide> const map = new Map();
<ide> map.set(used, `/* binding */ ${dep.id}`);
<ide> initFragments.push( | 1 |
Javascript | Javascript | remove test that's testing a test helper | bdbb664e6a3cc5e71c973aeccc8880b95ee801c5 | <ide><path>spec/spec-helper-spec.js
<del>describe('spec-helper', () => {
<del> describe('jasmine.any', () => {
<del> it('equals uses jasmine.any', () => {
<del> const func = () => {};
<del> expect(func).toEqual(jasmine.any(Function));
<del> });
<del> });
<del>}); | 1 |
Python | Python | fix disjunctive features in english tag map | 6f983132544e1d20684930b7157d92a70f16a32c | <ide><path>spacy/lang/en/tag_map.py
<ide> "VBN": {POS: VERB, "VerbForm": "part", "Tense": "past", "Aspect": "perf"},
<ide> "VBP": {POS: VERB, "VerbForm": "fin", "Tense": "pres"},
<ide> "VBZ": {POS: VERB, "VerbForm": "fin", "Tense": "pres", "Number": "sing", "Person": 3},
<del> "WDT": {POS: ADJ, "PronType": "int|rel"},
<del> "WP": {POS: NOUN, "PronType": "int|rel"},
<del> "WP$": {POS: ADJ, "Poss": "yes", "PronType": "int|rel"},
<del> "WRB": {POS: ADV, "PronType": "int|rel"},
<add> "WDT": {POS: ADJ, "PronType": "int,rel"},
<add> "WP": {POS: NOUN, "PronType": "int,rel"},
<add> "WP$": {POS: ADJ, "Poss": "yes", "PronType": "int,rel"},
<add> "WRB": {POS: ADV, "PronType": "int,rel"},
<ide> "ADD": {POS: X},
<ide> "NFP": {POS: PUNCT},
<ide> "GW": {POS: X}, | 1 |
Javascript | Javascript | make challenge links on profile page work | 70b7080833c8a08ae47642d09ecb5fb80426c971 | <ide><path>api-server/common/models/challenge.js
<ide> import { Observable } from 'rx';
<ide> import { isEmpty } from 'lodash';
<add>import { dasherize } from '../utils';
<ide>
<ide> export default function(Challenge) {
<ide> let challengeIdToNameMap;
<ide> export default function(Challenge) {
<ide> throw Error(err);
<ide> }
<ide> challengeIdToNameMap = challenges.reduce((map, challenge) => {
<del> const { id, title } = challenge;
<del> map[id] = title;
<add> const { id, block, dashedName, title, superBlock } = challenge;
<add> map[id] = {
<add> challengeTitle: title,
<add> challengePath: `${superBlock}/${dasherize(block)}/${dashedName}`
<add> };
<ide> return map;
<ide> }, {});
<ide> });
<ide><path>client/src/components/profile/components/TimeLine.js
<ide> import {
<ide> challengeIdToNameMapSelector,
<ide> fetchIdToNameMap
<ide> } from '../../../templates/Challenges/redux';
<del>import { blockNameify } from '../../../../utils/blockNameify';
<ide> import { FullWidthRow } from '../../helpers';
<ide> import SolutionViewer from '../../settings/SolutionViewer';
<ide>
<ide> const propTypes = {
<ide> })
<ide> ),
<ide> fetchIdToNameMap: PropTypes.func.isRequired,
<del> idToNameMap: PropTypes.objectOf(PropTypes.string),
<add> idToNameMap: PropTypes.objectOf(
<add> PropTypes.shape({
<add> challengePath: PropTypes.string,
<add> challengeTitle: PropTypes.string
<add> })
<add> ),
<ide> username: PropTypes.string
<ide> };
<ide>
<ide> class Timeline extends Component {
<ide> renderCompletion(completed) {
<ide> const { idToNameMap } = this.props;
<ide> const { id, completedDate } = completed;
<del> const challengeDashedName = idToNameMap[id];
<add> const { challengeTitle, challengePath } = idToNameMap[id];
<ide> return (
<ide> <tr key={id}>
<ide> <td>
<del> <a href={`/challenges/${challengeDashedName}`}>
<del> {blockNameify(challengeDashedName)}
<del> </a>
<add> <Link to={`/learn/${challengePath}`}>{challengeTitle}</Link>
<ide> </td>
<ide> <td className='text-center'>
<ide> <time dateTime={format(completedDate, 'YYYY-MM-DDTHH:MM:SSZ')}>
<ide> class Timeline extends Component {
<ide> </thead>
<ide> <tbody>
<ide> {reverse(
<del> sortBy(completedMap, ['completedDate']).filter(
<del> ({ id }) => id in idToNameMap
<del> )
<add> sortBy(completedMap, ['completedDate']).filter(challenge => {
<add> return (
<add> challenge.challengeType !== 7 && idToNameMap[challenge.id]
<add> );
<add> })
<ide> ).map(this.renderCompletion)}
<ide> </tbody>
<ide> </Table>
<ide> class Timeline extends Component {
<ide> >
<ide> <Modal.Header closeButton={true}>
<ide> <Modal.Title id='contained-modal-title'>
<del> {`${username}'s Solution to ${blockNameify(idToNameMap[id])}`}
<add> {`${username}'s Solution to ${idToNameMap[id].challengeTitle}`}
<ide> </Modal.Title>
<ide> </Modal.Header>
<ide> <Modal.Body> | 2 |
PHP | PHP | update paginator.php | 2000c97988d40dd873dba1d2e787d8c2312a98c9 | <ide><path>src/Illuminate/Pagination/Paginator.php
<ide> public function render($view = null, $data = [])
<ide> /**
<ide> * Manually indicate that the paginator does have more pages.
<ide> *
<del> * @param bool $value
<add> * @param bool $hasMore
<ide> * @return $this
<ide> */
<del> public function hasMorePagesWhen($value = true)
<add> public function hasMorePagesWhen($hasMore = true)
<ide> {
<del> $this->hasMore = $value;
<add> $this->hasMore = $hasMore;
<ide>
<ide> return $this;
<ide> } | 1 |
Javascript | Javascript | take advantage of native speed when we can | 8709b562efee98fd6a456ca991a45c152ea5c648 | <ide><path>moment.js
<ide> toISOString : function () {
<ide> var m = moment(this).utc();
<ide> if (0 < m.year() && m.year() <= 9999) {
<del> return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
<add> if ('function' === typeof Date.prototype.toISOString) {
<add> // native implementation is ~50x faster, use it when we can
<add> return this.toDate().toISOString();
<add> } else {
<add> return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
<add> }
<ide> } else {
<ide> return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
<ide> } | 1 |
Javascript | Javascript | add type support for template base class | 86aa18d6990f4102704854ad5dc76b1cc45323f0 | <ide><path>lib/Template.js
<ide> MIT License http://www.opensource.org/licenses/mit-license.php
<ide> Author Tobias Koppers @sokra
<ide> */
<del>"use strict";
<add>/** @typedef {typeof import("./Module")} Module */
<add>/** @typedef {typeof import("./Chunk")} Chunk */
<add>/** @typedef {typeof import("./ModuleTemplate")} ModuleTemplate */
<add>/** @typedef {import("webpack-sources").ConcatSource} ConcatSource */
<ide>
<ide> const { ConcatSource } = require("webpack-sources");
<ide>
<ide> const COMMENT_END_REGEX = /\*\//g;
<ide> const PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g;
<ide> const MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
<ide>
<add>/**
<add> * @typedef {Object} HasId
<add> * @property {number} id
<add> * */
<add>
<add>/**
<add> * @typedef {(m: Module, idx: number) => boolean} ModuleFilterPredicate
<add> */
<add>
<add>/**
<add> * @param {HasId} a first id object to be sorted
<add> * @param {HasId} b second id object to be sorted against
<add> * @return {-1|0|1} the sort value
<add> */
<ide> const stringifyIdSortPredicate = (a, b) => {
<ide> var aId = a.id + "";
<ide> var bId = b.id + "";
<ide> const stringifyIdSortPredicate = (a, b) => {
<ide> return 0;
<ide> };
<ide>
<add>//TODO: Change type to Module when import works
<add>//https://github.com/Microsoft/TypeScript/issues/23375
<add>/**
<add> * @param {HasId} module the module to compare against
<add> * @return {boolean} return true if module.id is equal to type "number"
<add> */
<ide> const moduleIdIsNumber = module => {
<ide> return typeof module.id === "number";
<ide> };
<ide>
<del>module.exports = class Template {
<add>class Template {
<add> /**
<add> *
<add> * @param {Function} fn - a runtime function (.runtime.js) "template"
<add> * @return {string} the updated and normalized function string
<add> */
<ide> static getFunctionContent(fn) {
<ide> return fn
<ide> .toString()
<ide> .replace(FUNCTION_CONTENT_REGEX, "")
<ide> .replace(INDENT_MULTILINE_REGEX, "")
<ide> .replace(LINE_SEPARATOR_REGEX, "\n");
<ide> }
<del>
<add> /**
<add> * @param {string} str the string converted to identifier
<add> * @return {string} created identifier
<add> */
<ide> static toIdentifier(str) {
<ide> if (typeof str !== "string") return "";
<ide> return str
<ide> .replace(IDENTIFIER_NAME_REPLACE_REGEX, "_$1")
<ide> .replace(IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX, "_");
<ide> }
<del>
<add> /**
<add> *
<add> * @param {string} str string to be converted to commented in bundle code
<add> * @return {string} returns a commented version of string
<add> */
<ide> static toComment(str) {
<ide> if (!str) return "";
<ide> return `/*! ${str.replace(COMMENT_END_REGEX, "* /")} */`;
<ide> }
<ide>
<add> /**
<add> *
<add> * @param {string} str string to be converted to "normal comment"
<add> * @return {string} returns a commented version of string
<add> */
<ide> static toNormalComment(str) {
<ide> if (!str) return "";
<ide> return `/* ${str.replace(COMMENT_END_REGEX, "* /")} */`;
<ide> }
<ide>
<add> /**
<add> * @param {string} str string path to be normalized
<add> * @return {string} normalized bundle-safe path
<add> */
<ide> static toPath(str) {
<ide> if (typeof str !== "string") return "";
<ide> return str
<ide> module.exports = class Template {
<ide> }
<ide>
<ide> // map number to a single character a-z, A-Z or <_ + number> if number is too big
<add> /**
<add> *
<add> * @param {number} n number to convert to ident
<add> * @return {string} returns single character ident
<add> */
<ide> static numberToIdentifer(n) {
<ide> // lower case
<ide> if (n < DELTA_A_TO_Z)
<ide> module.exports = class Template {
<ide> );
<ide> }
<ide>
<add> /**
<add> *
<add> * @param {string} str string to convert to identity
<add> * @return {string} converted identity
<add> */
<ide> static indent(str) {
<ide> if (Array.isArray(str)) {
<ide> return str.map(Template.indent).join("\n");
<ide> module.exports = class Template {
<ide> }
<ide> }
<ide>
<add> /**
<add> *
<add> * @param {string|string[]} str string to create prefix for
<add> * @param {string} prefix prefix to compose
<add> * @return {string} returns new prefix string
<add> */
<ide> static prefix(str, prefix) {
<ide> if (Array.isArray(str)) {
<ide> str = str.join("\n");
<ide> module.exports = class Template {
<ide> return ind + str.replace(/\n([^\n])/g, "\n" + prefix + "$1");
<ide> }
<ide>
<add> /**
<add> *
<add> * @param {string|string[]} str string or string collection
<add> * @return {string} returns a single string from array
<add> */
<ide> static asString(str) {
<ide> if (Array.isArray(str)) {
<ide> return str.join("\n");
<ide> }
<ide> return str;
<ide> }
<ide>
<add> /**
<add> *
<add> * @param {HasId[]} modules - a collection of modules to get array bounds for
<add> * @return {[number, number] | false} returns the upper and lower array bounds
<add> * or false if not every module has a number based id
<add> */
<ide> static getModulesArrayBounds(modules) {
<ide> if (!modules.every(moduleIdIsNumber)) return false;
<ide> var maxId = -Infinity;
<ide> module.exports = class Template {
<ide> return arrayOverhead < objectOverhead ? [minId, maxId] : false;
<ide> }
<ide>
<add> //TODO: replace any for Chunk and ModuleTemplate types instead.
<add> //https://github.com/Microsoft/TypeScript/issues/23375
<add> /**
<add> *
<add> * @param {any} chunk chunk whose modules will be rendered
<add> * @param {ModuleFilterPredicate} filterFn function used to filter modules from chunk to render
<add> * @param {any} moduleTemplate ModuleTemplate instance used to render modules
<add> * @param {any | any[]} dependencyTemplates templates needed for each module to render dependencies
<add> * @param {string} prefix applying prefix strings
<add> * @return {ConcatSource} rendered chunk modules in a Source object
<add> */
<ide> static renderChunkModules(
<ide> chunk,
<ide> filterFn,
<ide> module.exports = class Template {
<ide> }
<ide> return source;
<ide> }
<del>};
<add>}
<add>
<add>module.exports = Template; | 1 |
Javascript | Javascript | add dispose spec | 3a5c8271629f6ebd9d4b03779f3b019d1bad5bc9 | <ide><path>spec/auto-update-manager-spec.js
<ide> fdescribe('AutoUpdateManager (renderer)', () => {
<ide> })
<ide> })
<ide> })
<add>
<add> describe('::dispose', () => {
<add> it('subscribes to "update-not-available" event', () => {
<add> const spy = jasmine.createSpy('spy')
<add> const doneIndicator = jasmine.createSpy('spy')
<add> atom.applicationDelegate.onUpdateNotAvailable(doneIndicator)
<add> autoUpdateManager.dispose()
<add> autoUpdateManager.onDidBeginCheckingForUpdate(spy)
<add> autoUpdateManager.onDidBeginDownload(spy)
<add> autoUpdateManager.onDidCompleteDownload(spy)
<add> autoUpdateManager.onUpdateNotAvailable(spy)
<add> electronAutoUpdater.emit('checking-for-update')
<add> electronAutoUpdater.emit('update-available')
<add> electronAutoUpdater.emit('update-downloaded', null, null, {releaseVersion: '1.2.3'})
<add> electronAutoUpdater.emit('update-not-available')
<add>
<add> waitsFor(() => {
<add> return doneIndicator.callCount === 1
<add> })
<add>
<add> runs(() => {
<add> expect(spy.callCount).toBe(0)
<add> })
<add> })
<add> })
<ide> }) | 1 |
Python | Python | add coverage for blueprint.app_errorhandler | 9fddecd4d92763f38a42a3842abab70b0a6f4678 | <ide><path>tests/test_blueprints.py
<ide> def blue_func_test():
<ide> assert c.get('/decorator').data == b'boom'
<ide> assert c.get('/function').data == b'bam'
<ide>
<add>def test_blueprint_app_error_handling():
<add> errors = flask.Blueprint('errors', __name__)
<add>
<add> @errors.app_errorhandler(403)
<add> def forbidden_handler(e):
<add> return 'you shall not pass', 403
<add>
<add> app = flask.Flask(__name__)
<add>
<add> @app.route('/forbidden')
<add> def app_forbidden():
<add> flask.abort(403)
<add>
<add> forbidden_bp = flask.Blueprint('forbidden_bp', __name__)
<add>
<add> @forbidden_bp.route('/nope')
<add> def bp_forbidden():
<add> flask.abort(403)
<add>
<add> app.register_blueprint(errors)
<add> app.register_blueprint(forbidden_bp)
<add>
<add> c = app.test_client()
<add>
<add> assert c.get('/forbidden').data == b'you shall not pass'
<add> assert c.get('/nope').data == b'you shall not pass'
<add>
<ide> def test_blueprint_url_definitions():
<ide> bp = flask.Blueprint('test', __name__)
<ide> | 1 |
Python | Python | add seed parameter for image augmentation method. | cebf2084ebb0a603383ceb6807653921796cd095 | <ide><path>keras/preprocessing/image.py
<ide> def standardize(self, x):
<ide> 'first by calling `.fit(numpy_data)`.')
<ide> return x
<ide>
<del> def random_transform(self, x):
<add> def random_transform(self, x, seed=None):
<ide> """Randomly augment a single image tensor.
<ide>
<ide> # Arguments
<ide> x: 3D tensor, single image.
<add> seed: random seed.
<ide>
<ide> # Returns
<ide> A randomly transformed version of the input (same shape).
<ide> def random_transform(self, x):
<ide> img_col_axis = self.col_axis - 1
<ide> img_channel_axis = self.channel_axis - 1
<ide>
<add> if seed is not None:
<add> np.random.seed(seed)
<add>
<ide> # use composition of homographies
<ide> # to generate final transform that needs to be applied
<ide> if self.rotation_range: | 1 |
Text | Text | add dot in documentations | fa939f0cf59fdafae6748b390bcfc733f188b425 | <ide><path>README.md
<ide> Binaries, installers, and source tarballs are available at
<ide> The [latest](https://nodejs.org/download/release/latest/) directory is an
<ide> alias for the latest Current release. The latest LTS release from an LTS
<ide> line is available in the form: latest-_codename_. For example:
<del><https://nodejs.org/download/release/latest-argon>
<add><https://nodejs.org/download/release/latest-argon>.
<ide>
<ide> #### Nightly Releases
<ide> **Nightly** builds are available at | 1 |
Ruby | Ruby | require time extension for 3.seconds default | b00214d214c6b0a2208d5861de1a7b158accddf0 | <ide><path>activejob/lib/active_job/exceptions.rb
<add>require 'active_support/core_ext/numeric/time'
<add>
<ide> module ActiveJob
<ide> # Provides behavior for retrying and discarding jobs on exceptions.
<ide> module Exceptions | 1 |
Python | Python | pull xcode_emulation.py from node-gyp | 0673dfc0d8944a37e17fbaa683022f4b9e035577 | <ide><path>tools/gyp/pylib/gyp/mac_tool.py
<ide> import sys
<ide> import tempfile
<ide>
<add>PY3 = bytes != str
<add>
<ide>
<ide> def main(args):
<ide> executor = MacTool()
<ide> def ExecFilterLibtool(self, *cmd_list):
<ide> env['ZERO_AR_DATE'] = '1'
<ide> libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
<ide> _, err = libtoolout.communicate()
<add> if PY3:
<add> err = err.decode('utf-8')
<ide> for line in err.splitlines():
<ide> if not libtool_re.match(line) and not libtool_re5.match(line):
<ide> print(line, file=sys.stderr)
<ide><path>tools/gyp/pylib/gyp/xcode_emulation.py
<ide> import tempfile
<ide> from gyp.common import GypError
<ide>
<add>PY3 = bytes != str
<add>
<ide> # Populated lazily by XcodeVersion, for efficiency, and to fix an issue when
<ide> # "xcodebuild" is called too quickly (it has been found to return incorrect
<ide> # version number).
<ide> def _GetSdkVersionInfoItem(self, sdk, infoitem):
<ide> # most sensible route and should still do the right thing.
<ide> try:
<ide> return GetStdoutQuiet(['xcrun', '--sdk', sdk, infoitem])
<del> except:
<add> except GypError:
<ide> pass
<ide>
<ide> def _SdkRoot(self, configname):
<ide> def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
<ide> # extensions and provide loader and main function.
<ide> # These flags reflect the compilation options used by xcode to compile
<ide> # extensions.
<del> if XcodeVersion() < '0900':
<add> xcode_version, _ = XcodeVersion()
<add> if xcode_version < '0900':
<ide> ldflags.append('-lpkstart')
<ide> ldflags.append(sdk_root +
<ide> '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
<ide> def GetExtraPlistItems(self, configname=None):
<ide> cache = {}
<ide> cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild()
<ide>
<del> xcode, xcode_build = XcodeVersion()
<del> cache['DTXcode'] = xcode
<add> xcode_version, xcode_build = XcodeVersion()
<add> cache['DTXcode'] = xcode_version
<ide> cache['DTXcodeBuild'] = xcode_build
<ide> compiler = self.xcode_settings[configname].get('GCC_VERSION')
<ide> if compiler is not None:
<ide> def GetExtraPlistItems(self, configname=None):
<ide> sdk_root = self._DefaultSdkRoot()
<ide> sdk_version = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-version')
<ide> cache['DTSDKName'] = sdk_root + (sdk_version or '')
<del> if xcode >= '0720':
<add> if xcode_version >= '0720':
<ide> cache['DTSDKBuild'] = self._GetSdkVersionInfoItem(
<ide> sdk_root, '--show-sdk-build-version')
<del> elif xcode >= '0430':
<add> elif xcode_version >= '0430':
<ide> cache['DTSDKBuild'] = sdk_version
<ide> else:
<ide> cache['DTSDKBuild'] = cache['BuildMachineOSBuild']
<ide> def _DefaultSdkRoot(self):
<ide> project, then the environment variable was empty. Starting with this
<ide> version, Xcode uses the name of the newest SDK installed.
<ide> """
<del> xcode_version, xcode_build = XcodeVersion()
<add> xcode_version, _ = XcodeVersion()
<ide> if xcode_version < '0500':
<ide> return ''
<ide> default_sdk_path = self._XcodeSdkPath('')
<ide> def _DefaultSdkRoot(self):
<ide> return default_sdk_root
<ide> try:
<ide> all_sdks = GetStdout(['xcodebuild', '-showsdks'])
<del> except:
<add> except GypError:
<ide> # If xcodebuild fails, there will be no valid SDKs
<ide> return ''
<ide> for line in all_sdks.splitlines():
<ide> def XcodeVersion():
<ide> # Xcode 3.2.6
<ide> # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0
<ide> # BuildVersion: 10M2518
<del> # Convert that to '0463', '4H1503'.
<add> # Convert that to ('0463', '4H1503') or ('0326', '10M2518').
<ide> global XCODE_VERSION_CACHE
<ide> if XCODE_VERSION_CACHE:
<ide> return XCODE_VERSION_CACHE
<add> version = ""
<add> build = ""
<ide> try:
<ide> version_list = GetStdoutQuiet(['xcodebuild', '-version']).splitlines()
<ide> # In some circumstances xcodebuild exits 0 but doesn't return
<ide> def XcodeVersion():
<ide> # checking that version.
<ide> if len(version_list) < 2:
<ide> raise GypError("xcodebuild returned unexpected results")
<del> except:
<del> version = CLTVersion()
<del> if version:
<del> version = re.match(r'(\d+\.\d+\.?\d*)', version).groups()[0]
<del> else:
<add> version = version_list[0].split()[-1] # Last word on first line
<add> build = version_list[-1].split()[-1] # Last word on last line
<add> except GypError: # Xcode not installed so look for XCode Command Line Tools
<add> version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
<add> if not version:
<ide> raise GypError("No Xcode or CLT version detected!")
<del> # The CLT has no build information, so we return an empty string.
<del> version_list = [version, '']
<del> version = version_list[0]
<del> build = version_list[-1]
<del> # Be careful to convert "4.2" to "0420":
<del> version = version.split()[-1].replace('.', '')
<del> version = (version + '0' * (3 - len(version))).zfill(4)
<del> if build:
<del> build = build.split()[-1]
<add> # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100":
<add> version = version.split(".")[:3] # Just major, minor, micro
<add> version[0] = version[0].zfill(2) # Add a leading zero if major is one digit
<add> version = ("".join(version) + "00")[:4] # Limit to exactly four characters
<ide> XCODE_VERSION_CACHE = (version, build)
<ide> return XCODE_VERSION_CACHE
<ide>
<ide> def CLTVersion():
<ide> try:
<ide> output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key])
<ide> return re.search(regex, output).groupdict()['version']
<del> except:
<add> except GypError:
<ide> continue
<ide>
<ide>
<ide> def GetStdoutQuiet(cmdlist):
<ide> job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE,
<ide> stderr=subprocess.PIPE)
<ide> out = job.communicate()[0]
<add> if PY3:
<add> out = out.decode("utf-8")
<ide> if job.returncode != 0:
<ide> raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))
<ide> return out.rstrip('\n')
<ide> def GetStdout(cmdlist):
<ide> Raises |GypError| if the command return with a non-zero return code."""
<ide> job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
<ide> out = job.communicate()[0]
<add> if PY3:
<add> out = out.decode("utf-8")
<ide> if job.returncode != 0:
<ide> sys.stderr.write(out + '\n')
<ide> raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))
<ide> def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration,
<ide> install_name_base = xcode_settings.GetInstallNameBase()
<ide> if install_name_base:
<ide> env['DYLIB_INSTALL_NAME_BASE'] = install_name_base
<del> if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
<add> xcode_version, _ = XcodeVersion()
<add> if xcode_version >= '0500' and not env.get('SDKROOT'):
<ide> sdk_root = xcode_settings._SdkRoot(configuration)
<ide> if not sdk_root:
<ide> sdk_root = xcode_settings._XcodeSdkPath('') | 2 |
Mixed | Ruby | add fail fast to test runner | 2310fb9d810f11681c1eecdb88518c23c8b379cf | <ide><path>railties/CHANGELOG.md
<add>* Add fail fast to `bin/rails test`
<add>
<add> Adding `--fail-fast` or `-f` when running tests will interrupt the run on
<add> the first failure:
<add>
<add> ```
<add> # Running:
<add>
<add> ................................................S......E
<add>
<add> ArgumentError: Wups! Bet you didn't expect this!
<add> test/models/bunny_test.rb:19:in `block in <class:BunnyTest>'
<add>
<add> bin/rails test test/models/bunny_test.rb:18
<add>
<add> ....................................F
<add>
<add> This failed
<add>
<add> bin/rails test test/models/bunny_test.rb:14
<add>
<add> Interrupted. Exiting...
<add>
<add>
<add> Finished in 0.051427s, 1808.3872 runs/s, 1769.4972 assertions/s.
<add>
<add> ```
<add>
<add> Note that any unexpected errors don't abort the run.
<add>
<add> *Kasper Timm Hansen*
<add>
<ide> * Add inline output to `bin/rails test`
<ide>
<ide> Any failures or errors (and skips if running in verbose mode) are output
<ide><path>railties/lib/rails/test_unit/minitest_plugin.rb
<ide> def self.plugin_rails_options(opts, options)
<ide> options[:output_inline] = false
<ide> end
<ide>
<add> opts.on("-f", "--fail-fast",
<add> "Abort test run on first failure") do
<add> options[:fail_fast] = true
<add> end
<add>
<ide> options[:patterns] = opts.order!
<ide> end
<ide>
<ide><path>railties/lib/rails/test_unit/reporter.rb
<ide> def record(result)
<ide> io.puts format_rerun_snippet(result)
<ide> io.puts
<ide> end
<add>
<add> if fail_fast? && result.failure && !result.error? && !result.skipped?
<add> raise Interrupt
<add> end
<ide> end
<ide>
<ide> def report
<ide> def output_inline?
<ide> options.fetch(:output_inline, true)
<ide> end
<ide>
<add> def fail_fast?
<add> options[:fail_fast]
<add> end
<add>
<ide> def format_rerun_snippet(result)
<ide> location, line = result.method(result.name).source_location
<ide> "#{self.executable} #{relative_path_for(location)}:#{line}"
<ide><path>railties/test/application/test_runner_test.rb
<ide> def test_post
<ide> assert_match %r{Running:\n\nF\n\nwups!\n\nbin/rails test test/models/post_test.rb:4}, output
<ide> end
<ide>
<add> def test_fail_fast
<add> app_file 'test/models/post_test.rb', <<-RUBY
<add> require 'test_helper'
<add>
<add> class PostTest < ActiveSupport::TestCase
<add> def test_post
<add> assert false, 'wups!'
<add> end
<add> end
<add> RUBY
<add>
<add> assert_match(/Interrupt/,
<add> capture(:stderr) { run_test_command('test/models/post_test.rb --fail-fast') })
<add> end
<add>
<ide> def test_raise_error_when_specified_file_does_not_exist
<ide> error = capture(:stderr) { run_test_command('test/not_exists.rb') }
<ide> assert_match(%r{cannot load such file.+test/not_exists\.rb}, error)
<ide><path>railties/test/test_unit/reporter_test.rb
<ide> def woot; end
<ide> assert_no_match 'Failed tests:', @output.string
<ide> end
<ide>
<add> test "fail fast interrupts run on failure" do
<add> fail_fast = Rails::TestUnitReporter.new @output, fail_fast: true
<add> interrupt_raised = false
<add>
<add> # Minitest passes through Interrupt, catch it manually.
<add> begin
<add> fail_fast.record(failed_test)
<add> rescue Interrupt
<add> interrupt_raised = true
<add> ensure
<add> assert interrupt_raised, 'Expected Interrupt to be raised.'
<add> end
<add> end
<add>
<add> test "fail fast does not interrupt run errors or skips" do
<add> fail_fast = Rails::TestUnitReporter.new @output, fail_fast: true
<add>
<add> fail_fast.record(errored_test)
<add> assert_no_match 'Failed tests:', @output.string
<add>
<add> fail_fast.record(skipped_test)
<add> assert_no_match 'Failed tests:', @output.string
<add> end
<add>
<ide> private
<ide> def assert_rerun_snippet_count(snippet_count)
<ide> assert_equal snippet_count, @output.string.scan(%r{^bin/rails test }).size | 5 |
PHP | PHP | apply fixes from styleci | d30bc52df0d290dec11c3822f26a89335d15d815 | <ide><path>src/Illuminate/View/ComponentAttributeBag.php
<ide> public function whereStartsWith($string)
<ide> return Str::startsWith($key, $string);
<ide> });
<ide> }
<del>
<add>
<ide> /**
<ide> * Return a bag of attributes with keys that do not start with the given value / pattern.
<ide> * | 1 |
Javascript | Javascript | update google strategy | 3016af41e56f397a9c47328427c5652f468cc9fe | <ide><path>config/passport.js
<ide> passport.use(new GoogleStrategy(secrets.google, function(req, accessToken, refre
<ide> } else {
<ide> User.findOne({ google: profile.id }, function(err, existingUser) {
<ide> if (existingUser) return done(null, existingUser);
<del> User.findOne({ email: profile._json.email }, function(err2, existingEmailUser) {
<add> User.findOne({ email: profile._json.email }, function(err, existingEmailUser) {
<ide> if(existingEmailUser) {
<del> req.flash('errors', { msg: 'There is already an account using this Google account\'s email address. Sign in with that account or delete it, then link it with your current account.' });
<del> done(err2);
<add> req.flash('errors', { msg: 'There is already an account using this email address. Sign in to that account and link it with GitHub manually from Account Settings.' });
<add> done(err);
<ide> } else {
<ide> var user = new User();
<ide> user.email = profile._json.email; | 1 |
PHP | PHP | fix coding style error | fdeec5e73354e2cf6455483fc884b23efe8a7c5a | <ide><path>lib/Cake/Database/Schema/MysqlSchema.php
<ide> public function describeForeignKeySql($table) {
<ide> */
<ide> public function convertForeignKey(Table $table, $row) {
<ide> }
<add>
<ide> /**
<ide> * Generate the SQL to truncate a table.
<ide> * | 1 |
Javascript | Javascript | replace concatenation with template literals | 3566195196b81390d8dc1a7ccbca9a2c118df624 | <ide><path>test/parallel/test-path-parse-format.js
<ide> function checkFormat(path, testCases) {
<ide> }, common.expectsError({
<ide> code: 'ERR_INVALID_ARG_TYPE',
<ide> type: TypeError,
<del> message: 'The "pathObject" argument must be of type Object. Received ' +
<del> 'type ' + typeName(pathObject)
<add> message: 'The "pathObject" argument must be of type Object. ' +
<add> `Received type ${typeName(pathObject)}`
<ide> }));
<ide> });
<ide> } | 1 |
Javascript | Javascript | save profile now working in firefox | 77bb1023986225a12aaa1b45b85703df5deaf95a | <ide><path>packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
<ide> export default function ProfilingImportExportButtons() {
<ide> const {profilerStore} = store;
<ide>
<ide> const inputRef = useRef<HTMLInputElement | null>(null);
<add> const downloadRef = useRef<HTMLAnchorElement | null>(null);
<ide>
<ide> const {dispatch: modalDialogDispatch} = useContext(ModalDialogContext);
<ide>
<ide> export default function ProfilingImportExportButtons() {
<ide> return;
<ide> }
<ide>
<del> if (profilingData !== null) {
<add> if (profilingData !== null && downloadRef.current !== null) {
<ide> const profilingDataExport = prepareProfilingDataExport(profilingData);
<ide> const date = new Date();
<ide> const dateString = date
<ide> export default function ProfilingImportExportButtons() {
<ide> })
<ide> .replace(/:/g, '-');
<ide> downloadFile(
<add> downloadRef.current,
<ide> `profiling-data.${dateString}.${timeString}.json`,
<ide> JSON.stringify(profilingDataExport, null, 2),
<ide> );
<ide> export default function ProfilingImportExportButtons() {
<ide> onChange={handleFiles}
<ide> tabIndex={-1}
<ide> />
<add> <a ref={downloadRef} className={styles.Input} />
<ide> <Button
<ide> disabled={isProfiling}
<ide> onClick={uploadData}
<ide><path>packages/react-devtools-shared/src/devtools/views/utils.js
<ide> export function serializeHooksForCopy(hooks: HooksTree | null): string {
<ide> // Without this, we would see a "Download failed: network error" failure.
<ide> let downloadUrl = null;
<ide>
<del>export function downloadFile(filename: string, text: string): void {
<add>export function downloadFile(
<add> element: HTMLAnchorElement,
<add> filename: string,
<add> text: string,
<add>): void {
<ide> const blob = new Blob([text], {type: 'text/plain;charset=utf-8'});
<ide>
<ide> if (downloadUrl !== null) {
<ide> export function downloadFile(filename: string, text: string): void {
<ide>
<ide> downloadUrl = URL.createObjectURL(blob);
<ide>
<del> const element = document.createElement('a');
<ide> element.setAttribute('href', downloadUrl);
<ide> element.setAttribute('download', filename);
<del> element.style.display = 'none';
<del> ((document.body: any): HTMLBodyElement).appendChild(element);
<ide>
<ide> element.click();
<del>
<del> ((document.body: any): HTMLBodyElement).removeChild(element);
<ide> }
<ide>
<ide> export function truncateText(text: string, maxLength: number): string { | 2 |
Python | Python | use numpy versions of getargspec, formatargspec | 6a548b8d3effcb2754414444159f1757b2715d6d | <ide><path>numpy/lib/utils.py
<ide> from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype
<ide> from numpy.core import ndarray, ufunc, asarray
<ide>
<add># getargspec and formatargspec were removed in Python 3.6
<add>from numpy.compat import getargspec, formatargspec
<add>
<ide> __all__ = [
<ide> 'issubclass_', 'issubsctype', 'issubdtype', 'deprecate',
<ide> 'deprecate_with_doc', 'get_include', 'info', 'source', 'who',
<ide> def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
<ide>
<ide> elif inspect.isfunction(object):
<ide> name = object.__name__
<del> arguments = inspect.formatargspec(*inspect.getargspec(object))
<add> arguments = formatargspec(*getargspec(object))
<ide>
<ide> if len(name+arguments) > maxwidth:
<ide> argstr = _split_line(name, arguments, maxwidth)
<ide> def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
<ide> arguments = "()"
<ide> try:
<ide> if hasattr(object, '__init__'):
<del> arguments = inspect.formatargspec(
<del> *inspect.getargspec(object.__init__.__func__)
<add> arguments = formatargspec(
<add> *getargspec(object.__init__.__func__)
<ide> )
<ide> arglist = arguments.split(', ')
<ide> if len(arglist) > 1:
<ide> def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
<ide> print("Instance of class: ", object.__class__.__name__, file=output)
<ide> print(file=output)
<ide> if hasattr(object, '__call__'):
<del> arguments = inspect.formatargspec(
<del> *inspect.getargspec(object.__call__.__func__)
<add> arguments = formatargspec(
<add> *getargspec(object.__call__.__func__)
<ide> )
<ide> arglist = arguments.split(', ')
<ide> if len(arglist) > 1:
<ide> def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
<ide>
<ide> elif inspect.ismethod(object):
<ide> name = object.__name__
<del> arguments = inspect.formatargspec(
<del> *inspect.getargspec(object.__func__)
<add> arguments = formatargspec(
<add> *getargspec(object.__func__)
<ide> )
<ide> arglist = arguments.split(', ')
<ide> if len(arglist) > 1: | 1 |
Javascript | Javascript | change var to const | f86f5736da72ad4f3fb50692461222590e2f0258 | <ide><path>benchmark/fs/readfile-partitioned.js
<ide> function main(conf) {
<ide> fs.writeFileSync(filename, data);
<ide> data = null;
<ide>
<del> var zipData = Buffer.alloc(1024, 'a');
<add> const zipData = Buffer.alloc(1024, 'a');
<ide>
<ide> var reads = 0;
<ide> var zips = 0;
<ide><path>benchmark/fs/write-stream-throughput.js
<ide> function main({ dur, encodingType, size }) {
<ide> var started = false;
<ide> var ended = false;
<ide>
<del> var f = fs.createWriteStream(filename);
<add> const f = fs.createWriteStream(filename);
<ide> f.on('drain', write);
<ide> f.on('open', write);
<ide> f.on('close', done);
<ide><path>benchmark/http/_chunky_http_client.js
<ide> function main({ len, n }) {
<ide> const add = 11;
<ide> var count = 0;
<ide> const PIPE = process.env.PIPE_NAME;
<del> var socket = net.connect(PIPE, () => {
<add> const socket = net.connect(PIPE, () => {
<ide> bench.start();
<ide> WriteHTTPHeaders(socket, 1, len);
<ide> socket.setEncoding('utf8');
<ide><path>benchmark/http/http_server_for_chunky_client.js
<ide> process.env.PIPE_NAME = PIPE;
<ide>
<ide> tmpdir.refresh();
<ide>
<del>var server;
<del>
<del>server = http.createServer((req, res) => {
<add>const server = http.createServer((req, res) => {
<ide> const headers = {
<ide> 'content-type': 'text/plain',
<ide> 'content-length': '2'
<ide><path>benchmark/http/set-header.js
<ide> const c = 50;
<ide> // setHeaderWH: setHeader(...), writeHead(status, ...)
<ide> function main({ res }) {
<ide> process.env.PORT = PORT;
<del> var server = require('../fixtures/simple-http-server.js')
<add> const server = require('../fixtures/simple-http-server.js')
<ide> .listen(PORT)
<ide> .on('listening', () => {
<ide> const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`;
<ide><path>benchmark/http/simple.js
<ide> const bench = common.createBenchmark(main, {
<ide> });
<ide>
<ide> function main({ type, len, chunks, c, chunkedEnc, res }) {
<del> var server = require('../fixtures/simple-http-server.js')
<add> const server = require('../fixtures/simple-http-server.js')
<ide> .listen(common.PORT)
<ide> .on('listening', () => {
<ide> const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`;
<ide><path>benchmark/http/upgrade.js
<ide> const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
<ide> '\r\n\r\n';
<ide>
<ide> function main({ n }) {
<del> var server = require('../fixtures/simple-http-server.js')
<add> const server = require('../fixtures/simple-http-server.js')
<ide> .listen(common.PORT)
<ide> .on('listening', () => {
<ide> bench.start();
<ide><path>benchmark/tls/throughput.js
<ide> const tls = require('tls');
<ide>
<ide> function main({ dur, type, size }) {
<ide> var encoding;
<del> var server;
<ide> var chunk;
<ide> switch (type) {
<ide> case 'buf':
<ide> function main({ dur, type, size }) {
<ide> ciphers: 'AES256-GCM-SHA384'
<ide> };
<ide>
<del> server = tls.createServer(options, onConnection);
<add> const server = tls.createServer(options, onConnection);
<ide> var conn;
<ide> server.listen(common.PORT, () => {
<ide> const opt = { port: common.PORT, rejectUnauthorized: false };
<ide><path>benchmark/tls/tls-connect.js
<ide> function makeConnection() {
<ide> port: common.PORT,
<ide> rejectUnauthorized: false
<ide> };
<del> var conn = tls.connect(options, () => {
<add> const conn = tls.connect(options, () => {
<ide> clientConn++;
<ide> conn.on('error', (er) => {
<ide> console.error('client error', er);
<ide><path>lib/_http_agent.js
<ide> function Agent(options) {
<ide> this.maxFreeSockets = this.options.maxFreeSockets || 256;
<ide>
<ide> this.on('free', (socket, options) => {
<del> var name = this.getName(options);
<add> const name = this.getName(options);
<ide> debug('agent.on(free)', name);
<ide>
<ide> if (socket.writable &&
<ide> Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
<ide> if (!options.servername)
<ide> options.servername = calculateServerName(options, req);
<ide>
<del> var name = this.getName(options);
<add> const name = this.getName(options);
<ide> if (!this.sockets[name]) {
<ide> this.sockets[name] = [];
<ide> }
<ide>
<del> var freeLen = this.freeSockets[name] ? this.freeSockets[name].length : 0;
<del> var sockLen = freeLen + this.sockets[name].length;
<add> const freeLen = this.freeSockets[name] ? this.freeSockets[name].length : 0;
<add> const sockLen = freeLen + this.sockets[name].length;
<ide>
<ide> if (freeLen) {
<ide> // We have a free socket, so use that.
<ide> Agent.prototype.createSocket = function createSocket(req, options, cb) {
<ide> if (!options.servername)
<ide> options.servername = calculateServerName(options, req);
<ide>
<del> var name = this.getName(options);
<add> const name = this.getName(options);
<ide> options._agentKey = name;
<ide>
<ide> debug('createConnection', name, options);
<ide> function installListeners(agent, s, options) {
<ide> }
<ide>
<ide> Agent.prototype.removeSocket = function removeSocket(s, options) {
<del> var name = this.getName(options);
<add> const name = this.getName(options);
<ide> debug('removeSocket', name, 'writable:', s.writable);
<del> var sets = [this.sockets];
<add> const sets = [this.sockets];
<ide>
<ide> // If the socket was destroyed, remove it from the free buffers too.
<ide> if (!s.writable)
<ide> Agent.prototype.reuseSocket = function reuseSocket(socket, req) {
<ide> };
<ide>
<ide> Agent.prototype.destroy = function destroy() {
<del> var sets = [this.freeSockets, this.sockets];
<add> const sets = [this.freeSockets, this.sockets];
<ide> for (var s = 0; s < sets.length; s++) {
<ide> var set = sets[s];
<ide> var keys = Object.keys(set);
<ide><path>lib/_http_client.js
<ide> function ClientRequest(input, options, cb) {
<ide> }
<ide>
<ide> var agent = options.agent;
<del> var defaultAgent = options._defaultAgent || Agent.globalAgent;
<add> const defaultAgent = options._defaultAgent || Agent.globalAgent;
<ide> if (agent === false) {
<ide> agent = new defaultAgent.constructor();
<ide> } else if (agent === null || agent === undefined) {
<ide> function ClientRequest(input, options, cb) {
<ide> }
<ide> this.agent = agent;
<ide>
<del> var protocol = options.protocol || defaultAgent.protocol;
<add> const protocol = options.protocol || defaultAgent.protocol;
<ide> var expectedProtocol = defaultAgent.protocol;
<ide> if (this.agent && this.agent.protocol)
<ide> expectedProtocol = this.agent.protocol;
<ide> function ClientRequest(input, options, cb) {
<ide> throw new ERR_INVALID_PROTOCOL(protocol, expectedProtocol);
<ide> }
<ide>
<del> var defaultPort = options.defaultPort ||
<add> const defaultPort = options.defaultPort ||
<ide> this.agent && this.agent.defaultPort;
<ide>
<del> var port = options.port = options.port || defaultPort || 80;
<del> var host = options.host = validateHost(options.hostname, 'hostname') ||
<add> const port = options.port = options.port || defaultPort || 80;
<add> const host = options.host = validateHost(options.hostname, 'hostname') ||
<ide> validateHost(options.host, 'host') || 'localhost';
<ide>
<del> var setHost = (options.setHost === undefined || Boolean(options.setHost));
<add> const setHost = (options.setHost === undefined || Boolean(options.setHost));
<ide>
<ide> this.socketPath = options.socketPath;
<ide>
<ide> if (options.timeout !== undefined)
<ide> this.timeout = getTimerDuration(options.timeout, 'timeout');
<ide>
<ide> var method = options.method;
<del> var methodIsString = (typeof method === 'string');
<add> const methodIsString = (typeof method === 'string');
<ide> if (method !== null && method !== undefined && !methodIsString) {
<ide> throw new ERR_INVALID_ARG_TYPE('method', 'string', method);
<ide> }
<ide> function ClientRequest(input, options, cb) {
<ide> }
<ide> }
<ide>
<del> var headersArray = Array.isArray(options.headers);
<add> const headersArray = Array.isArray(options.headers);
<ide> if (!headersArray) {
<ide> if (options.headers) {
<ide> var keys = Object.keys(options.headers);
<ide> function ClientRequest(input, options, cb) {
<ide> options.headers);
<ide> }
<ide>
<del> var oncreate = (err, socket) => {
<add> const oncreate = (err, socket) => {
<ide> if (called)
<ide> return;
<ide> called = true;
<ide> function emitAbortNT() {
<ide>
<ide> function createHangUpError() {
<ide> // eslint-disable-next-line no-restricted-syntax
<del> var error = new Error('socket hang up');
<add> const error = new Error('socket hang up');
<ide> error.code = 'ECONNRESET';
<ide> return error;
<ide> }
<ide>
<ide>
<ide> function socketCloseListener() {
<del> var socket = this;
<del> var req = socket._httpMessage;
<add> const socket = this;
<add> const req = socket._httpMessage;
<ide> debug('HTTP socket close');
<ide>
<ide> // Pull through final chunk, if anything is buffered.
<ide> function socketCloseListener() {
<ide> }
<ide>
<ide> function socketErrorListener(err) {
<del> var socket = this;
<del> var req = socket._httpMessage;
<add> const socket = this;
<add> const req = socket._httpMessage;
<ide> debug('SOCKET ERROR:', err.message, err.stack);
<ide>
<ide> if (req) {
<ide> function socketErrorListener(err) {
<ide> // Handle any pending data
<ide> socket.read();
<ide>
<del> var parser = socket.parser;
<add> const parser = socket.parser;
<ide> if (parser) {
<ide> parser.finish();
<ide> freeParser(parser, req, socket);
<ide> function socketErrorListener(err) {
<ide> }
<ide>
<ide> function freeSocketErrorListener(err) {
<del> var socket = this;
<add> const socket = this;
<ide> debug('SOCKET ERROR on FREE socket:', err.message, err.stack);
<ide> socket.destroy();
<ide> socket.emit('agentRemove');
<ide> }
<ide>
<ide> function socketOnEnd() {
<del> var socket = this;
<del> var req = this._httpMessage;
<del> var parser = this.parser;
<add> const socket = this;
<add> const req = this._httpMessage;
<add> const parser = this.parser;
<ide>
<ide> if (!req.res && !req.socket._hadError) {
<ide> // If we don't have a response then we know that the socket
<ide> function socketOnEnd() {
<ide> }
<ide>
<ide> function socketOnData(d) {
<del> var socket = this;
<del> var req = this._httpMessage;
<del> var parser = this.parser;
<add> const socket = this;
<add> const req = this._httpMessage;
<add> const parser = this.parser;
<ide>
<ide> assert(parser && parser.socket === socket);
<ide>
<del> var ret = parser.execute(d);
<add> const ret = parser.execute(d);
<ide> if (ret instanceof Error) {
<ide> debug('parse error', ret);
<ide> freeParser(parser, req, socket);
<ide> function statusIsInformational(status) {
<ide>
<ide> // client
<ide> function parserOnIncomingClient(res, shouldKeepAlive) {
<del> var socket = this.socket;
<del> var req = socket._httpMessage;
<add> const socket = this.socket;
<add> const req = socket._httpMessage;
<ide>
<ide> debug('AGENT incoming response!');
<ide>
<ide> function parserOnIncomingClient(res, shouldKeepAlive) {
<ide> // Add our listener first, so that we guarantee socket cleanup
<ide> res.on('end', responseOnEnd);
<ide> req.on('prefinish', requestOnPrefinish);
<del> var handled = req.emit('response', res);
<add> const handled = req.emit('response', res);
<ide>
<ide> // If the user did not listen for the 'response' event, then they
<ide> // can't possibly read the data, so we ._dump() it into the void
<ide> function parserOnIncomingClient(res, shouldKeepAlive) {
<ide>
<ide> // client
<ide> function responseKeepAlive(res, req) {
<del> var socket = req.socket;
<add> const socket = req.socket;
<ide>
<ide> if (!req.shouldKeepAlive) {
<ide> if (socket.writable) {
<ide> function emitFreeNT(socket) {
<ide> }
<ide>
<ide> function tickOnSocket(req, socket) {
<del> var parser = parsers.alloc();
<add> const parser = parsers.alloc();
<ide> req.socket = socket;
<ide> req.connection = socket;
<ide> parser.reinitialize(HTTPParser.RESPONSE, parser[is_reused_symbol]);
<ide><path>lib/_http_incoming.js
<ide> function matchKnownFields(field, lowercased) {
<ide> IncomingMessage.prototype._addHeaderLine = _addHeaderLine;
<ide> function _addHeaderLine(field, value, dest) {
<ide> field = matchKnownFields(field);
<del> var flag = field.charCodeAt(0);
<add> const flag = field.charCodeAt(0);
<ide> if (flag === 0 || flag === 2) {
<ide> field = field.slice(1);
<ide> // Make a delimited list
<ide><path>lib/_http_outgoing.js
<ide> const kIsCorked = Symbol('isCorked');
<ide>
<ide> const hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
<ide>
<del>var RE_CONN_CLOSE = /(?:^|\W)close(?:$|\W)/i;
<del>var RE_TE_CHUNKED = common.chunkExpression;
<add>const RE_CONN_CLOSE = /(?:^|\W)close(?:$|\W)/i;
<add>const RE_TE_CHUNKED = common.chunkExpression;
<ide>
<ide> // isCookieField performs a case-insensitive comparison of a provided string
<ide> // against the word "cookie." As of V8 6.6 this is faster than handrolling or
<ide> OutgoingMessage.prototype._renderHeaders = function _renderHeaders() {
<ide> throw new ERR_HTTP_HEADERS_SENT('render');
<ide> }
<ide>
<del> var headersMap = this[outHeadersKey];
<add> const headersMap = this[outHeadersKey];
<ide> const headers = {};
<ide>
<ide> if (headersMap !== null) {
<ide> OutgoingMessage.prototype.removeHeader = function removeHeader(name) {
<ide> throw new ERR_HTTP_HEADERS_SENT('remove');
<ide> }
<ide>
<del> var key = name.toLowerCase();
<add> const key = name.toLowerCase();
<ide>
<ide> switch (key) {
<ide> case 'connection':
<ide> function connectionCorkNT(msg, conn) {
<ide>
<ide> OutgoingMessage.prototype.addTrailers = function addTrailers(headers) {
<ide> this._trailer = '';
<del> var keys = Object.keys(headers);
<del> var isArray = Array.isArray(headers);
<add> const keys = Object.keys(headers);
<add> const isArray = Array.isArray(headers);
<ide> var field, value;
<ide> for (var i = 0, l = keys.length; i < l; i++) {
<ide> var key = keys[i];
<ide> OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
<ide> if (typeof callback === 'function')
<ide> this.once('finish', callback);
<ide>
<del> var finish = onFinish.bind(undefined, this);
<add> const finish = onFinish.bind(undefined, this);
<ide>
<ide> if (this._hasBody && this.chunkedEncoding) {
<ide> this._send('0\r\n' + this._trailer + '\r\n', 'latin1', finish);
<ide> OutgoingMessage.prototype._finish = function _finish() {
<ide> // This function, outgoingFlush(), is called by both the Server and Client
<ide> // to attempt to flush any pending messages out to the socket.
<ide> OutgoingMessage.prototype._flush = function _flush() {
<del> var socket = this.socket;
<add> const socket = this.socket;
<ide> var ret;
<ide>
<ide> if (socket && socket.writable) {
<ide><path>lib/_http_server.js
<ide> ServerResponse.prototype._implicitHeader = function _implicitHeader() {
<ide>
<ide> ServerResponse.prototype.writeHead = writeHead;
<ide> function writeHead(statusCode, reason, obj) {
<del> var originalStatusCode = statusCode;
<add> const originalStatusCode = statusCode;
<ide>
<ide> statusCode |= 0;
<ide> if (statusCode < 100 || statusCode > 999) {
<ide> function writeHead(statusCode, reason, obj) {
<ide> if (checkInvalidHeaderChar(this.statusMessage))
<ide> throw new ERR_INVALID_CHAR('statusMessage');
<ide>
<del> var statusLine = `HTTP/1.1 ${statusCode} ${this.statusMessage}${CRLF}`;
<add> const statusLine = `HTTP/1.1 ${statusCode} ${this.statusMessage}${CRLF}`;
<ide>
<ide> if (statusCode === 204 || statusCode === 304 ||
<ide> (statusCode >= 100 && statusCode <= 199)) {
<ide> function connectionListenerInternal(server, socket) {
<ide> socket.setTimeout(server.timeout);
<ide> socket.on('timeout', socketOnTimeout);
<ide>
<del> var parser = parsers.alloc();
<add> const parser = parsers.alloc();
<ide> parser.reinitialize(HTTPParser.REQUEST, parser[is_reused_symbol]);
<ide> parser.socket = socket;
<ide>
<ide> function connectionListenerInternal(server, socket) {
<ide> parser.maxHeaderPairs = server.maxHeadersCount << 1;
<ide> }
<ide>
<del> var state = {
<add> const state = {
<ide> onData: null,
<ide> onEnd: null,
<ide> onClose: null,
<ide> function updateOutgoingData(socket, state, delta) {
<ide> }
<ide>
<ide> function socketOnDrain(socket, state) {
<del> var needPause = state.outgoingData > socket.writableHighWaterMark;
<add> const needPause = state.outgoingData > socket.writableHighWaterMark;
<ide>
<ide> // If we previously paused, then start reading again.
<ide> if (socket._paused && !needPause) {
<ide> function socketOnDrain(socket, state) {
<ide> }
<ide>
<ide> function socketOnTimeout() {
<del> var req = this.parser && this.parser.incoming;
<del> var reqTimeout = req && !req.complete && req.emit('timeout', this);
<del> var res = this._httpMessage;
<del> var resTimeout = res && res.emit('timeout', this);
<del> var serverTimeout = this.server.emit('timeout', this);
<add> const req = this.parser && this.parser.incoming;
<add> const reqTimeout = req && !req.complete && req.emit('timeout', this);
<add> const res = this._httpMessage;
<add> const resTimeout = res && res.emit('timeout', this);
<add> const serverTimeout = this.server.emit('timeout', this);
<ide>
<ide> if (!reqTimeout && !resTimeout && !serverTimeout)
<ide> this.destroy();
<ide> function abortIncoming(incoming) {
<ide> }
<ide>
<ide> function socketOnEnd(server, socket, parser, state) {
<del> var ret = parser.finish();
<add> const ret = parser.finish();
<ide>
<ide> if (ret instanceof Error) {
<ide> debug('parse error');
<ide> function socketOnData(server, socket, parser, state, d) {
<ide> assert(!socket._paused);
<ide> debug('SERVER socketOnData %d', d.length);
<ide>
<del> var ret = parser.execute(d);
<add> const ret = parser.execute(d);
<ide> onParserExecuteCommon(server, socket, parser, state, ret, d);
<ide> }
<ide>
<ide> function parserOnIncoming(server, socket, state, req, keepAlive) {
<ide> }
<ide> }
<ide>
<del> var res = new server[kServerResponse](req);
<add> const res = new server[kServerResponse](req);
<ide> res._onPendingData = updateOutgoingData.bind(undefined, socket, state);
<ide>
<ide> res.shouldKeepAlive = keepAlive;
<ide> function unconsume(parser, socket) {
<ide> }
<ide>
<ide> function socketOnWrap(ev, fn) {
<del> var res = net.Socket.prototype.on.call(this, ev, fn);
<add> const res = net.Socket.prototype.on.call(this, ev, fn);
<ide> if (!this.parser) {
<ide> this.on = net.Socket.prototype.on;
<ide> return res;
<ide><path>lib/_stream_readable.js
<ide> Readable.prototype._destroy = function(err, cb) {
<ide> // similar to how Writable.write() returns true if you should
<ide> // write() some more.
<ide> Readable.prototype.push = function(chunk, encoding) {
<del> var state = this._readableState;
<add> const state = this._readableState;
<ide> var skipChunkCheck;
<ide>
<ide> if (!state.objectMode) {
<ide> Readable.prototype.unshift = function(chunk) {
<ide>
<ide> function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
<ide> debug('readableAddChunk', chunk);
<del> var state = stream._readableState;
<add> const state = stream._readableState;
<ide> if (chunk === null) {
<ide> state.reading = false;
<ide> onEofChunk(stream, state);
<ide> function howMuchToRead(n, state) {
<ide> Readable.prototype.read = function(n) {
<ide> debug('read', n);
<ide> n = parseInt(n, 10);
<del> var state = this._readableState;
<del> var nOrig = n;
<add> const state = this._readableState;
<add> const nOrig = n;
<ide>
<ide> if (n !== 0)
<ide> state.emittedReadable = false;
<ide> function onEofChunk(stream, state) {
<ide> // another read() call => stack overflow. This way, it might trigger
<ide> // a nextTick recursion warning, but that's not so bad.
<ide> function emitReadable(stream) {
<del> var state = stream._readableState;
<add> const state = stream._readableState;
<ide> debug('emitReadable', state.needReadable, state.emittedReadable);
<ide> state.needReadable = false;
<ide> if (!state.emittedReadable) {
<ide> function emitReadable(stream) {
<ide> }
<ide>
<ide> function emitReadable_(stream) {
<del> var state = stream._readableState;
<add> const state = stream._readableState;
<ide> debug('emitReadable_', state.destroyed, state.length, state.ended);
<ide> if (!state.destroyed && (state.length || state.ended)) {
<ide> stream.emit('readable');
<ide> Readable.prototype._read = function(n) {
<ide> };
<ide>
<ide> Readable.prototype.pipe = function(dest, pipeOpts) {
<del> var src = this;
<del> var state = this._readableState;
<add> const src = this;
<add> const state = this._readableState;
<ide>
<ide> switch (state.pipesCount) {
<ide> case 0:
<ide> Readable.prototype.pipe = function(dest, pipeOpts) {
<ide> state.pipesCount += 1;
<ide> debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
<ide>
<del> var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
<add> const doEnd = (!pipeOpts || pipeOpts.end !== false) &&
<ide> dest !== process.stdout &&
<ide> dest !== process.stderr;
<ide>
<del> var endFn = doEnd ? onend : unpipe;
<add> const endFn = doEnd ? onend : unpipe;
<ide> if (state.endEmitted)
<ide> process.nextTick(endFn);
<ide> else
<ide> Readable.prototype.pipe = function(dest, pipeOpts) {
<ide> // on the source. This would be more elegant with a .once()
<ide> // handler in flow(), but adding and removing repeatedly is
<ide> // too slow.
<del> var ondrain = pipeOnDrain(src);
<add> const ondrain = pipeOnDrain(src);
<ide> dest.on('drain', ondrain);
<ide>
<ide> var cleanedUp = false;
<ide> Readable.prototype.pipe = function(dest, pipeOpts) {
<ide> src.on('data', ondata);
<ide> function ondata(chunk) {
<ide> debug('ondata');
<del> var ret = dest.write(chunk);
<add> const ret = dest.write(chunk);
<ide> debug('dest.write', ret);
<ide> if (ret === false) {
<ide> // If the user unpiped during `dest.write()`, it is possible
<ide> Readable.prototype.pipe = function(dest, pipeOpts) {
<ide>
<ide> function pipeOnDrain(src) {
<ide> return function pipeOnDrainFunctionResult() {
<del> var state = src._readableState;
<add> const state = src._readableState;
<ide> debug('pipeOnDrain', state.awaitDrain);
<ide> if (state.awaitDrain)
<ide> state.awaitDrain--;
<ide> function pipeOnDrain(src) {
<ide>
<ide>
<ide> Readable.prototype.unpipe = function(dest) {
<del> var state = this._readableState;
<del> var unpipeInfo = { hasUnpiped: false };
<add> const state = this._readableState;
<add> const unpipeInfo = { hasUnpiped: false };
<ide>
<ide> // If we're not piping anywhere, then do nothing.
<ide> if (state.pipesCount === 0)
<ide> Readable.prototype.unpipe = function(dest) {
<ide> }
<ide>
<ide> // Try to find the right one.
<del> var index = state.pipes.indexOf(dest);
<add> const index = state.pipes.indexOf(dest);
<ide> if (index === -1)
<ide> return this;
<ide>
<ide> function nReadingNextTick(self) {
<ide> // pause() and resume() are remnants of the legacy readable stream API
<ide> // If the user uses them, then switch into old mode.
<ide> Readable.prototype.resume = function() {
<del> var state = this._readableState;
<add> const state = this._readableState;
<ide> if (!state.flowing) {
<ide> debug('resume');
<ide> // We flow only if there is no one listening
<ide> function flow(stream) {
<ide> // This is *not* part of the readable stream interface.
<ide> // It is an ugly unfortunate mess of history.
<ide> Readable.prototype.wrap = function(stream) {
<del> var state = this._readableState;
<add> const state = this._readableState;
<ide> var paused = false;
<ide>
<ide> stream.on('end', () => {
<ide> Readable.prototype.wrap = function(stream) {
<ide> else if (!state.objectMode && (!chunk || !chunk.length))
<ide> return;
<ide>
<del> var ret = this.push(chunk);
<add> const ret = this.push(chunk);
<ide> if (!ret) {
<ide> paused = true;
<ide> stream.pause();
<ide> }
<ide> });
<ide>
<ide> // Proxy all the other methods. Important when wrapping filters and duplexes.
<del> for (var i in stream) {
<add> for (const i in stream) {
<ide> if (this[i] === undefined && typeof stream[i] === 'function') {
<ide> this[i] = function methodWrap(method) {
<ide> return function methodWrapReturnFunction() {
<ide> function fromList(n, state) {
<ide> }
<ide>
<ide> function endReadable(stream) {
<del> var state = stream._readableState;
<add> const state = stream._readableState;
<ide>
<ide> debug('endReadable', state.endEmitted);
<ide> if (!state.endEmitted) {
<ide><path>lib/_stream_transform.js
<ide> Object.setPrototypeOf(Transform, Duplex);
<ide>
<ide>
<ide> function afterTransform(er, data) {
<del> var ts = this._transformState;
<add> const ts = this._transformState;
<ide> ts.transforming = false;
<ide>
<del> var cb = ts.writecb;
<add> const cb = ts.writecb;
<ide>
<ide> if (cb === null) {
<ide> return this.emit('error', new ERR_MULTIPLE_CALLBACK());
<ide> function afterTransform(er, data) {
<ide>
<ide> cb(er);
<ide>
<del> var rs = this._readableState;
<add> const rs = this._readableState;
<ide> rs.reading = false;
<ide> if (rs.needReadable || rs.length < rs.highWaterMark) {
<ide> this._read(rs.highWaterMark);
<ide> Transform.prototype._transform = function(chunk, encoding, cb) {
<ide> };
<ide>
<ide> Transform.prototype._write = function(chunk, encoding, cb) {
<del> var ts = this._transformState;
<add> const ts = this._transformState;
<ide> ts.writecb = cb;
<ide> ts.writechunk = chunk;
<ide> ts.writeencoding = encoding;
<ide> Transform.prototype._write = function(chunk, encoding, cb) {
<ide> // _transform does all the work.
<ide> // That we got here means that the readable side wants more data.
<ide> Transform.prototype._read = function(n) {
<del> var ts = this._transformState;
<add> const ts = this._transformState;
<ide>
<ide> if (ts.writechunk !== null && !ts.transforming) {
<ide> ts.transforming = true;
<ide><path>lib/_stream_writable.js
<ide> function WritableState(options, stream, isDuplex) {
<ide> // Should we decode strings into buffers before passing to _write?
<ide> // this is here so that some node-core streams can optimize string
<ide> // handling at a lower level.
<del> var noDecode = options.decodeStrings === false;
<add> const noDecode = options.decodeStrings === false;
<ide> this.decodeStrings = !noDecode;
<ide>
<ide> // Crypto is kind of old and crusty. Historically, its default string
<ide> function WritableState(options, stream, isDuplex) {
<ide>
<ide> // Allocate the first CorkedRequest, there is always
<ide> // one allocated and free to use, and we maintain at most two
<del> var corkReq = { next: null, entry: null, finish: undefined };
<add> const corkReq = { next: null, entry: null, finish: undefined };
<ide> corkReq.finish = onCorkedFinish.bind(undefined, corkReq, this);
<ide> this.corkedRequestsFree = corkReq;
<ide> }
<ide>
<ide> WritableState.prototype.getBuffer = function getBuffer() {
<ide> var current = this.bufferedRequest;
<del> var out = [];
<add> const out = [];
<ide> while (current) {
<ide> out.push(current);
<ide> current = current.next;
<ide> Writable.prototype.pipe = function() {
<ide>
<ide>
<ide> function writeAfterEnd(stream, cb) {
<del> var er = new ERR_STREAM_WRITE_AFTER_END();
<add> const er = new ERR_STREAM_WRITE_AFTER_END();
<ide> // TODO: defer error events consistently everywhere, not just the cb
<ide> errorOrDestroy(stream, er);
<ide> process.nextTick(cb, er);
<ide> function validChunk(stream, state, chunk, cb) {
<ide> }
<ide>
<ide> Writable.prototype.write = function(chunk, encoding, cb) {
<del> var state = this._writableState;
<add> const state = this._writableState;
<ide> var ret = false;
<del> var isBuf = !state.objectMode && Stream._isUint8Array(chunk);
<add> const isBuf = !state.objectMode && Stream._isUint8Array(chunk);
<ide>
<ide> if (isBuf && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
<ide> chunk = Stream._uint8ArrayToBuffer(chunk);
<ide> Writable.prototype.cork = function() {
<ide> };
<ide>
<ide> Writable.prototype.uncork = function() {
<del> var state = this._writableState;
<add> const state = this._writableState;
<ide>
<ide> if (state.corked) {
<ide> state.corked--;
<ide> function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
<ide> chunk = newChunk;
<ide> }
<ide> }
<del> var len = state.objectMode ? 1 : chunk.length;
<add> const len = state.objectMode ? 1 : chunk.length;
<ide>
<ide> state.length += len;
<ide>
<del> var ret = state.length < state.highWaterMark;
<add> const ret = state.length < state.highWaterMark;
<ide> // We must ensure that previous needDrain will not be reset to false.
<ide> if (!ret)
<ide> state.needDrain = true;
<ide> function onwriteStateUpdate(state) {
<ide> }
<ide>
<ide> function onwrite(stream, er) {
<del> var state = stream._writableState;
<del> var sync = state.sync;
<del> var cb = state.writecb;
<add> const state = stream._writableState;
<add> const sync = state.sync;
<add> const cb = state.writecb;
<ide>
<ide> if (typeof cb !== 'function')
<ide> throw new ERR_MULTIPLE_CALLBACK();
<ide> Writable.prototype._write = function(chunk, encoding, cb) {
<ide> Writable.prototype._writev = null;
<ide>
<ide> Writable.prototype.end = function(chunk, encoding, cb) {
<del> var state = this._writableState;
<add> const state = this._writableState;
<ide>
<ide> if (typeof chunk === 'function') {
<ide> cb = chunk;
<ide> function prefinish(stream, state) {
<ide> }
<ide>
<ide> function finishMaybe(stream, state) {
<del> var need = needFinish(state);
<add> const need = needFinish(state);
<ide> if (need) {
<ide> prefinish(stream, state);
<ide> if (state.pendingcb === 0) {
<ide><path>lib/_tls_common.js
<ide> exports.createSecureContext = function createSecureContext(options) {
<ide> // `ssl_set_pkey` returns `0` when the key does not match the cert, but
<ide> // `ssl_set_cert` returns `1` and nullifies the key in the SSL structure
<ide> // which leads to the crash later on.
<del> var key = options.key;
<del> var passphrase = options.passphrase;
<add> const key = options.key;
<add> const passphrase = options.passphrase;
<ide> if (key) {
<ide> if (Array.isArray(key)) {
<ide> for (i = 0; i < key.length; ++i) {
<ide><path>lib/_tls_wrap.js
<ide> Object.setPrototypeOf(TLSSocket.prototype, net.Socket.prototype);
<ide> Object.setPrototypeOf(TLSSocket, net.Socket);
<ide> exports.TLSSocket = TLSSocket;
<ide>
<del>var proxiedMethods = [
<add>const proxiedMethods = [
<ide> 'ref', 'unref', 'open', 'bind', 'listen', 'connect', 'bind6',
<ide> 'connect6', 'getsockname', 'getpeername', 'setNoDelay', 'setKeepAlive',
<ide> 'setSimultaneousAccepts', 'setBlocking',
<ide> TLSSocket.prototype._wrapHandle = function(wrap) {
<ide> if (wrap)
<ide> handle = wrap._handle;
<ide>
<del> var options = this._tlsOptions;
<add> const options = this._tlsOptions;
<ide> if (!handle) {
<ide> handle = options.pipe ?
<ide> new Pipe(PipeConstants.SOCKET) :
<ide> TLSSocket.prototype._destroySSL = function _destroySSL() {
<ide>
<ide> // Constructor guts, arbitrarily factored out.
<ide> TLSSocket.prototype._init = function(socket, wrap) {
<del> var options = this._tlsOptions;
<del> var ssl = this._handle;
<add> const options = this._tlsOptions;
<add> const ssl = this._handle;
<ide> this.server = options.server;
<ide>
<ide> debug('%s _init',
<ide> TLSSocket.prototype._handleTimeout = function() {
<ide> };
<ide>
<ide> TLSSocket.prototype._emitTLSError = function(err) {
<del> var e = this._tlsError(err);
<add> const e = this._tlsError(err);
<ide> if (e)
<ide> this.emit('error', e);
<ide> };
<ide> Server.prototype.setOptions = deprecate(function(options) {
<ide> if (options.dhparam) this.dhparam = options.dhparam;
<ide> if (options.sessionTimeout) this.sessionTimeout = options.sessionTimeout;
<ide> if (options.ticketKeys) this.ticketKeys = options.ticketKeys;
<del> var secureOptions = options.secureOptions || 0;
<add> const secureOptions = options.secureOptions || 0;
<ide> if (options.honorCipherOrder !== undefined)
<ide> this.honorCipherOrder = !!options.honorCipherOrder;
<ide> else
<ide> Server.prototype.addContext = function(servername, context) {
<ide> throw new ERR_TLS_REQUIRED_SERVER_NAME();
<ide> }
<ide>
<del> var re = new RegExp('^' +
<add> const re = new RegExp('^' +
<ide> servername.replace(/([.^$+?\-\\[\]{}])/g, '\\$1')
<ide> .replace(/\*/g, '[^.]*') +
<ide> '$');
<ide> let warnOnAllowUnauthorized = true;
<ide> exports.connect = function connect(...args) {
<ide> args = normalizeConnectArgs(args);
<ide> var options = args[0];
<del> var cb = args[1];
<add> const cb = args[1];
<ide> const allowUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0';
<ide>
<ide> if (allowUnauthorized && warnOnAllowUnauthorized) {
<ide> exports.connect = function connect(...args) {
<ide>
<ide> const context = options.secureContext || tls.createSecureContext(options);
<ide>
<del> var tlssock = new TLSSocket(options.socket, {
<add> const tlssock = new TLSSocket(options.socket, {
<ide> pipe: !!options.path,
<ide> secureContext: context,
<ide> isServer: false,
<ide><path>lib/child_process.js
<ide> exports.fork = function fork(modulePath /* , args, options */) {
<ide>
<ide> exports._forkChild = function _forkChild(fd) {
<ide> // set process.send()
<del> var p = new Pipe(PipeConstants.IPC);
<add> const p = new Pipe(PipeConstants.IPC);
<ide> p.open(fd);
<ide> p.unref();
<ide> const control = setupChannel(process, p);
<ide> exports.execFile = function execFile(file /* , args, options, callback */) {
<ide>
<ide> options.killSignal = sanitizeKillSignal(options.killSignal);
<ide>
<del> var child = spawn(file, args, {
<add> const child = spawn(file, args, {
<ide> cwd: options.cwd,
<ide> env: options.env,
<ide> gid: options.gid,
<ide> exports.execFile = function execFile(file /* , args, options, callback */) {
<ide> });
<ide>
<ide> var encoding;
<del> var _stdout = [];
<del> var _stderr = [];
<add> const _stdout = [];
<add> const _stderr = [];
<ide> if (options.encoding !== 'buffer' && Buffer.isEncoding(options.encoding)) {
<ide> encoding = options.encoding;
<ide> } else {
<ide> exports.execFile = function execFile(file /* , args, options, callback */) {
<ide> child.stdout.setEncoding(encoding);
<ide>
<ide> child.stdout.on('data', function onChildStdout(chunk) {
<del> var encoding = child.stdout._readableState.encoding;
<add> const encoding = child.stdout._readableState.encoding;
<ide> const length = encoding ?
<ide> Buffer.byteLength(chunk, encoding) :
<ide> chunk.length;
<ide> exports.execFile = function execFile(file /* , args, options, callback */) {
<ide> child.stderr.setEncoding(encoding);
<ide>
<ide> child.stderr.on('data', function onChildStderr(chunk) {
<del> var encoding = child.stderr._readableState.encoding;
<add> const encoding = child.stderr._readableState.encoding;
<ide> const length = encoding ?
<ide> Buffer.byteLength(chunk, encoding) :
<ide> chunk.length;
<ide> function normalizeSpawnArguments(file, args, options) {
<ide> args.unshift(file);
<ide> }
<ide>
<del> var env = options.env || process.env;
<del> var envPairs = [];
<add> const env = options.env || process.env;
<add> const envPairs = [];
<ide>
<ide> // process.env.NODE_V8_COVERAGE always propagates, making it possible to
<ide> // collect coverage for programs that spawn with white-listed environment.
<ide> function normalizeSpawnArguments(file, args, options) {
<ide> }
<ide>
<ide> // Prototype values are intentionally included.
<del> for (var key in env) {
<add> for (const key in env) {
<ide> const value = env[key];
<ide> if (value !== undefined) {
<ide> envPairs.push(`${key}=${value}`);
<ide> function checkExecSyncError(ret, args, cmd) {
<ide>
<ide>
<ide> function execFileSync(command, args, options) {
<del> var opts = normalizeSpawnArguments(command, args, options);
<del> var inheritStderr = !opts.options.stdio;
<add> const opts = normalizeSpawnArguments(command, args, options);
<add> const inheritStderr = !opts.options.stdio;
<ide>
<del> var ret = spawnSync(opts.file, opts.args.slice(1), opts.options);
<add> const ret = spawnSync(opts.file, opts.args.slice(1), opts.options);
<ide>
<ide> if (inheritStderr && ret.stderr)
<ide> process.stderr.write(ret.stderr);
<ide>
<del> var err = checkExecSyncError(ret, opts.args, undefined);
<add> const err = checkExecSyncError(ret, opts.args, undefined);
<ide>
<ide> if (err)
<ide> throw err;
<ide> exports.execFileSync = execFileSync;
<ide>
<ide>
<ide> function execSync(command, options) {
<del> var opts = normalizeExecArgs(command, options, null);
<del> var inheritStderr = !opts.options.stdio;
<add> const opts = normalizeExecArgs(command, options, null);
<add> const inheritStderr = !opts.options.stdio;
<ide>
<del> var ret = spawnSync(opts.file, opts.options);
<add> const ret = spawnSync(opts.file, opts.options);
<ide>
<ide> if (inheritStderr && ret.stderr)
<ide> process.stderr.write(ret.stderr);
<ide>
<del> var err = checkExecSyncError(ret, opts.args, command);
<add> const err = checkExecSyncError(ret, opts.args, command);
<ide>
<ide> if (err)
<ide> throw err;
<ide><path>lib/dgram.js
<ide> function Socket(type, listener) {
<ide> sendBufferSize = options.sendBufferSize;
<ide> }
<ide>
<del> var handle = newHandle(type, lookup);
<add> const handle = newHandle(type, lookup);
<ide> handle[owner_symbol] = this;
<ide>
<ide> this[async_id_symbol] = handle.getAsyncId();
<ide> function doSend(ex, self, ip, list, address, port, callback) {
<ide> return;
<ide> }
<ide>
<del> var req = new SendWrap();
<add> const req = new SendWrap();
<ide> req.list = list; // Keep reference alive.
<ide> req.address = address;
<ide> req.port = port;
<ide> function doSend(ex, self, ip, list, address, port, callback) {
<ide> req.oncomplete = afterSend;
<ide> }
<ide>
<del> var err = state.handle.send(req,
<del> list,
<del> list.length,
<del> port,
<del> ip,
<del> !!callback);
<add> const err = state.handle.send(req,
<add> list,
<add> list.length,
<add> port,
<add> ip,
<add> !!callback);
<ide>
<ide> if (err && callback) {
<ide> // Don't emit as error, dgram_legacy.js compatibility
<ide> function socketCloseNT(self) {
<ide> Socket.prototype.address = function() {
<ide> healthCheck(this);
<ide>
<del> var out = {};
<del> var err = this[kStateSymbol].handle.getsockname(out);
<add> const out = {};
<add> const err = this[kStateSymbol].handle.getsockname(out);
<ide> if (err) {
<ide> throw errnoException(err, 'getsockname');
<ide> }
<ide> Socket.prototype.address = function() {
<ide>
<ide>
<ide> Socket.prototype.setBroadcast = function(arg) {
<del> var err = this[kStateSymbol].handle.setBroadcast(arg ? 1 : 0);
<add> const err = this[kStateSymbol].handle.setBroadcast(arg ? 1 : 0);
<ide> if (err) {
<ide> throw errnoException(err, 'setBroadcast');
<ide> }
<ide> Socket.prototype.setBroadcast = function(arg) {
<ide> Socket.prototype.setTTL = function(ttl) {
<ide> validateNumber(ttl, 'ttl');
<ide>
<del> var err = this[kStateSymbol].handle.setTTL(ttl);
<add> const err = this[kStateSymbol].handle.setTTL(ttl);
<ide> if (err) {
<ide> throw errnoException(err, 'setTTL');
<ide> }
<ide> Socket.prototype.setTTL = function(ttl) {
<ide> Socket.prototype.setMulticastTTL = function(ttl) {
<ide> validateNumber(ttl, 'ttl');
<ide>
<del> var err = this[kStateSymbol].handle.setMulticastTTL(ttl);
<add> const err = this[kStateSymbol].handle.setMulticastTTL(ttl);
<ide> if (err) {
<ide> throw errnoException(err, 'setMulticastTTL');
<ide> }
<ide> Socket.prototype.setMulticastTTL = function(ttl) {
<ide>
<ide>
<ide> Socket.prototype.setMulticastLoopback = function(arg) {
<del> var err = this[kStateSymbol].handle.setMulticastLoopback(arg ? 1 : 0);
<add> const err = this[kStateSymbol].handle.setMulticastLoopback(arg ? 1 : 0);
<ide> if (err) {
<ide> throw errnoException(err, 'setMulticastLoopback');
<ide> }
<ide> Socket.prototype.addMembership = function(multicastAddress,
<ide> }
<ide>
<ide> const { handle } = this[kStateSymbol];
<del> var err = handle.addMembership(multicastAddress, interfaceAddress);
<add> const err = handle.addMembership(multicastAddress, interfaceAddress);
<ide> if (err) {
<ide> throw errnoException(err, 'addMembership');
<ide> }
<ide> Socket.prototype.dropMembership = function(multicastAddress,
<ide> }
<ide>
<ide> const { handle } = this[kStateSymbol];
<del> var err = handle.dropMembership(multicastAddress, interfaceAddress);
<add> const err = handle.dropMembership(multicastAddress, interfaceAddress);
<ide> if (err) {
<ide> throw errnoException(err, 'dropMembership');
<ide> }
<ide> function stopReceiving(socket) {
<ide>
<ide>
<ide> function onMessage(nread, handle, buf, rinfo) {
<del> var self = handle[owner_symbol];
<add> const self = handle[owner_symbol];
<ide> if (nread < 0) {
<ide> return self.emit('error', errnoException(nread, 'recvmsg'));
<ide> }
<ide><path>lib/dns.js
<ide> function onlookupall(err, addresses) {
<ide> return this.callback(dnsException(err, 'getaddrinfo', this.hostname));
<ide> }
<ide>
<del> var family = this.family;
<add> const family = this.family;
<ide> for (var i = 0; i < addresses.length; i++) {
<ide> const addr = addresses[i];
<ide> addresses[i] = {
<ide> function lookup(hostname, options, callback) {
<ide> return {};
<ide> }
<ide>
<del> var matchedFamily = isIP(hostname);
<add> const matchedFamily = isIP(hostname);
<ide> if (matchedFamily) {
<ide> if (all) {
<ide> process.nextTick(
<ide> function lookup(hostname, options, callback) {
<ide> return {};
<ide> }
<ide>
<del> var req = new GetAddrInfoReqWrap();
<add> const req = new GetAddrInfoReqWrap();
<ide> req.callback = callback;
<ide> req.family = family;
<ide> req.hostname = hostname;
<ide> req.oncomplete = all ? onlookupall : onlookup;
<ide>
<del> var err = cares.getaddrinfo(req, toASCII(hostname), family, hints, verbatim);
<add> const err = cares.getaddrinfo(
<add> req, toASCII(hostname), family, hints, verbatim
<add> );
<ide> if (err) {
<ide> process.nextTick(callback, dnsException(err, 'getaddrinfo', hostname));
<ide> return {};
<ide> function lookupService(hostname, port, callback) {
<ide>
<ide> port = +port;
<ide>
<del> var req = new GetNameInfoReqWrap();
<add> const req = new GetNameInfoReqWrap();
<ide> req.callback = callback;
<ide> req.hostname = hostname;
<ide> req.port = port;
<ide> req.oncomplete = onlookupservice;
<ide>
<del> var err = cares.getnameinfo(req, hostname, port);
<add> const err = cares.getnameinfo(req, hostname, port);
<ide> if (err) throw dnsException(err, 'getnameinfo', hostname);
<ide> return req;
<ide> }
<ide> function resolver(bindingName) {
<ide> throw new ERR_INVALID_CALLBACK();
<ide> }
<ide>
<del> var req = new QueryReqWrap();
<add> const req = new QueryReqWrap();
<ide> req.bindingName = bindingName;
<ide> req.callback = callback;
<ide> req.hostname = name;
<ide> req.oncomplete = onresolve;
<ide> req.ttl = !!(options && options.ttl);
<del> var err = this._handle[bindingName](req, toASCII(name));
<add> const err = this._handle[bindingName](req, toASCII(name));
<ide> if (err) throw dnsException(err, bindingName, name);
<ide> return req;
<ide> }
<ide> Object.defineProperty(query, 'name', { value: bindingName });
<ide> return query;
<ide> }
<ide>
<del>var resolveMap = Object.create(null);
<add>const resolveMap = Object.create(null);
<ide> Resolver.prototype.resolveAny = resolveMap.ANY = resolver('queryAny');
<ide> Resolver.prototype.resolve4 = resolveMap.A = resolver('queryA');
<ide> Resolver.prototype.resolve6 = resolveMap.AAAA = resolver('queryAaaa');
<ide><path>lib/domain.js
<ide> const { WeakReference } = internalBinding('util');
<ide>
<ide> // Overwrite process.domain with a getter/setter that will allow for more
<ide> // effective optimizations
<del>var _domain = [null];
<add>const _domain = [null];
<ide> Object.defineProperty(process, 'domain', {
<ide> enumerable: true,
<ide> get: function() {
<ide> Domain.prototype.enter = function() {
<ide>
<ide> Domain.prototype.exit = function() {
<ide> // Don't do anything if this domain is not on the stack.
<del> var index = stack.lastIndexOf(this);
<add> const index = stack.lastIndexOf(this);
<ide> if (index === -1) return;
<ide>
<ide> // Exit all domains until this one.
<ide> Domain.prototype.add = function(ee) {
<ide>
<ide> Domain.prototype.remove = function(ee) {
<ide> ee.domain = null;
<del> var index = this.members.indexOf(ee);
<add> const index = this.members.indexOf(ee);
<ide> if (index !== -1)
<ide> this.members.splice(index, 1);
<ide> };
<ide> function intercepted(_this, self, cb, fnargs) {
<ide> return;
<ide> }
<ide>
<del> var args = [];
<add> const args = [];
<ide> var i, ret;
<ide>
<ide> self.enter();
<ide> function intercepted(_this, self, cb, fnargs) {
<ide>
<ide>
<ide> Domain.prototype.intercept = function(cb) {
<del> var self = this;
<add> const self = this;
<ide>
<ide> function runIntercepted() {
<ide> return intercepted(this, self, cb, arguments);
<ide> function bound(_this, self, cb, fnargs) {
<ide>
<ide>
<ide> Domain.prototype.bind = function(cb) {
<del> var self = this;
<add> const self = this;
<ide>
<ide> function runBound() {
<ide> return bound(this, self, cb, arguments);
<ide><path>lib/events.js
<ide> function onceWrapper(...args) {
<ide> }
<ide>
<ide> function _onceWrap(target, type, listener) {
<del> var state = { fired: false, wrapFn: undefined, target, type, listener };
<del> var wrapped = onceWrapper.bind(state);
<add> const state = { fired: false, wrapFn: undefined, target, type, listener };
<add> const wrapped = onceWrapper.bind(state);
<ide> wrapped.listener = listener;
<ide> state.wrapFn = wrapped;
<ide> return wrapped;
<ide> EventEmitter.prototype.prependOnceListener =
<ide> // Emits a 'removeListener' event if and only if the listener was removed.
<ide> EventEmitter.prototype.removeListener =
<ide> function removeListener(type, listener) {
<del> var list, events, position, i, originalListener;
<add> let originalListener;
<ide>
<ide> checkListener(listener);
<ide>
<del> events = this._events;
<add> const events = this._events;
<ide> if (events === undefined)
<ide> return this;
<ide>
<del> list = events[type];
<add> const list = events[type];
<ide> if (list === undefined)
<ide> return this;
<ide>
<ide> EventEmitter.prototype.removeListener =
<ide> this.emit('removeListener', type, list.listener || listener);
<ide> }
<ide> } else if (typeof list !== 'function') {
<del> position = -1;
<add> let position = -1;
<ide>
<del> for (i = list.length - 1; i >= 0; i--) {
<add> for (var i = list.length - 1; i >= 0; i--) {
<ide> if (list[i] === listener || list[i].listener === listener) {
<ide> originalListener = list[i].listener;
<ide> position = i;
<ide> EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
<ide>
<ide> EventEmitter.prototype.removeAllListeners =
<ide> function removeAllListeners(type) {
<del> var listeners, events, i;
<del>
<del> events = this._events;
<add> const events = this._events;
<ide> if (events === undefined)
<ide> return this;
<ide>
<ide> EventEmitter.prototype.removeAllListeners =
<ide> return this;
<ide> }
<ide>
<del> listeners = events[type];
<add> const listeners = events[type];
<ide>
<ide> if (typeof listeners === 'function') {
<ide> this.removeListener(type, listeners);
<ide> } else if (listeners !== undefined) {
<ide> // LIFO order
<del> for (i = listeners.length - 1; i >= 0; i--) {
<add> for (var i = listeners.length - 1; i >= 0; i--) {
<ide> this.removeListener(type, listeners[i]);
<ide> }
<ide> }
<ide> EventEmitter.prototype.eventNames = function eventNames() {
<ide> };
<ide>
<ide> function arrayClone(arr, n) {
<del> var copy = new Array(n);
<add> const copy = new Array(n);
<ide> for (var i = 0; i < n; ++i)
<ide> copy[i] = arr[i];
<ide> return copy;
<ide><path>lib/http.js
<ide> function request(url, options, cb) {
<ide> }
<ide>
<ide> function get(url, options, cb) {
<del> var req = request(url, options, cb);
<add> const req = request(url, options, cb);
<ide> req.end();
<ide> return req;
<ide> }
<ide><path>lib/internal/assert/assertion_error.js
<ide> class AssertionError extends Error {
<ide> if (typeof options !== 'object' || options === null) {
<ide> throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
<ide> }
<del> var {
<del> actual,
<del> expected,
<add> const {
<ide> message,
<ide> operator,
<ide> stackStartFn
<ide> } = options;
<add> let {
<add> actual,
<add> expected
<add> } = options;
<ide>
<ide> const limit = Error.stackTraceLimit;
<ide> Error.stackTraceLimit = 0;
<ide><path>lib/internal/child_process.js
<ide> const handleConversion = {
<ide> },
<ide>
<ide> got(message, handle, emit) {
<del> var server = new net.Server();
<add> const server = new net.Server();
<ide> server.listen(handle, () => {
<ide> emit(server);
<ide> });
<ide> const handleConversion = {
<ide> socket.server._connections--;
<ide> }
<ide>
<del> var handle = socket._handle;
<add> const handle = socket._handle;
<ide>
<ide> // Remove handle from socket object, it will be closed when the socket
<ide> // will be sent
<ide> const handleConversion = {
<ide> },
<ide>
<ide> got(message, handle, emit) {
<del> var socket = new net.Socket({
<add> const socket = new net.Socket({
<ide> handle: handle,
<ide> readable: true,
<ide> writable: true
<ide> const handleConversion = {
<ide> },
<ide>
<ide> got(message, handle, emit) {
<del> var socket = new dgram.Socket(message.dgramType);
<add> const socket = new dgram.Socket(message.dgramType);
<ide>
<ide> socket.bind(handle, () => {
<ide> emit(socket);
<ide> function closePendingHandle(target) {
<ide>
<ide>
<ide> ChildProcess.prototype.spawn = function(options) {
<del> var ipc;
<del> var ipcFd;
<del> var i;
<add> let i = 0;
<ide>
<ide> if (options === null || typeof options !== 'object') {
<ide> throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
<ide> }
<ide>
<ide> // If no `stdio` option was given - use default
<del> var stdio = options.stdio || 'pipe';
<add> let stdio = options.stdio || 'pipe';
<ide>
<ide> stdio = getValidStdio(stdio, false);
<ide>
<del> ipc = stdio.ipc;
<del> ipcFd = stdio.ipcFd;
<add> const ipc = stdio.ipc;
<add> const ipcFd = stdio.ipcFd;
<ide> stdio = options.stdio = stdio.stdio;
<ide>
<ide> if (ipc !== undefined) {
<ide> ChildProcess.prototype.spawn = function(options) {
<ide> else
<ide> throw new ERR_INVALID_ARG_TYPE('options.args', 'Array', options.args);
<ide>
<del> var err = this._handle.spawn(options);
<add> const err = this._handle.spawn(options);
<ide>
<ide> // Run-time errors should emit an error, not throw an exception.
<ide> if (err === UV_EACCES ||
<ide> function setupChannel(target, channel) {
<ide>
<ide> if (StringDecoder === undefined)
<ide> StringDecoder = require('string_decoder').StringDecoder;
<del> var decoder = new StringDecoder('utf8');
<add> const decoder = new StringDecoder('utf8');
<ide> var jsonBuffer = '';
<ide> var pendingHandle = null;
<ide> channel.buffering = false;
<ide> function setupChannel(target, channel) {
<ide> // a message.
<ide> target._send({ cmd: 'NODE_HANDLE_ACK' }, null, true);
<ide>
<del> var obj = handleConversion[message.type];
<add> const obj = handleConversion[message.type];
<ide>
<ide> // Update simultaneous accepts on Windows
<ide> if (process.platform === 'win32') {
<ide> function setupChannel(target, channel) {
<ide> return this._handleQueue.length === 1;
<ide> }
<ide>
<del> var req = new WriteWrap();
<add> const req = new WriteWrap();
<ide>
<del> var string = JSON.stringify(message) + '\n';
<del> var err = channel.writeUtf8String(req, string, handle);
<del> var wasAsyncWrite = streamBaseState[kLastWriteWasAsync];
<add> const string = JSON.stringify(message) + '\n';
<add> const err = channel.writeUtf8String(req, string, handle);
<add> const wasAsyncWrite = streamBaseState[kLastWriteWasAsync];
<ide>
<ide> if (err === 0) {
<ide> if (handle) {
<ide> function setupChannel(target, channel) {
<ide> if (!target.channel)
<ide> return;
<ide>
<del> var eventName = (internal ? 'internalMessage' : 'message');
<add> const eventName = (internal ? 'internalMessage' : 'message');
<ide>
<ide> process.nextTick(emit, eventName, message, handle);
<ide> }
<ide> function getValidStdio(stdio, sync) {
<ide>
<ide>
<ide> function getSocketList(type, worker, key) {
<del> var sockets = worker.channel.sockets[type];
<add> const sockets = worker.channel.sockets[type];
<ide> var socketList = sockets[key];
<ide> if (!socketList) {
<ide> var Construct = type === 'send' ? SocketListSend : SocketListReceive;
<ide> function maybeClose(subprocess) {
<ide> }
<ide>
<ide> function spawnSync(opts) {
<del> var options = opts.options;
<del> var result = spawn_sync.spawn(options);
<add> const options = opts.options;
<add> const result = spawn_sync.spawn(options);
<ide>
<ide> if (result.output && options.encoding && options.encoding !== 'buffer') {
<ide> for (var i = 0; i < result.output.length; i++) {
<ide><path>lib/internal/console/constructor.js
<ide> function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
<ide> }
<ide>
<ide> // Bind the prototype functions to this Console instance
<del> var keys = Object.keys(Console.prototype);
<add> const keys = Object.keys(Console.prototype);
<ide> for (var v = 0; v < keys.length; v++) {
<ide> var k = keys[v];
<ide> // We have to bind the methods grabbed from the instance instead of from
<ide><path>lib/internal/crypto/sig.js
<ide> Verify.prototype.verify = function verify(options, signature, sigEncoding) {
<ide> sigEncoding = sigEncoding || getDefaultEncoding();
<ide>
<ide> // Options specific to RSA
<del> var rsaPadding = getPadding(options);
<add> const rsaPadding = getPadding(options);
<ide>
<del> var pssSaltLength = getSaltLength(options);
<add> const pssSaltLength = getSaltLength(options);
<ide>
<ide> signature = validateArrayBufferView(toBuf(signature, sigEncoding),
<ide> 'signature');
<ide><path>lib/internal/encoding.js
<ide> class TextEncoder {
<ide> validateEncoder(this);
<ide> if (typeof depth === 'number' && depth < 0)
<ide> return this;
<del> var ctor = getConstructorOf(this);
<del> var obj = Object.create({
<add> const ctor = getConstructorOf(this);
<add> const obj = Object.create({
<ide> constructor: ctor === null ? TextEncoder : ctor
<ide> });
<ide> obj.encoding = this.encoding;
<ide> function makeTextDecoderJS() {
<ide> validateDecoder(this);
<ide> if (typeof depth === 'number' && depth < 0)
<ide> return this;
<del> var ctor = getConstructorOf(this);
<del> var obj = Object.create({
<add> const ctor = getConstructorOf(this);
<add> const obj = Object.create({
<ide> constructor: ctor === null ? TextDecoder : ctor
<ide> });
<ide> obj.encoding = this.encoding;
<ide><path>lib/internal/modules/cjs/loader.js
<ide> function stat(filename) {
<ide> }
<ide>
<ide> function updateChildren(parent, child, scan) {
<del> var children = parent && parent.children;
<add> const children = parent && parent.children;
<ide> if (children && !(scan && children.includes(child)))
<ide> children.push(child);
<ide> }
<ide> Module._findPath = function(request, paths, isMain) {
<ide> return false;
<ide> }
<ide>
<del> var cacheKey = request + '\x00' +
<add> const cacheKey = request + '\x00' +
<ide> (paths.length === 1 ? paths[0] : paths.join('\x00'));
<del> var entry = Module._pathCache[cacheKey];
<add> const entry = Module._pathCache[cacheKey];
<ide> if (entry)
<ide> return entry;
<ide>
<ide> Module._findPath = function(request, paths, isMain) {
<ide> };
<ide>
<ide> // 'node_modules' character codes reversed
<del>var nmChars = [ 115, 101, 108, 117, 100, 111, 109, 95, 101, 100, 111, 110 ];
<del>var nmLen = nmChars.length;
<add>const nmChars = [ 115, 101, 108, 117, 100, 111, 109, 95, 101, 100, 111, 110 ];
<add>const nmLen = nmChars.length;
<ide> if (isWindows) {
<ide> // 'from' is the __dirname of the module.
<ide> Module._nodeModulePaths = function(from) {
<ide> if (isWindows) {
<ide>
<ide>
<ide> // 'index.' character codes
<del>var indexChars = [ 105, 110, 100, 101, 120, 46 ];
<del>var indexLen = indexChars.length;
<add>const indexChars = [ 105, 110, 100, 101, 120, 46 ];
<add>const indexLen = indexChars.length;
<ide> Module._resolveLookupPaths = function(request, parent, newReturn) {
<ide> if (NativeModule.canBeRequiredByUsers(request)) {
<ide> debug('looking for %j in []', request);
<ide> Module._resolveLookupPaths = function(request, parent, newReturn) {
<ide> debug('RELATIVE: requested: %s set ID to: %s from %s', request, id,
<ide> parent.id);
<ide>
<del> var parentDir = [path.dirname(parent.filename)];
<add> const parentDir = [path.dirname(parent.filename)];
<ide> debug('looking for %j in %j', id, parentDir);
<ide> return (newReturn ? parentDir : [id, parentDir]);
<ide> };
<ide> Module._load = function(request, parent, isMain) {
<ide> debug('Module._load REQUEST %s parent: %s', request, parent.id);
<ide> }
<ide>
<del> var filename = Module._resolveFilename(request, parent, isMain);
<add> const filename = Module._resolveFilename(request, parent, isMain);
<ide>
<del> var cachedModule = Module._cache[filename];
<add> const cachedModule = Module._cache[filename];
<ide> if (cachedModule) {
<ide> updateChildren(parent, cachedModule, true);
<ide> return cachedModule.exports;
<ide> Module._load = function(request, parent, isMain) {
<ide> }
<ide>
<ide> // Don't call updateChildren(), Module constructor already does.
<del> var module = new Module(filename, parent);
<add> const module = new Module(filename, parent);
<ide>
<ide> if (isMain) {
<ide> process.mainModule = module;
<ide> Module._resolveFilename = function(request, parent, isMain, options) {
<ide> }
<ide>
<ide> // Look up the filename first, since that's the cache key.
<del> var filename = Module._findPath(request, paths, isMain);
<add> const filename = Module._findPath(request, paths, isMain);
<ide> if (!filename) {
<ide> const requireStack = [];
<ide> for (var cursor = parent;
<ide> Module.prototype.load = function(filename) {
<ide> this.filename = filename;
<ide> this.paths = Module._nodeModulePaths(path.dirname(filename));
<ide>
<del> var extension = findLongestRegisteredExtension(filename);
<add> const extension = findLongestRegisteredExtension(filename);
<ide> Module._extensions[extension](this, filename);
<ide> this.loaded = true;
<ide>
<ide> Module.prototype._compile = function(content, filename) {
<ide> inspectorWrapper = internalBinding('inspector').callAndPauseOnStart;
<ide> }
<ide> }
<del> var dirname = path.dirname(filename);
<del> var require = makeRequireFunction(this);
<add> const dirname = path.dirname(filename);
<add> const require = makeRequireFunction(this);
<ide> var result;
<del> var exports = this.exports;
<del> var thisValue = exports;
<del> var module = this;
<add> const exports = this.exports;
<add> const thisValue = exports;
<add> const module = this;
<ide> if (inspectorWrapper) {
<ide> result = inspectorWrapper(compiledWrapper, thisValue, exports,
<ide> require, module, filename, dirname);
<ide> Module.prototype._compile = function(content, filename) {
<ide>
<ide> // Native extension for .js
<ide> Module._extensions['.js'] = function(module, filename) {
<del> var content = fs.readFileSync(filename, 'utf8');
<add> const content = fs.readFileSync(filename, 'utf8');
<ide> module._compile(stripBOM(content), filename);
<ide> };
<ide>
<ide> Module._preloadModules = function(requests) {
<ide> // Preloaded modules have a dummy parent module which is deemed to exist
<ide> // in the current working directory. This seeds the search path for
<ide> // preloaded modules.
<del> var parent = new Module('internal/preload', null);
<add> const parent = new Module('internal/preload', null);
<ide> try {
<ide> parent.paths = Module._nodeModulePaths(process.cwd());
<ide> } catch (e) {
<ide><path>lib/internal/socket_list.js
<ide> class SocketListSend extends EventEmitter {
<ide> }
<ide>
<ide> _request(msg, cmd, swallowErrors, callback) {
<del> var self = this;
<add> const self = this;
<ide>
<ide> if (!this.child.connected) return onclose();
<ide> this.child._send(msg, undefined, swallowErrors);
<ide><path>lib/internal/stream_base_commons.js
<ide> function onWriteComplete(status) {
<ide> }
<ide>
<ide> function createWriteWrap(handle) {
<del> var req = new WriteWrap();
<add> const req = new WriteWrap();
<ide>
<ide> req.handle = handle;
<ide> req.oncomplete = onWriteComplete;
<ide> function createWriteWrap(handle) {
<ide>
<ide> function writevGeneric(self, data, cb) {
<ide> const req = createWriteWrap(self[kHandle]);
<del> var allBuffers = data.allBuffers;
<add> const allBuffers = data.allBuffers;
<ide> var chunks;
<ide> var i;
<ide> if (allBuffers) {
<ide> function writevGeneric(self, data, cb) {
<ide> chunks[i * 2 + 1] = entry.encoding;
<ide> }
<ide> }
<del> var err = req.handle.writev(req, chunks, allBuffers);
<add> const err = req.handle.writev(req, chunks, allBuffers);
<ide>
<ide> // Retain chunks
<ide> if (err === 0) req._chunks = chunks;
<ide> function writevGeneric(self, data, cb) {
<ide>
<ide> function writeGeneric(self, data, encoding, cb) {
<ide> const req = createWriteWrap(self[kHandle]);
<del> var err = handleWriteReq(req, data, encoding);
<add> const err = handleWriteReq(req, data, encoding);
<ide>
<ide> afterWriteDispatched(self, req, err, cb);
<ide> return req;
<ide><path>lib/internal/streams/legacy.js
<ide> Object.setPrototypeOf(Stream.prototype, EE.prototype);
<ide> Object.setPrototypeOf(Stream, EE);
<ide>
<ide> Stream.prototype.pipe = function(dest, options) {
<del> var source = this;
<add> const source = this;
<ide>
<ide> function ondata(chunk) {
<ide> if (dest.writable && dest.write(chunk) === false && source.pause) {
<ide><path>lib/internal/url.js
<ide> class URLSearchParams {
<ide> if (typeof recurseTimes === 'number' && recurseTimes < 0)
<ide> return ctx.stylize('[Object]', 'special');
<ide>
<del> var separator = ', ';
<del> var innerOpts = { ...ctx };
<add> const separator = ', ';
<add> const innerOpts = { ...ctx };
<ide> if (recurseTimes !== null) {
<ide> innerOpts.depth = recurseTimes - 1;
<ide> }
<del> var innerInspect = (v) => inspect(v, innerOpts);
<add> const innerInspect = (v) => inspect(v, innerOpts);
<ide>
<del> var list = this[searchParams];
<del> var output = [];
<add> const list = this[searchParams];
<add> const output = [];
<ide> for (var i = 0; i < list.length; i += 2)
<ide> output.push(`${innerInspect(list[i])} => ${innerInspect(list[i + 1])}`);
<ide>
<del> var length = output.reduce(
<add> const length = output.reduce(
<ide> (prev, cur) => prev + removeColors(cur).length + separator.length,
<ide> -separator.length
<ide> );
<ide> class URLSearchParams {
<ide>
<ide> function onParseComplete(flags, protocol, username, password,
<ide> host, port, path, query, fragment) {
<del> var ctx = this[context];
<add> const ctx = this[context];
<ide> ctx.flags = flags;
<ide> ctx.scheme = protocol;
<ide> ctx.username = (flags & URL_FLAGS_HAS_USERNAME) !== 0 ? username : '';
<ide> class URL {
<ide> if (typeof depth === 'number' && depth < 0)
<ide> return this;
<ide>
<del> var ctor = getConstructorOf(this);
<add> const ctor = getConstructorOf(this);
<ide>
<del> var obj = Object.create({
<add> const obj = Object.create({
<ide> constructor: ctor === null ? URL : ctor
<ide> });
<ide>
<ide> function domainToUnicode(domain) {
<ide> // options object as expected by the http.request and https.request
<ide> // APIs.
<ide> function urlToOptions(url) {
<del> var options = {
<add> const options = {
<ide> protocol: url.protocol,
<ide> hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ?
<ide> url.hostname.slice(1, -1) :
<ide> function urlToOptions(url) {
<ide> const forwardSlashRegEx = /\//g;
<ide>
<ide> function getPathFromURLWin32(url) {
<del> var hostname = url.hostname;
<add> const hostname = url.hostname;
<ide> var pathname = url.pathname;
<ide> for (var n = 0; n < pathname.length; n++) {
<ide> if (pathname[n] === '%') {
<ide> function getPathFromURLPosix(url) {
<ide> if (url.hostname !== '') {
<ide> throw new ERR_INVALID_FILE_URL_HOST(platform);
<ide> }
<del> var pathname = url.pathname;
<add> const pathname = url.pathname;
<ide> for (var n = 0; n < pathname.length; n++) {
<ide> if (pathname[n] === '%') {
<ide> var third = pathname.codePointAt(n + 2) | 0x20;
<ide> function toPathIfFileURL(fileURLOrPath) {
<ide>
<ide> function constructUrl(flags, protocol, username, password,
<ide> host, port, path, query, fragment) {
<del> var ctx = new URLContext();
<add> const ctx = new URLContext();
<ide> ctx.flags = flags;
<ide> ctx.scheme = protocol;
<ide> ctx.username = (flags & URL_FLAGS_HAS_USERNAME) !== 0 ? username : '';
<ide><path>lib/internal/util.js
<ide> function getSignalsToNamesMapping() {
<ide> return signalsToNamesMapping;
<ide>
<ide> signalsToNamesMapping = Object.create(null);
<del> for (var key in signals) {
<add> for (const key in signals) {
<ide> signalsToNamesMapping[signals[key]] = key;
<ide> }
<ide>
<ide><path>lib/net.js
<ide> function createServer(options, connectionListener) {
<ide> // connect(path, [cb]);
<ide> //
<ide> function connect(...args) {
<del> var normalized = normalizeArgs(args);
<del> var options = normalized[0];
<add> const normalized = normalizeArgs(args);
<add> const options = normalized[0];
<ide> debug('createConnection', normalized);
<del> var socket = new Socket(options);
<add> const socket = new Socket(options);
<ide>
<ide> if (options.timeout) {
<ide> socket.setTimeout(options.timeout);
<ide> function normalizeArgs(args) {
<ide> }
<ide> }
<ide>
<del> var cb = args[args.length - 1];
<add> const cb = args[args.length - 1];
<ide> if (typeof cb !== 'function')
<ide> arr = [options, null];
<ide> else
<ide> Socket.prototype._final = function(cb) {
<ide>
<ide> debug('_final: not ended, call shutdown()');
<ide>
<del> var req = new ShutdownWrap();
<add> const req = new ShutdownWrap();
<ide> req.oncomplete = afterShutdown;
<ide> req.handle = this._handle;
<ide> req.callback = cb;
<del> var err = this._handle.shutdown(req);
<add> const err = this._handle.shutdown(req);
<ide>
<ide> if (err === 1) // synchronous finish
<ide> return afterShutdown.call(req, 0);
<ide> Socket.prototype._final = function(cb) {
<ide>
<ide>
<ide> function afterShutdown(status) {
<del> var self = this.handle[owner_symbol];
<add> const self = this.handle[owner_symbol];
<ide>
<ide> debug('afterShutdown destroyed=%j', self.destroyed,
<ide> self._readableState);
<ide> function writeAfterFIN(chunk, encoding, cb) {
<ide> }
<ide>
<ide> // eslint-disable-next-line no-restricted-syntax
<del> var er = new Error('This socket has been ended by the other party');
<add> const er = new Error('This socket has been ended by the other party');
<ide> er.code = 'EPIPE';
<ide> process.nextTick(emitErrorNT, this, er);
<ide> if (typeof cb === 'function') {
<ide> Socket.prototype.connect = function(...args) {
<ide> } else {
<ide> normalized = normalizeArgs(args);
<ide> }
<del> var options = normalized[0];
<del> var cb = normalized[1];
<add> const options = normalized[0];
<add> const cb = normalized[1];
<ide>
<ide> if (this.write !== Socket.prototype.write)
<ide> this.write = Socket.prototype.write;
<ide> Socket.prototype.connect = function(...args) {
<ide> }
<ide>
<ide> const { path } = options;
<del> var pipe = !!path;
<add> const pipe = !!path;
<ide> debug('pipe', pipe, path);
<ide>
<ide> if (!this._handle) {
<ide> Socket.prototype.connect = function(...args) {
<ide>
<ide>
<ide> function lookupAndConnect(self, options) {
<del> var { port, localAddress, localPort } = options;
<del> var host = options.host || 'localhost';
<add> const { localAddress, localPort } = options;
<add> const host = options.host || 'localhost';
<add> let { port } = options;
<ide>
<ide> if (localAddress && !isIP(localAddress)) {
<ide> throw new ERR_INVALID_IP_ADDRESS(localAddress);
<ide> function lookupAndConnect(self, options) {
<ide> port |= 0;
<ide>
<ide> // If host is an IP, skip performing a lookup
<del> var addressType = isIP(host);
<add> const addressType = isIP(host);
<ide> if (addressType) {
<ide> defaultTriggerAsyncIdScope(self[async_id_symbol], process.nextTick, () => {
<ide> if (self.connecting)
<ide> function lookupAndConnect(self, options) {
<ide>
<ide>
<ide> if (dns === undefined) dns = require('dns');
<del> var dnsopts = {
<add> const dnsopts = {
<ide> family: options.family,
<ide> hints: options.hints || 0
<ide> };
<ide> function lookupAndConnect(self, options) {
<ide> debug('connect: find host', host);
<ide> debug('connect: dns options', dnsopts);
<ide> self._host = host;
<del> var lookup = options.lookup || dns.lookup;
<add> const lookup = options.lookup || dns.lookup;
<ide> defaultTriggerAsyncIdScope(self[async_id_symbol], function() {
<ide> lookup(host, dnsopts, function emitLookup(err, ip, addressType) {
<ide> self.emit('lookup', err, ip, addressType, host);
<ide> Socket.prototype.unref = function() {
<ide>
<ide>
<ide> function afterConnect(status, handle, req, readable, writable) {
<del> var self = handle[owner_symbol];
<add> const self = handle[owner_symbol];
<ide>
<ide> // Callback may come after call to destroy
<ide> if (self.destroyed) {
<ide> function setupListenHandle(address, port, addressType, backlog, fd, flags) {
<ide> // Use a backlog of 512 entries. We pass 511 to the listen() call because
<ide> // the kernel does: backlogsize = roundup_pow_of_two(backlogsize + 1);
<ide> // which will thus give us a backlog of 512 entries.
<del> var err = this._handle.listen(backlog || 511);
<add> const err = this._handle.listen(backlog || 511);
<ide>
<ide> if (err) {
<ide> var ex = uvExceptionWithHostPort(err, 'listen', address, port);
<ide> function listenInCluster(server, address, port, addressType,
<ide>
<ide>
<ide> Server.prototype.listen = function(...args) {
<del> var normalized = normalizeArgs(args);
<add> const normalized = normalizeArgs(args);
<ide> var options = normalized[0];
<del> var cb = normalized[1];
<add> const cb = normalized[1];
<ide>
<ide> if (this._handle) {
<ide> throw new ERR_SERVER_ALREADY_LISTEN();
<ide> Server.prototype.listen = function(...args) {
<ide> if (cb !== null) {
<ide> this.once('listening', cb);
<ide> }
<del> var backlogFromArgs =
<add> const backlogFromArgs =
<ide> // (handle, backlog) or (path, backlog) or (port, backlog)
<ide> toNumber(args.length > 1 && args[1]) ||
<ide> toNumber(args.length > 2 && args[2]); // (port, host, backlog)
<ide> Server.prototype.address = function() {
<ide> };
<ide>
<ide> function onconnection(err, clientHandle) {
<del> var handle = this;
<del> var self = handle[owner_symbol];
<add> const handle = this;
<add> const self = handle[owner_symbol];
<ide>
<ide> debug('onconnection');
<ide>
<ide> function onconnection(err, clientHandle) {
<ide> return;
<ide> }
<ide>
<del> var socket = new Socket({
<add> const socket = new Socket({
<ide> handle: clientHandle,
<ide> allowHalfOpen: self.allowHalfOpen,
<ide> pauseOnCreate: self.pauseOnConnect,
<ide><path>lib/path.js
<ide> const win32 = {
<ide> if (path.length === 0)
<ide> return ret;
<ide>
<del> var len = path.length;
<add> const len = path.length;
<ide> var rootEnd = 0;
<ide> let code = path.charCodeAt(0);
<ide>
<ide><path>lib/querystring.js
<ide> const unhexTable = [
<ide> ];
<ide> // A safe fast alternative to decodeURIComponent
<ide> function unescapeBuffer(s, decodeSpaces) {
<del> var out = Buffer.allocUnsafe(s.length);
<add> const out = Buffer.allocUnsafe(s.length);
<ide> var index = 0;
<ide> var outIndex = 0;
<ide> var currentChar;
<ide> var nextChar;
<ide> var hexHigh;
<ide> var hexLow;
<del> var maxLength = s.length - 2;
<add> const maxLength = s.length - 2;
<ide> // Flag to know if some hex chars have been decoded
<ide> var hasHex = false;
<ide> while (index < s.length) {
<ide> function parse(qs, sep, eq, options) {
<ide> return obj;
<ide> }
<ide>
<del> var sepCodes = (!sep ? defSepCodes : charCodes(sep + ''));
<del> var eqCodes = (!eq ? defEqCodes : charCodes(eq + ''));
<add> const sepCodes = (!sep ? defSepCodes : charCodes(sep + ''));
<add> const eqCodes = (!eq ? defEqCodes : charCodes(eq + ''));
<ide> const sepLen = sepCodes.length;
<ide> const eqLen = eqCodes.length;
<ide>
<ide><path>lib/readline.js
<ide> function Interface(input, output, completer, terminal) {
<ide> terminal = !!output.isTTY;
<ide> }
<ide>
<del> var self = this;
<add> const self = this;
<ide>
<ide> this.output = output;
<ide> this.input = input;
<ide> Interface.prototype._addHistory = function() {
<ide>
<ide> Interface.prototype._refreshLine = function() {
<ide> // line length
<del> var line = this._prompt + this.line;
<del> var dispPos = this._getDisplayPos(line);
<del> var lineCols = dispPos.cols;
<del> var lineRows = dispPos.rows;
<add> const line = this._prompt + this.line;
<add> const dispPos = this._getDisplayPos(line);
<add> const lineCols = dispPos.cols;
<add> const lineRows = dispPos.rows;
<ide>
<ide> // cursor position
<del> var cursorPos = this._getCursorPos();
<add> const cursorPos = this._getCursorPos();
<ide>
<ide> // First move to the bottom of the current line, based on cursor pos
<del> var prevRows = this.prevRows || 0;
<add> const prevRows = this.prevRows || 0;
<ide> if (prevRows > 0) {
<ide> moveCursor(this.output, 0, -prevRows);
<ide> }
<ide> Interface.prototype._refreshLine = function() {
<ide> // Move cursor to original position.
<ide> cursorTo(this.output, cursorPos.cols);
<ide>
<del> var diff = lineRows - cursorPos.rows;
<add> const diff = lineRows - cursorPos.rows;
<ide> if (diff > 0) {
<ide> moveCursor(this.output, 0, -diff);
<ide> }
<ide> Interface.prototype._normalWrite = function(b) {
<ide> }
<ide>
<ide> // Run test() on the new string chunk, not on the entire line buffer.
<del> var newPartContainsEnding = lineEnding.test(string);
<add> const newPartContainsEnding = lineEnding.test(string);
<ide>
<ide> if (this._line_buffer) {
<ide> string = this._line_buffer + string;
<ide> Interface.prototype._insertString = function(c) {
<ide> };
<ide>
<ide> Interface.prototype._tabComplete = function(lastKeypressWasTab) {
<del> var self = this;
<add> const self = this;
<ide>
<ide> self.pause();
<ide> self.completer(self.line.slice(0, self.cursor), function onComplete(err, rv) {
<ide> function handleGroup(self, group, width, maxColumns) {
<ide> if (group.length === 0) {
<ide> return;
<ide> }
<del> var minRows = Math.ceil(group.length / maxColumns);
<add> const minRows = Math.ceil(group.length / maxColumns);
<ide> for (var row = 0; row < minRows; row++) {
<ide> for (var col = 0; col < maxColumns; col++) {
<ide> var idx = row * maxColumns + col;
<ide> function commonPrefix(strings) {
<ide> return '';
<ide> }
<ide> if (strings.length === 1) return strings[0];
<del> var sorted = strings.slice().sort();
<del> var min = sorted[0];
<del> var max = sorted[sorted.length - 1];
<add> const sorted = strings.slice().sort();
<add> const min = sorted[0];
<add> const max = sorted[sorted.length - 1];
<ide> for (var i = 0, len = min.length; i < len; i++) {
<ide> if (min[i] !== max[i]) {
<ide> return min.slice(0, i);
<ide> Interface.prototype.clearLine = function() {
<ide>
<ide>
<ide> Interface.prototype._line = function() {
<del> var line = this._addHistory();
<add> const line = this._addHistory();
<ide> this.clearLine();
<ide> this._onLine(line);
<ide> };
<ide> Interface.prototype._historyPrev = function() {
<ide> // Returns the last character's display position of the given string
<ide> Interface.prototype._getDisplayPos = function(str) {
<ide> var offset = 0;
<del> var col = this.columns;
<add> const col = this.columns;
<ide> var row = 0;
<ide> var code;
<ide> str = stripVTControlCharacters(str);
<ide> Interface.prototype._getDisplayPos = function(str) {
<ide> offset += 2;
<ide> }
<ide> }
<del> var cols = offset % col;
<del> var rows = row + (offset - cols) / col;
<add> const cols = offset % col;
<add> const rows = row + (offset - cols) / col;
<ide> return { cols: cols, rows: rows };
<ide> };
<ide>
<ide>
<ide> // Returns current cursor's position and line
<ide> Interface.prototype._getCursorPos = function() {
<del> var columns = this.columns;
<del> var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor);
<del> var dispPos = this._getDisplayPos(stripVTControlCharacters(strBeforeCursor));
<add> const columns = this.columns;
<add> const strBeforeCursor = this._prompt + this.line.substring(0, this.cursor);
<add> const dispPos = this._getDisplayPos(
<add> stripVTControlCharacters(strBeforeCursor));
<ide> var cols = dispPos.cols;
<ide> var rows = dispPos.rows;
<ide> // If the cursor is on a full-width character which steps over the line,
<ide> Interface.prototype._getCursorPos = function() {
<ide> // This function moves cursor dx places to the right
<ide> // (-dx for left) and refreshes the line if it is needed
<ide> Interface.prototype._moveCursor = function(dx) {
<del> var oldcursor = this.cursor;
<del> var oldPos = this._getCursorPos();
<add> const oldcursor = this.cursor;
<add> const oldPos = this._getCursorPos();
<ide> this.cursor += dx;
<ide>
<ide> // bounds check
<ide> if (this.cursor < 0) this.cursor = 0;
<ide> else if (this.cursor > this.line.length) this.cursor = this.line.length;
<ide>
<del> var newPos = this._getCursorPos();
<add> const newPos = this._getCursorPos();
<ide>
<ide> // Check if cursors are in the same line
<ide> if (oldPos.rows === newPos.rows) {
<ide><path>lib/repl.js
<ide> function REPLServer(prompt,
<ide> }
<ide>
<ide> function _parseREPLKeyword(keyword, rest) {
<del> var cmd = this.commands[keyword];
<add> const cmd = this.commands[keyword];
<ide> if (cmd) {
<ide> cmd.action.call(this, rest);
<ide> return true;
<ide> function REPLServer(prompt,
<ide> return;
<ide> }
<ide>
<del> var empty = self.line.length === 0;
<add> const empty = self.line.length === 0;
<ide> self.clearLine();
<ide> _turnOffEditorMode(self);
<ide>
<ide> exports.start = function(prompt,
<ide> useGlobal,
<ide> ignoreUndefined,
<ide> replMode) {
<del> var repl = new REPLServer(prompt,
<del> source,
<del> eval_,
<del> useGlobal,
<del> ignoreUndefined,
<del> replMode);
<add> const repl = new REPLServer(prompt,
<add> source,
<add> eval_,
<add> useGlobal,
<add> ignoreUndefined,
<add> replMode);
<ide> if (!exports.repl) exports.repl = repl;
<ide> replMap.set(repl, repl);
<ide> return repl;
<ide> REPLServer.prototype.createContext = function() {
<ide> });
<ide> }
<ide>
<del> var module = new CJSModule('<repl>');
<add> const module = new CJSModule('<repl>');
<ide> module.paths =
<ide> CJSModule._resolveLookupPaths('<repl>', parentModule, true) || [];
<ide>
<ide><path>lib/tls.js
<ide> exports.getCiphers = internalUtil.cachedResult(
<ide> function convertProtocols(protocols) {
<ide> const lens = new Array(protocols.length);
<ide> const buff = Buffer.allocUnsafe(protocols.reduce((p, c, i) => {
<del> var len = Buffer.byteLength(c);
<add> const len = Buffer.byteLength(c);
<ide> if (len > 255) {
<ide> throw new ERR_OUT_OF_RANGE('The byte length of the protocol at index ' +
<ide> `${i} exceeds the maximum length.`, '<= 255', len, true);
<ide><path>lib/url.js
<ide> let querystring;
<ide> function urlParse(url, parseQueryString, slashesDenoteHost) {
<ide> if (url instanceof Url) return url;
<ide>
<del> var urlObject = new Url();
<add> const urlObject = new Url();
<ide> urlObject.parse(url, parseQueryString, slashesDenoteHost);
<ide> return urlObject;
<ide> }
<ide> Url.prototype.resolveObject = function resolveObject(relative) {
<ide> relative = rel;
<ide> }
<ide>
<del> var result = new Url();
<del> var tkeys = Object.keys(this);
<add> const result = new Url();
<add> const tkeys = Object.keys(this);
<ide> for (var tk = 0; tk < tkeys.length; tk++) {
<ide> var tkey = tkeys[tk];
<ide> result[tkey] = this[tkey];
<ide> Url.prototype.resolveObject = function resolveObject(relative) {
<ide> return result;
<ide> }
<ide>
<del> var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/');
<del> var isRelAbs = (
<add> const isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/');
<add> const isRelAbs = (
<ide> relative.host || relative.pathname && relative.pathname.charAt(0) === '/'
<ide> );
<ide> var mustEndAbs = (isRelAbs || isSourceAbs ||
<ide> (result.host && relative.pathname));
<del> var removeAllDots = mustEndAbs;
<add> const removeAllDots = mustEndAbs;
<ide> var srcPath = result.pathname && result.pathname.split('/') || [];
<del> var relPath = relative.pathname && relative.pathname.split('/') || [];
<del> var noLeadingSlashes = result.protocol &&
<add> const relPath = relative.pathname && relative.pathname.split('/') || [];
<add> const noLeadingSlashes = result.protocol &&
<ide> !slashedProtocol.has(result.protocol);
<ide>
<ide> // If the url is a non-slashed url, then relative
<ide> Url.prototype.resolveObject = function resolveObject(relative) {
<ide> // however, if it ends in anything else non-slashy,
<ide> // then it must NOT get a trailing slash.
<ide> var last = srcPath.slice(-1)[0];
<del> var hasTrailingSlash = (
<add> const hasTrailingSlash = (
<ide> (result.host || relative.host || srcPath.length > 1) &&
<ide> (last === '.' || last === '..') || last === '');
<ide>
<ide> Url.prototype.resolveObject = function resolveObject(relative) {
<ide> srcPath.push('');
<ide> }
<ide>
<del> var isAbsolute = srcPath[0] === '' ||
<add> const isAbsolute = srcPath[0] === '' ||
<ide> (srcPath[0] && srcPath[0].charAt(0) === '/');
<ide>
<ide> // put the host back
<ide><path>lib/zlib.js
<ide> function zlibBufferSync(engine, buffer) {
<ide> }
<ide>
<ide> function zlibOnError(message, errno, code) {
<del> var self = this[owner_symbol];
<add> const self = this[owner_symbol];
<ide> // There is no way to cleanly recover.
<ide> // Continuing only obscures problems.
<ide> _close(self);
<ide> function maxFlush(a, b) {
<ide>
<ide> const flushBuffer = Buffer.alloc(0);
<ide> ZlibBase.prototype.flush = function(kind, callback) {
<del> var ws = this._writableState;
<add> const ws = this._writableState;
<ide>
<ide> if (typeof kind === 'function' || (kind === undefined && !callback)) {
<ide> callback = kind;
<ide> ZlibBase.prototype._transform = function(chunk, encoding, cb) {
<ide> }
<ide>
<ide> // For the last chunk, also apply `_finishFlushFlag`.
<del> var ws = this._writableState;
<add> const ws = this._writableState;
<ide> if ((ws.ending || ws.ended) && ws.length === chunk.byteLength) {
<ide> flushFlag = maxFlush(flushFlag, this._finishFlushFlag);
<ide> }
<ide> function processChunkSync(self, chunk, flushFlag) {
<ide> var buffers = null;
<ide> var nread = 0;
<ide> var inputRead = 0;
<del> var state = self._writeState;
<del> var handle = self._handle;
<add> const state = self._writeState;
<add> const handle = self._handle;
<ide> var buffer = self._outBuffer;
<ide> var offset = self._outOffset;
<del> var chunkSize = self._chunkSize;
<add> const chunkSize = self._chunkSize;
<ide>
<ide> var error;
<ide> self.on('error', function onError(er) {
<ide> function processChunkSync(self, chunk, flushFlag) {
<ide> }
<ide>
<ide> function processChunk(self, chunk, flushFlag, cb) {
<del> var handle = self._handle;
<add> const handle = self._handle;
<ide> assert(handle, 'zlib binding closed');
<ide>
<ide> handle.buffer = chunk;
<ide> function processCallback() {
<ide> // This callback's context (`this`) is the `_handle` (ZCtx) object. It is
<ide> // important to null out the values once they are no longer needed since
<ide> // `_handle` can stay in memory long after the buffer is needed.
<del> var handle = this;
<del> var self = this[owner_symbol];
<del> var state = self._writeState;
<add> const handle = this;
<add> const self = this[owner_symbol];
<add> const state = self._writeState;
<ide>
<ide> if (self._hadError) {
<ide> this.buffer = null;
<ide> function processCallback() {
<ide> return;
<ide> }
<ide>
<del> var availOutAfter = state[0];
<del> var availInAfter = state[1];
<add> const availOutAfter = state[0];
<add> const availInAfter = state[1];
<ide>
<ide> const inDelta = handle.availInBefore - availInAfter;
<ide> self.bytesWritten += inDelta;
<ide>
<del> var have = handle.availOutBefore - availOutAfter;
<add> const have = handle.availOutBefore - availOutAfter;
<ide> if (have > 0) {
<ide> var out = self._outBuffer.slice(self._outOffset, self._outOffset + have);
<ide> self._outOffset += have; | 44 |
Python | Python | add testcfg.py to test/abort/ | 5251fe52c337515235e72343e93788aecf148bc4 | <ide><path>test/abort/testcfg.py
<add>import sys, os
<add>sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
<add>import testpy
<add>
<add>def GetConfiguration(context, root):
<add> return testpy.SimpleTestConfiguration(context, root, 'abort') | 1 |
Javascript | Javascript | handle windows unc paths as windows paths | 058951faa101476a5fb2d8fe016d3ecf39f538d2 | <ide><path>lib/util/fs.js
<ide> const relative = (fs, rootPath, targetPath) => {
<ide> return fs.relative(rootPath, targetPath);
<ide> } else if (rootPath.startsWith("/")) {
<ide> return path.posix.relative(rootPath, targetPath);
<del> } else if (rootPath.length > 1 && rootPath[1] === ":") {
<add> } else if ((rootPath.length > 1 && rootPath[1] === ":") || rootPath.startsWith("\\\\")) {
<ide> return path.win32.relative(rootPath, targetPath);
<ide> } else {
<ide> throw new Error(
<ide> const join = (fs, rootPath, filename) => {
<ide> return fs.join(rootPath, filename);
<ide> } else if (rootPath.startsWith("/")) {
<ide> return path.posix.join(rootPath, filename);
<del> } else if (rootPath.length > 1 && rootPath[1] === ":") {
<add> } else if ((rootPath.length > 1 && rootPath[1] === ":") || rootPath.startsWith("\\\\")) {
<ide> return path.win32.join(rootPath, filename);
<ide> } else {
<ide> throw new Error(
<ide> const dirname = (fs, absPath) => {
<ide> return fs.dirname(absPath);
<ide> } else if (absPath.startsWith("/")) {
<ide> return path.posix.dirname(absPath);
<del> } else if (absPath.length > 1 && absPath[1] === ":") {
<add> } else if ((absPath.length > 1 && absPath[1] === ":") || absPath.startsWith("\\\\")) {
<ide> return path.win32.dirname(absPath);
<ide> } else {
<ide> throw new Error( | 1 |
PHP | PHP | update wherepivot phpdoc | 283d57edfedf4b9eb045c3352153c6a64f6cc5f8 | <ide><path>src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
<ide> public function as($accessor)
<ide> * Set a where clause for a pivot table column.
<ide> *
<ide> * @param string $column
<del> * @param string|null $operator
<add> * @param mixed $operator
<ide> * @param mixed $value
<ide> * @param string $boolean
<ide> * @return $this
<ide> public function wherePivotIn($column, $values, $boolean = 'and', $not = false)
<ide> * Set an "or where" clause for a pivot table column.
<ide> *
<ide> * @param string $column
<del> * @param string|null $operator
<add> * @param mixed $operator
<ide> * @param mixed $value
<ide> * @return $this
<ide> */ | 1 |
Python | Python | remove ca_cert argument from docker driver | 3c6b7eba8b34007b2dc1e8f5726beabdd207dc78 | <ide><path>libcloud/container/drivers/docker.py
<ide> class DockertlsConnection(KeyCertificateConnection):
<ide>
<ide> def __init__(self, key, secret, secure=True,
<ide> host='localhost',
<del> port=4243, ca_cert='', key_file='', cert_file='', **kwargs):
<add> port=4243, key_file='', cert_file='', **kwargs):
<ide>
<ide> super(DockertlsConnection, self).__init__(key_file=key_file,
<ide> cert_file=cert_file,
<ide> class DockerContainerDriver(ContainerDriver):
<ide> version = '1.24'
<ide>
<ide> def __init__(self, key='', secret='', secure=False, host='localhost',
<del> port=4243, key_file=None, cert_file=None, ca_cert=None):
<add> port=4243, key_file=None, cert_file=None):
<ide> """
<ide> :param key: API key or username to used (required)
<ide> :type key: ``str``
<ide> def __init__(self, key='', secret='', secure=False, host='localhost',
<ide> 'Needs both private key file and '
<ide> 'certificate file for tls authentication')
<ide>
<del> if ca_cert:
<del> self.connection.connection.ca_cert = ca_cert
<del> elif hasattr(self.connection.connection, 'ca_cert'):
<del> # already set by libcloud.security.CA_CERTS_PATH
<del> pass
<del> else:
<del> # do not verify SSL certificate
<del> self.connection.connection.ca_cert = False
<del>
<ide> self.connection.secure = secure
<ide> self.connection.host = host
<ide> self.connection.port = port | 1 |
Python | Python | fix a test failure with python 2.5 | 7ff9df3865d4d601724e5ac6208b31ac9d8cc103 | <ide><path>libcloud/test/compute/test_ssh_client.py
<ide> # limitations under the License.
<ide>
<ide> from __future__ import absolute_import
<add>from __future__ import with_statement
<ide>
<ide> import sys
<ide> import unittest | 1 |
PHP | PHP | remove duplicate alias for debugger renderers | 5c62a2eeab1987ca36995cd1486c48846fdd07ac | <ide><path>src/Error/Debugger.php
<ide> class Debugger
<ide> * @var array<string, class-string>
<ide> */
<ide> protected $renderers = [
<del> // Backwards compatible alias for text that will be deprecated.
<ide> 'txt' => TextErrorRenderer::class,
<del> 'text' => TextErrorRenderer::class,
<ide> // The html alias currently uses no JS and will be deprecated.
<ide> 'js' => HtmlErrorRenderer::class,
<ide> ]; | 1 |
Go | Go | normalize comment formatting | 9de5d3da894950d4dbcae35f8d4136a0810cc63b | <ide><path>pkg/chrootarchive/archive_test.go
<ide> func TestChrootUntarWithHugeExcludesList(t *testing.T) {
<ide> t.Fatal(err)
<ide> }
<ide> options := &archive.TarOptions{}
<del> //65534 entries of 64-byte strings ~= 4MB of environment space which should overflow
<del> //on most systems when passed via environment or command line arguments
<add> // 65534 entries of 64-byte strings ~= 4MB of environment space which should overflow
<add> // on most systems when passed via environment or command line arguments
<ide> excludes := make([]string, 65534)
<ide> for i := 0; i < 65534; i++ {
<ide> excludes[i] = strings.Repeat(string(i), 64)
<ide><path>pkg/chrootarchive/archive_unix.go
<ide> func untar() {
<ide>
<ide> var options archive.TarOptions
<ide>
<del> //read the options from the pipe "ExtraFiles"
<add> // read the options from the pipe "ExtraFiles"
<ide> if err := json.NewDecoder(os.NewFile(3, "options")).Decode(&options); err != nil {
<ide> fatal(err)
<ide> }
<ide> func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T
<ide> return fmt.Errorf("Untar error on re-exec cmd: %v", err)
<ide> }
<ide>
<del> //write the options to the pipe for the untar exec to read
<add> // write the options to the pipe for the untar exec to read
<ide> if err := json.NewEncoder(w).Encode(options); err != nil {
<ide> w.Close()
<ide> return fmt.Errorf("Untar json encode to pipe failed: %v", err) | 2 |
Text | Text | update changelog [ci skip] | 7da998b3c28c4cd67c65814c0718dac52252cae0 | <ide><path>CHANGELOG.md
<ide>
<ide> - [#17846](https://github.com/emberjs/ember.js/pull/17846) [BUGFIX] Fix issues with template-only components causing errors in subsequent updates.
<ide> - [#17870](https://github.com/emberjs/ember.js/pull/17870) / [#17871](https://github.com/emberjs/ember.js/pull/17871) [BUGFIX] Fix issue where `...attributes` may incorrectly overwrite attributes unexpectedly, depending on its position.
<add>- [#17872](https://github.com/emberjs/ember.js/pull/17872) [BUGFIX] Fix issue where `{{link-to}}` is causing unexpected local variable shadowing assertions.
<ide>
<ide> ### v3.10.0-beta.1 (April 02, 2019)
<ide> | 1 |
Python | Python | add a note about tf.image.convert_image_dtype | 6eeec4e70eca4883a3e7aa7f0955793ded0130d1 | <ide><path>official/resnet/imagenet_main.py
<ide> def parse_record(raw_record, is_training):
<ide> image = tf.image.decode_image(
<ide> tf.reshape(parsed['image/encoded'], shape=[]),
<ide> _NUM_CHANNELS)
<add>
<add> # Note that tf.image.convert_image_dtype scales the image data to [0, 1).
<ide> image = tf.image.convert_image_dtype(image, dtype=tf.float32)
<ide>
<ide> image = vgg_preprocessing.preprocess_image( | 1 |
Python | Python | fix pkg-config search for libnghttp2 | efb406ccd55dc091ea28a6bcb8f4e792bbd3e380 | <ide><path>configure.py
<ide>
<ide> shared_optgroup.add_option('--shared-cares',
<ide> action='store_true',
<del> dest='shared_libcares',
<add> dest='shared_cares',
<ide> help='link to a shared cares DLL instead of static linking')
<ide>
<ide> shared_optgroup.add_option('--shared-cares-includes',
<ide> action='store',
<del> dest='shared_libcares_includes',
<add> dest='shared_cares_includes',
<ide> help='directory containing cares header files')
<ide>
<ide> shared_optgroup.add_option('--shared-cares-libname',
<ide> action='store',
<del> dest='shared_libcares_libname',
<add> dest='shared_cares_libname',
<ide> default='cares',
<ide> help='alternative lib name to link to [default: %default]')
<ide>
<ide> shared_optgroup.add_option('--shared-cares-libpath',
<ide> action='store',
<del> dest='shared_libcares_libpath',
<add> dest='shared_cares_libpath',
<ide> help='a directory to search for the shared cares DLL')
<ide>
<ide> parser.add_option_group(shared_optgroup)
<ide> def configure_napi(output):
<ide> version = getnapibuildversion.get_napi_version()
<ide> output['variables']['napi_build_version'] = version
<ide>
<del>def configure_library(lib, output):
<add>def configure_library(lib, output, pkgname=None):
<ide> shared_lib = 'shared_' + lib
<ide> output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib))
<ide>
<ide> if getattr(options, shared_lib):
<del> (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = pkg_config(lib)
<add> (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = (
<add> pkg_config(pkgname or lib))
<ide>
<ide> if options.__dict__[shared_lib + '_includes']:
<ide> output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
<ide> def make_bin_override():
<ide> configure_library('zlib', output)
<ide> configure_library('http_parser', output)
<ide> configure_library('libuv', output)
<del>configure_library('libcares', output)
<del>configure_library('nghttp2', output)
<del># stay backwards compatible with shared cares builds
<del>output['variables']['node_shared_cares'] = \
<del> output['variables'].pop('node_shared_libcares')
<add>configure_library('cares', output, pkgname='libcares')
<add>configure_library('nghttp2', output, pkgname='libnghttp2')
<ide> configure_v8(output)
<ide> configure_openssl(output)
<ide> configure_intl(output) | 1 |
Text | Text | update links and add new public spinenet link | 6fa901c983b75575621670e01196057bd6102de6 | <ide><path>research/object_detection/g3doc/deepmac.md
<ide> segmentation task.
<ide> * The field `allowed_masked_classes_ids` controls which classes recieve mask
<ide> supervision during training.
<ide> * Mask R-CNN based ablations in the paper are implemented in the
<del> [TF model garden](../../../official/vision/beta/projects/deepmac_maskrcnn)
<add> [TF model garden](../../../official/projects/deepmac_maskrcnn)
<ide> code base.
<ide>
<ide> ## Prerequisites
<ide>
<ide> 1. Follow [TF2 install instructions](tf2.md) to install Object Detection API.
<ide> 2. Generate COCO dataset by using
<del> [create_coco_tf_record.py](../../../official/vision/beta/data/create_coco_tf_record.py)
<add> [create_coco_tf_record.py](../../../official/vision/data/create_coco_tf_record.py)
<ide>
<ide> ## Configurations
<ide>
<ide> Both these models take Image + boxes as input and produce per-box instance
<ide> masks as output.
<ide>
<ide> * [CenterNet Hourglass backbone](http://download.tensorflow.org/models/object_detection/tf2/20210329/deepmac_1024x1024_coco17.tar.gz)
<del>* [Mask-RCNN SpineNet backbone](https://storage.cloud.google.com/tf_model_garden/vision/deepmac_maskrcnn/deepmarc_spinenet.zip)
<add>* [Mask-RCNN SpineNet backbone](https://storage.googleapis.com/tf_model_garden/vision/deepmac_maskrcnn/deepmarc_spinenet.zip)
<ide>
<ide>
<ide> ## See also | 1 |
Mixed | Ruby | update the documentation and add changelog entry | eedc513503785490a7caed23cd0a0aef3536759f | <ide><path>actionpack/CHANGELOG.md
<ide> ## Rails 4.0.0 (unreleased) ##
<ide>
<add>* `truncate` now accepts a block to show extra content when the text is truncated. *Li Ellis Gallardo*
<add>
<ide> * Add `week_field`, `week_field_tag`, `month_field`, `month_field_tag`, `datetime_local_field`,
<ide> `datetime_local_field_tag`, `datetime_field` and `datetime_field_tag` helpers. *Carlos Galdino*
<ide>
<ide><path>actionpack/lib/action_view/helpers/text_helper.rb
<ide> def safe_concat(string)
<ide> #
<ide> # Pass a <tt>:separator</tt> to truncate +text+ at a natural break.
<ide> #
<del> # The result is not marked as HTML-safe, so will be subject to the default escaping when
<del> # used in views, unless wrapped by <tt>raw()</tt>. Care should be taken if +text+ contains HTML tags
<del> # or entities, because truncation may produce invalid HTML (such as unbalanced or incomplete tags).
<add> # Pass a block if you want to show extra content when the text is truncated.
<add> #
<add> # The result is marked as HTML-safe, but the it is escaped first.
<ide> #
<ide> # truncate("Once upon a time in a world far far away")
<ide> # # => "Once upon a time in a world..."
<ide><path>activesupport/lib/active_support/core_ext/string/filters.rb
<ide> def squish!
<ide> # # => "Once upon a time in a..."
<ide> #
<ide> # The last characters will be replaced with the <tt>:omission</tt> string (defaults to "...")
<del> # for a total length not exceeding <tt>:length</tt>:
<add> # for a total length not exceeding <tt>length</tt>:
<ide> #
<ide> # 'And they found that many people were sleeping better.'.truncate(25, :omission => '... (continued)')
<ide> # # => "And they f... (continued)" | 3 |
Javascript | Javascript | remove unused todom method | ba1fcb82fe5cde4e40eac7a29f2623f9f38a4aaf | <ide><path>packages/ember-views/lib/system/render_buffer.js
<ide> ClassSet.prototype = {
<ide> this.seen[string] = true;
<ide>
<ide> this.list.push(string);
<del> },
<del>
<del> toDOM: function() {
<del> return this.list.join(" ");
<ide> }
<ide> };
<ide> | 1 |
Ruby | Ruby | add explicit testing for `uncached` vs. `cached` | 5118a3b8b00b9f15dc2b71c281f2b814ea5d14ab | <ide><path>activerecord/test/cases/query_cache_test.rb
<ide> def test_cache_is_not_available_when_using_a_not_connected_connection
<ide> Task.connection_specification_name = spec_name
<ide> end
<ide>
<add> def test_query_cache_executes_new_queries_within_block
<add> ActiveRecord::Base.connection.enable_query_cache!
<add>
<add> # Warm up the cache by running the query
<add> assert_queries(1) do
<add> assert_equal 0, Post.where(title: 'test').to_a.count
<add> end
<add>
<add> # Check that if the same query is run again, no queries are executed
<add> assert_queries(0) do
<add> assert_equal 0, Post.where(title: 'test').to_a.count
<add> end
<add>
<add> ActiveRecord::Base.connection.uncached do
<add> # Check that new query is executed, avoiding the cache
<add> assert_queries(1) do
<add> assert_equal 0, Post.where(title: 'test').to_a.count
<add> end
<add> end
<add> end
<add>
<ide> def test_query_cache_doesnt_leak_cached_results_of_rolled_back_queries
<ide> ActiveRecord::Base.connection.enable_query_cache!
<ide> post = Post.first | 1 |
Javascript | Javascript | update js file | 9e4fb7174fdec07e576521d9647819a065537d5a | <ide><path>examples/js/lines/LineSegments2.js
<del>import { Matrix4, Vector3, Line, Math as MathUtils } from "../../../build/three.module.js";
<del>
<ide> /**
<ide> * @author WestLangley / http://github.com/WestLangley
<ide> *
<ide> THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy
<ide>
<ide> raycast: ( function () {
<ide>
<del> var start = new Vector4();
<del> var end = new Vector4();
<add> var start = new THREE.Vector4();
<add> var end = new THREE.Vector4();
<ide>
<del> var ssOrigin = new Vector4();
<del> var mvMatrix = new Matrix4();
<del> var line = new Line();
<del> var closestPoint = new Vector3();
<add> var ssOrigin = new THREE.Vector4();
<add> var ssOrigin3 = new THREE.Vector3();
<add> var mvMatrix = new THREE.Matrix4();
<add> var line = new THREE.Line3();
<add> var closestPoint = new THREE.Vector3();
<ide>
<ide> return function raycast( raycaster, intersects ) {
<ide>
<ide> if ( raycaster.camera === null ) {
<ide>
<del> console.error( 'THREE.LineSegments2: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
<add> console.error( 'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.' );
<ide>
<ide> }
<ide>
<ide> THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy
<ide> var geometry = this.geometry;
<ide> var material = this.material;
<ide> var resolution = material.resolution;
<del> var lineWidth = material.lineWidth;
<add> var lineWidth = material.linewidth;
<ide>
<ide> var instanceStart = geometry.attributes.instanceStart;
<ide> var instanceEnd = geometry.attributes.instanceEnd;
<ide>
<ide> // ndc space [ - 0.5, 0.5 ]
<del> ssOrigin.copy( ray.origin );
<add> ray.at( 1, ssOrigin );
<ide> ssOrigin.w = 1;
<ide> ssOrigin.applyMatrix4( camera.matrixWorldInverse );
<ide> ssOrigin.applyMatrix4( projectionMatrix );
<ide> ssOrigin.multiplyScalar( 1 / ssOrigin.w );
<ide>
<ide> // screen space
<del> ssOrigin.x *= resolution.x;
<del> ssOrigin.y *= resolution.y;
<add> ssOrigin.x *= resolution.x / 2;
<add> ssOrigin.y *= resolution.y / 2;
<ide> ssOrigin.z = 0;
<ide>
<add> ssOrigin3.copy( ssOrigin );
<add>
<ide> var matrixWorld = this.matrixWorld;
<ide> mvMatrix.multiplyMatrices( camera.matrixWorldInverse, matrixWorld );
<ide>
<ide> for ( var i = 0, l = instanceStart.count; i < l; i ++ ) {
<ide>
<del> // TODO: Maybe have to clip the line based on the camera?
<del>
<ide> start.fromBufferAttribute( instanceStart, i );
<ide> end.fromBufferAttribute( instanceEnd, i );
<ide>
<ide> THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy
<ide> start.applyMatrix4( projectionMatrix );
<ide> end.applyMatrix4( projectionMatrix );
<ide>
<add> // ndc space [ - 1.0, 1.0 ]
<add> start.multiplyScalar( 1 / start.w );
<add> end.multiplyScalar( 1 / end.w );
<add>
<ide> // segment is behind camera near
<del> if ( start.z > 0 && end.z > 0 ) {
<add> if ( start.z < - 1 && end.z < - 1 ) {
<ide>
<ide> continue;
<ide>
<ide> }
<ide>
<ide> // segment is in front of camera far
<del> if ( start.z < - 1 && end.z < - 1 ) {
<add> if ( start.z > 1 && end.z > 1 ) {
<ide>
<ide> continue;
<ide>
<ide> }
<ide>
<del> // ndc space [ - 0.5, 0.5 ]
<del> start.multiplyScalar( 1 / start.w );
<del> end.multiplyScalar( 1 / end.w );
<del>
<ide> // screen space
<del> start.x *= resolution.x;
<del> start.y *= resolution.y;
<add> start.x *= resolution.x / 2;
<add> start.y *= resolution.y / 2;
<ide>
<del> end.y *= resolution.y;
<del> end.y *= resolution.y;
<add> end.x *= resolution.x / 2;
<add> end.y *= resolution.y / 2;
<ide>
<ide> // create 2d segment
<ide> line.start.copy( start );
<ide> THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy
<ide> line.end.z = 0;
<ide>
<ide> // get closest point on ray to segment
<del> var param = line.closestPointToPointParameter( ssOrigin, true );
<add> var param = line.closestPointToPointParameter( ssOrigin3, true );
<ide> line.at( param, closestPoint );
<ide>
<ide> // check if the intersection point is within clip space
<ide> var zPos = MathUtils.lerp( start.z, end.z, param );
<del> var isInClipSpace = zPos < 0 && zPos > - 1;
<add> var isInClipSpace = zPos >= -1 && zPos <= 1;
<ide>
<del> if ( isInClipSpace && ssOrigin.distanceTo( closestPoint ) < lineWidth * 0.5 ) {
<add> if ( isInClipSpace && ssOrigin3.distanceTo( closestPoint ) < lineWidth * 0.5 ) {
<ide>
<ide> line.start.fromBufferAttribute( instanceStart, i );
<ide> line.end.fromBufferAttribute( instanceEnd, i );
<ide>
<ide> line.start.applyMatrix4( matrixWorld );
<ide> line.end.applyMatrix4( matrixWorld );
<ide>
<del> var pointOnLine = new Vector3();
<add> var pointOnLine = new THREE.Vector3();
<ide> line.at( param, pointOnLine );
<ide>
<del> var point = new Vector3();
<add> var point = new THREE.Vector3();
<ide> ray.closestPointToPoint( pointOnLine, point );
<ide>
<ide> intersects.push( { | 1 |
Python | Python | add library sources to some dependencies | 777c6e5346251c0c2fc9fba4d1295a7cc8fc83d7 | <ide><path>numpy/core/setup.py
<ide> def get_mathlib_info(*args):
<ide> subst_dict["posix_mathlib"] = posix_mlib
<ide> subst_dict["msvc_mathlib"] = msvc_mlib
<ide>
<add> npymath_sources = [join('src', 'npymath', 'npy_math.c.src'),
<add> join('src', 'npymath', 'ieee754.c.src'),
<add> join('src', 'npymath', 'npy_math_complex.c.src'),
<add> join('src', 'npymath', 'halffloat.c')]
<ide> config.add_installed_library('npymath',
<del> sources=[join('src', 'npymath', 'npy_math.c.src'),
<del> join('src', 'npymath', 'ieee754.c.src'),
<del> join('src', 'npymath', 'npy_math_complex.c.src'),
<del> join('src', 'npymath', 'halffloat.c'),
<del> get_mathlib_info],
<add> sources=npymath_sources + [get_mathlib_info],
<ide> install_dir='lib')
<ide> config.add_npy_pkg_config("npymath.ini.in", "lib/npy-pkg-config",
<ide> subst_dict)
<ide> def get_mathlib_info(*args):
<ide> #######################################################################
<ide>
<ide> # This library is created for the build but it is not installed
<add> npysort_sources=[join('src', 'npysort', 'quicksort.c.src'),
<add> join('src', 'npysort', 'mergesort.c.src'),
<add> join('src', 'npysort', 'heapsort.c.src'),
<add> join('src','private', 'npy_partition.h.src'),
<add> join('src', 'npysort', 'selection.c.src')]
<ide> config.add_library('npysort',
<del> sources=[join('src', 'npysort', 'quicksort.c.src'),
<del> join('src', 'npysort', 'mergesort.c.src'),
<del> join('src', 'npysort', 'heapsort.c.src'),
<del> join('src','private', 'npy_partition.h.src'),
<del> join('src', 'npysort', 'selection.c.src')],
<del> deps=[join('src', 'npysort', 'quicksort.c'),
<del> join('src', 'npysort', 'mergesort.c'),
<del> join('src', 'npysort', 'heapsort.c'),
<del> join('src', 'private', 'npy_partition.h'),
<del> join('src', 'npysort', 'selection.c')],
<add> sources=npysort_sources,
<ide> include_dirs=[])
<ide>
<ide>
<ide> def generate_multiarray_templated_sources(ext, build_dir):
<ide> join('src', 'multiarray', 'ucsnarrow.h'),
<ide> join('src', 'multiarray', 'usertypes.h'),
<ide> join('src', 'private', 'lowlevel_strided_loops.h'),
<del> join('src', 'private', 'scalarmathmodule.h.src'),
<ide> join('include', 'numpy', 'arrayobject.h'),
<ide> join('include', 'numpy', '_neighborhood_iterator_imp.h'),
<ide> join('include', 'numpy', 'npy_endian.h'),
<ide> def generate_multiarray_templated_sources(ext, build_dir):
<ide> join('include', 'numpy', 'ndarraytypes.h'),
<ide> join('include', 'numpy', 'npy_1_7_deprecated_api.h'),
<ide> join('include', 'numpy', '_numpyconfig.h.in'),
<del> ]
<add> # add library sources as distuils does not consider libraries
<add> # dependencies
<add> ] + npysort_sources + npymath_sources
<ide>
<ide> multiarray_src = [
<ide> join('src', 'multiarray', 'arrayobject.c'),
<ide> def generate_umath_c(ext, build_dir):
<ide> generate_umath_py,
<ide> join('src', 'umath', 'simd.inc.src'),
<ide> join(codegen_dir, 'generate_ufunc_api.py'),
<del> join('src', 'private', 'ufunc_override.h')]
<add> join('src', 'private', 'ufunc_override.h')] + npymath_sources
<ide>
<ide> if not ENABLE_SEPARATE_COMPILATION:
<ide> umath_deps.extend(umath_src)
<ide> def generate_umath_c(ext, build_dir):
<ide> generate_numpyconfig_h,
<ide> generate_numpy_api,
<ide> generate_ufunc_api],
<del> depends = deps,
<add> depends = deps + npymath_sources,
<ide> libraries = ['npymath'],
<ide> )
<ide> | 1 |
Javascript | Javascript | add reference to materials to obj loader | 13febe3f3d9fd9c9a3762baaa02e5069303837f8 | <ide><path>examples/js/loaders/OBJLoader.js
<ide> THREE.OBJLoader = function ( manager ) {
<ide>
<ide> this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
<add>
<add> this.materials = null;
<ide>
<ide> };
<ide>
<ide> THREE.OBJLoader.prototype = {
<ide> this.crossOrigin = value;
<ide>
<ide> },
<add>
<add> setMaterials: function ( materials ) {
<add>
<add> this.materials = materials;
<add>
<add> },
<ide>
<ide> parse: function ( text ) {
<ide>
<ide> THREE.OBJLoader.prototype = {
<ide> buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );
<ide>
<ide> }
<add>
<add> var material;
<add>
<add> if ( this.materials !== null ) {
<add>
<add> material = this.materials.create( object.material.name );
<add>
<add> }
<add>
<add> if ( !material ) {
<add>
<add> material = new THREE.MeshPhongMaterial();
<add> material.name = object.material.name;
<add>
<add> }
<ide>
<ide> material = new THREE.MeshLambertMaterial();
<ide> material.name = object.material.name; | 1 |
Javascript | Javascript | add release argument to sentrywebpackplugin | d98cd8ad31b765ce6477193e02e737d26c9558eb | <ide><path>examples/with-sentry-simple/next.config.js
<ide> module.exports = withSourceMaps({
<ide> include: '.next',
<ide> ignore: ['node_modules'],
<ide> urlPrefix: '~/_next',
<add> release: options.buildId,
<ide> })
<ide> )
<ide> } | 1 |
Python | Python | add test for ticket #882 fix | d0db38aea3d8e4f15808a87a1051cf2f8bf30601 | <ide><path>numpy/core/tests/test_regression.py
<ide> def test_for_object_scalar_creation(self, level=rlevel):
<ide> assert c.dtype == object
<ide> assert d.dtype == object
<ide>
<add> def test_for_zero_length_in_choose(self, level=rlevel):
<add> "Ticket #882"
<add> a = np.array(1)
<add> self.failUnlessRaises(ValueError, lambda x: x.choose([]), a)
<add>
<ide> if __name__ == "__main__":
<ide> run_module_suite() | 1 |
Javascript | Javascript | change "defaultedproduction" to undefined | 002f45ae72a9fa4ca10670765d47a4545427f906 | <ide><path>lib/WebpackOptionsApply.js
<ide> class WebpackOptionsApply extends OptionsApply {
<ide> new ImportPlugin(options.module).apply(compiler);
<ide> new SystemPlugin(options.module).apply(compiler);
<ide>
<del> if(typeof options.mode !== "string" || options.mode === "defaultedProduction")
<add> if(typeof options.mode !== "string")
<ide> new WarnNoModeSetPlugin().apply(compiler);
<ide>
<ide> new EnsureChunkConditionsPlugin().apply(compiler);
<ide><path>lib/WebpackOptionsDefaulter.js
<ide> const path = require("path");
<ide>
<ide> const OptionsDefaulter = require("./OptionsDefaulter");
<ide> const Template = require("./Template");
<del>const isProductionLikeMode = require("./util/mode");
<add>
<add>const isProductionLikeMode = options => {
<add> return options.mode === "production" || !options.mode;
<add>};
<ide>
<ide> class WebpackOptionsDefaulter extends OptionsDefaulter {
<ide> constructor() {
<ide> super();
<ide>
<ide> this.set("entry", "./src");
<del> this.set("mode", "defaultedProduction");
<ide>
<ide> this.set("devtool", "make", options => (options.mode === "development" ? "eval" : false));
<ide> this.set("cache", "make", options => options.mode === "development");
<ide> class WebpackOptionsDefaulter extends OptionsDefaulter {
<ide> this.set("node.__filename", "mock");
<ide> this.set("node.__dirname", "mock");
<ide>
<del> this.set("performance", "make", options => (options.mode !== "production" ? false : undefined));
<add> this.set("performance", "make", options => (isProductionLikeMode(options) ? false : undefined));
<ide> this.set("performance", "call", value => {
<ide> if(typeof value === "boolean") {
<ide> return value;
<ide><path>lib/util/mode.js
<del>module.exports = function isProductionLikeMode(options) {
<del> return options.mode === "production" || options.mode === "defaultedProduction";
<del>};
<ide><path>test/Compiler-caching.test.js
<ide> describe("Compiler (caching)", function() {
<ide> this.timeout(15000);
<ide>
<ide> function compile(entry, options, callback) {
<add> options.mode = "none";
<ide> options = new WebpackOptionsDefaulter().process(options);
<del> options.mode = "production";
<ide> options.cache = true;
<ide> options.entry = entry;
<ide> options.optimization.minimize = false; | 4 |
Javascript | Javascript | remove redundant renormalization and add comment | d1c244492a18bb8e0bbe3ca3343a0688df66f9f0 | <ide><path>examples/js/animation/MMDPhysics.js
<ide> THREE.MMDPhysics = ( function () {
<ide> thQ.set( q.x(), q.y(), q.z(), q.w() );
<ide> thQ2.setFromRotationMatrix( this.bone.matrixWorld );
<ide> thQ2.conjugate();
<del> thQ2.multiply( thQ ).normalize();
<add> thQ2.multiply( thQ );
<ide>
<ide> //this.bone.quaternion.multiply( thQ2 );
<ide>
<ide> thQ3.setFromRotationMatrix( this.bone.matrix );
<add>
<add> // Renormalizing quaternion here because repeatedly transforming
<add> // quaternion continuously accumulates floating point error and
<add> // can end up being overflow. See #15335
<ide> this.bone.quaternion.copy( thQ2.multiply( thQ3 ).normalize() );
<ide>
<ide> manager.freeThreeQuaternion( thQ ); | 1 |
Javascript | Javascript | allow falsy values in statics | 13aa8d37e6099afd06c86e7140105f76a0fd95f9 | <ide><path>src/core/ReactCompositeComponent.js
<ide> function mixStaticSpecIntoComponent(ConvenienceConstructor, statics) {
<ide> }
<ide> for (var name in statics) {
<ide> var property = statics[name];
<del> if (!statics.hasOwnProperty(name) || !property) {
<add> if (!statics.hasOwnProperty(name)) {
<ide> return;
<ide> }
<ide>
<ide><path>src/core/__tests__/ReactCompositeComponent-test.js
<ide> describe('ReactCompositeComponent', function() {
<ide> it('should support statics', function() {
<ide> var Component = React.createClass({
<ide> statics: {
<del> abc: 'def'
<add> abc: 'def',
<add> def: 0,
<add> ghi: null,
<add> jkl: 'mno'
<ide> },
<ide>
<ide> render: function() {
<ide> describe('ReactCompositeComponent', function() {
<ide> ReactTestUtils.renderIntoDocument(instance);
<ide> expect(instance.constructor.abc).toBe('def');
<ide> expect(Component.abc).toBe('def');
<add> expect(instance.constructor.def).toBe(0);
<add> expect(Component.def).toBe(0);
<add> expect(instance.constructor.ghi).toBe(null);
<add> expect(Component.ghi).toBe(null);
<add> expect(instance.constructor.jkl).toBe('mno');
<add> expect(Component.jkl).toBe('mno');
<ide> });
<ide>
<ide> it('should support statics in mixins', function() { | 2 |
Go | Go | fix issues with plugin and `--live-restore` | cb6633175c0de0a7ae155c4d378cd2379681554b | <ide><path>integration-cli/docker_cli_daemon_plugins_test.go
<ide> func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C)
<ide>
<ide> // TestDaemonShutdownWithPlugins shuts down running plugins.
<ide> func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
<del> testRequires(c, IsAmd64, Network)
<add> testRequires(c, IsAmd64, Network, SameHostDaemon)
<ide>
<ide> s.d.Start(c)
<ide> if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil {
<ide> func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
<ide> if out, ec, err := runCommandWithOutput(cmd); ec != 1 {
<ide> c.Fatalf("Expected exit code '1', got %d err: %v output: %s ", ec, err, out)
<ide> }
<add>
<add> s.d.Start(c, "--live-restore")
<add> cmd = exec.Command("pgrep", "-f", pluginProcessName)
<add> out, _, err := runCommandWithOutput(cmd)
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<ide> }
<ide>
<ide> // TestVolumePlugin tests volume creation using a plugin.
<ide><path>plugin/manager_linux.go
<ide> func (pm *Manager) enable(p *v2.Plugin, c *controller, force bool) error {
<ide> return err
<ide> }
<ide>
<add> return pm.pluginPostStart(p, c)
<add>}
<add>
<add>func (pm *Manager) pluginPostStart(p *v2.Plugin, c *controller) error {
<ide> client, err := plugins.NewClientWithTimeout("unix://"+filepath.Join(p.GetRuntimeSourcePath(), p.GetSocket()), nil, c.timeoutInSecs)
<ide> if err != nil {
<ide> c.restart = false
<ide> func (pm *Manager) enable(p *v2.Plugin, c *controller, force bool) error {
<ide> p.SetPClient(client)
<ide> pm.pluginStore.SetState(p, true)
<ide> pm.pluginStore.CallHandler(p)
<del>
<ide> return nil
<ide> }
<ide>
<ide> func (pm *Manager) restore(p *v2.Plugin) error {
<del> return pm.containerdClient.Restore(p.GetID(), attachToLog(p.GetID()))
<add> if err := pm.containerdClient.Restore(p.GetID(), attachToLog(p.GetID())); err != nil {
<add> return err
<add> }
<add>
<add> if pm.liveRestore {
<add> c := &controller{}
<add> if pids, _ := pm.containerdClient.GetPidsForContainer(p.GetID()); len(pids) == 0 {
<add> // plugin is not running, so follow normal startup procedure
<add> return pm.enable(p, c, true)
<add> }
<add>
<add> c.exitChan = make(chan bool)
<add> c.restart = true
<add> pm.mu.Lock()
<add> pm.cMap[p] = c
<add> pm.mu.Unlock()
<add> return pm.pluginPostStart(p, c)
<add> }
<add>
<add> return nil
<ide> }
<ide>
<ide> func shutdownPlugin(p *v2.Plugin, c *controller, containerdClient libcontainerd.Client) { | 2 |
PHP | PHP | remove an else | e0e887c588948476508e4fef29961986bf011383 | <ide><path>src/Routing/Middleware/RoutingMiddleware.php
<ide> public function __invoke(ServerRequestInterface $request, ResponseInterface $res
<ide> $runner = new Runner();
<ide>
<ide> return $runner->run($middleware, $request, $response);
<del> } else {
<del> return $next($request, $response);
<ide> }
<add> return $next($request, $response);
<ide> }
<ide> } | 1 |
Text | Text | remove extra paren in `run --link` docs | 484fbe236dcab9fb5b8d48844a8cdc9d614e32e9 | <ide><path>docs/reference/run.md
<ide> If the operator uses `--link` when starting a new client container in the
<ide> default bridge network, then the client container can access the exposed
<ide> port via a private networking interface.
<ide> If `--link` is used when starting a container in a user-defined network as
<del>described in [*Docker network overview*](../userguide/networking/index.md)),
<add>described in [*Docker network overview*](../userguide/networking/index.md),
<ide> it will provide a named alias for the container being linked to.
<ide>
<ide> ### ENV (environment variables) | 1 |
Javascript | Javascript | set default to working color space | dbbde82cd84be119c28f588e259bc19518ace55a | <ide><path>src/math/Color.js
<ide> import { clamp, euclideanModulo, lerp } from './MathUtils.js';
<ide> import { ColorManagement, SRGBToLinear, LinearToSRGB } from './ColorManagement.js';
<del>import { SRGBColorSpace, LinearSRGBColorSpace } from '../constants.js';
<add>import { SRGBColorSpace } from '../constants.js';
<ide>
<ide> const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
<ide> 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,
<ide> class Color {
<ide>
<ide> }
<ide>
<del> setRGB( r, g, b, colorSpace = LinearSRGBColorSpace ) {
<add> setRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {
<ide>
<ide> this.r = r;
<ide> this.g = g;
<ide> class Color {
<ide>
<ide> }
<ide>
<del> setHSL( h, s, l, colorSpace = LinearSRGBColorSpace ) {
<add> setHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {
<ide>
<ide> // h,s,l ranges are in 0.0 - 1.0
<ide> h = euclideanModulo( h, 1 );
<ide> class Color {
<ide>
<ide> }
<ide>
<del> getHSL( target, colorSpace = LinearSRGBColorSpace ) {
<add> getHSL( target, colorSpace = ColorManagement.workingColorSpace ) {
<ide>
<ide> // h,s,l ranges are in 0.0 - 1.0
<ide>
<ide> class Color {
<ide>
<ide> }
<ide>
<del> getRGB( target, colorSpace = LinearSRGBColorSpace ) {
<add> getRGB( target, colorSpace = ColorManagement.workingColorSpace ) {
<ide>
<ide> ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
<ide> | 1 |
Go | Go | add an api test for docker build -f dockerfile | 198ff76de59a600ce900497fd4a6131ee4448c48 | <ide><path>builder/evaluator.go
<ide> import (
<ide> "fmt"
<ide> "io"
<ide> "os"
<del> "path"
<add> "path/filepath"
<ide> "strings"
<ide>
<ide> log "github.com/Sirupsen/logrus"
<ide> func (b *Builder) Run(context io.Reader) (string, error) {
<ide>
<ide> // Reads a Dockerfile from the current context. It assumes that the
<ide> // 'filename' is a relative path from the root of the context
<del>func (b *Builder) readDockerfile(filename string) error {
<del> filename = path.Join(b.contextPath, filename)
<add>func (b *Builder) readDockerfile(origFile string) error {
<add> filename := filepath.Join(b.contextPath, origFile)
<add>
<add> tmpDockerPath := filepath.Dir(filename) + string(os.PathSeparator)
<add> tmpContextPath := filepath.Clean(b.contextPath) + string(os.PathSeparator)
<add>
<add> if !strings.HasPrefix(tmpDockerPath, tmpContextPath) {
<add> return fmt.Errorf("Dockerfile (%s) must be within the build context", origFile)
<add> }
<ide>
<ide> fi, err := os.Stat(filename)
<ide> if os.IsNotExist(err) {
<del> return fmt.Errorf("Cannot build a directory without a Dockerfile")
<add> return fmt.Errorf("Cannot locate specified Dockerfile: %s", origFile)
<ide> }
<ide> if fi.Size() == 0 {
<ide> return ErrDockerfileEmpty
<ide> func (b *Builder) readDockerfile(filename string) error {
<ide> // Note that this assumes the Dockerfile has been read into memory and
<ide> // is now safe to be removed.
<ide>
<del> excludes, _ := utils.ReadDockerIgnore(path.Join(b.contextPath, ".dockerignore"))
<add> excludes, _ := utils.ReadDockerIgnore(filepath.Join(b.contextPath, ".dockerignore"))
<ide> if rm, _ := fileutils.Matches(".dockerignore", excludes); rm == true {
<del> os.Remove(path.Join(b.contextPath, ".dockerignore"))
<add> os.Remove(filepath.Join(b.contextPath, ".dockerignore"))
<ide> b.context.(tarsum.BuilderContext).Remove(".dockerignore")
<ide> }
<ide> if rm, _ := fileutils.Matches(b.dockerfileName, excludes); rm == true {
<del> os.Remove(path.Join(b.contextPath, b.dockerfileName))
<add> os.Remove(filepath.Join(b.contextPath, b.dockerfileName))
<ide> b.context.(tarsum.BuilderContext).Remove(b.dockerfileName)
<ide> }
<ide>
<ide><path>integration-cli/docker_api_containers_test.go
<ide> func TestGetContainerStats(t *testing.T) {
<ide> }
<ide> logDone("container REST API - check GET containers/stats")
<ide> }
<add>
<add>func TestBuildApiDockerfilePath(t *testing.T) {
<add> // Test to make sure we stop people from trying to leave the
<add> // build context when specifying the path to the dockerfile
<add> buffer := new(bytes.Buffer)
<add> tw := tar.NewWriter(buffer)
<add> defer tw.Close()
<add>
<add> if err := tw.WriteHeader(&tar.Header{
<add> Name: "Dockerfile",
<add> Size: 11,
<add> }); err != nil {
<add> t.Fatalf("failed to write tar file header: %v", err)
<add> }
<add> if _, err := tw.Write([]byte("FROM ubuntu")); err != nil {
<add> t.Fatalf("failed to write tar file content: %v", err)
<add> }
<add> if err := tw.Close(); err != nil {
<add> t.Fatalf("failed to close tar archive: %v", err)
<add> }
<add>
<add> out, err := sockRequestRaw("POST", "/build?dockerfile=../Dockerfile", buffer, "application/x-tar")
<add> if err == nil {
<add> t.Fatalf("Build was supposed to fail")
<add> }
<add>
<add> if !strings.Contains(string(out), "must be within the build context") {
<add> t.Fatalf("Didn't complain about leaving build context")
<add> }
<add>
<add> logDone("container REST API - check build w/bad Dockerfile path")
<add>}
<ide><path>integration-cli/docker_utils.go
<ide> func daemonHost() string {
<ide> }
<ide>
<ide> func sockRequest(method, endpoint string, data interface{}) ([]byte, error) {
<add> jsonData := bytes.NewBuffer(nil)
<add> if err := json.NewEncoder(jsonData).Encode(data); err != nil {
<add> return nil, err
<add> }
<add>
<add> return sockRequestRaw(method, endpoint, jsonData, "application/json")
<add>}
<add>
<add>func sockRequestRaw(method, endpoint string, data io.Reader, ct string) ([]byte, error) {
<ide> daemon := daemonHost()
<ide> daemonUrl, err := url.Parse(daemon)
<ide> if err != nil {
<ide> func sockRequest(method, endpoint string, data interface{}) ([]byte, error) {
<ide> client := httputil.NewClientConn(c, nil)
<ide> defer client.Close()
<ide>
<del> jsonData := bytes.NewBuffer(nil)
<del> if err := json.NewEncoder(jsonData).Encode(data); err != nil {
<del> return nil, err
<del> }
<del>
<del> req, err := http.NewRequest(method, endpoint, jsonData)
<del> req.Header.Set("Content-Type", "application/json")
<add> req, err := http.NewRequest(method, endpoint, data)
<ide> if err != nil {
<ide> return nil, fmt.Errorf("could not create new request: %v", err)
<ide> }
<ide>
<add> if ct == "" {
<add> ct = "application/json"
<add> }
<add> req.Header.Set("Content-Type", ct)
<add>
<ide> resp, err := client.Do(req)
<ide> if err != nil {
<ide> return nil, fmt.Errorf("could not perform request: %v", err) | 3 |
Ruby | Ruby | use another method to find jenkins pr | b3ed00b791b5e95519b3a59a578a09dd084c44ab | <ide><path>Library/Homebrew/dev-cmd/test-bot.rb
<ide> def diff_formulae(start_revision, end_revision, path, filter)
<ide> @url = ENV["ghprbPullLink"]
<ide> @hash = nil
<ide> test "git", "checkout", "origin/master"
<add> elsif ENV["GIT_BRANCH"] && ENV["GIT_URL"]
<add> %r{origin/pr/(\d+)/(merge|head)} =~ ENV["GIT_BRANCH"]
<add> pr = $1
<add> @url = "#{ENV["GIT_URL"]}/pull/#{pr}"
<add> @hash = nil
<ide> # Use Travis CI pull-request variables for pull request jobs.
<ide> elsif travis_pr
<ide> @url = "https://github.com/#{ENV["TRAVIS_REPO_SLUG"]}/pull/#{ENV["TRAVIS_PULL_REQUEST"]}" | 1 |
Javascript | Javascript | fix doc typo | 3218b6aaea40490d19c7891dfeb865802e1d1f6a | <ide><path>packages/rsvp/lib/main.js
<ide> define("rsvp/defer",
<ide>
<ide> deferred.resolve("Success!");
<ide>
<del> defered.promise.then(function(value){
<add> deferred.promise.then(function(value){
<ide> // value here is "Success!"
<ide> });
<ide> ``` | 1 |
Ruby | Ruby | add additional tests for | a31a44a266ad2e2ad2b9ce5aa56cd5e1d108d48a | <ide><path>actionpack/test/dispatch/routing_test.rb
<ide> def test_shorthand_route_with_dashes_in_path
<ide> assert_equal '/about-us/index', about_us_index_path
<ide> end
<ide>
<add> def test_resource_routes_with_dashes_in_path
<add> draw do
<add> resources :photos, only: [:show] do
<add> get 'user-favorites', on: :collection
<add> get 'preview-photo', on: :member
<add> get 'summary-text'
<add> end
<add> end
<add>
<add> get '/photos/user-favorites'
<add> assert_equal 'photos#user_favorites', @response.body
<add> assert_equal '/photos/user-favorites', user_favorites_photos_path
<add>
<add> get '/photos/1/preview-photo'
<add> assert_equal 'photos#preview_photo', @response.body
<add> assert_equal '/photos/1/preview-photo', preview_photo_photo_path('1')
<add>
<add> get '/photos/1/summary-text'
<add> assert_equal 'photos#summary_text', @response.body
<add> assert_equal '/photos/1/summary-text', photo_summary_text_path('1')
<add>
<add> get '/photos/1'
<add> assert_equal 'photos#show', @response.body
<add> assert_equal '/photos/1', photo_path('1')
<add> end
<add>
<ide> private
<ide>
<ide> def draw(&block) | 1 |
Javascript | Javascript | unify xform @enumerable edition | ced3ad465c50f0448427587403b6418a3f378299 | <ide><path>packages/ember-runtime/lib/mixins/enumerable.js
<ide> function iter(key, value) {
<ide>
<ide> /** @private */
<ide> function xform(target, method, params) {
<del> method.call(target, params[0], params[2], params[3]);
<add> var args = [].slice.call(params, 2);
<add> method.apply(target, args);
<ide> }
<ide>
<ide> /**
<ide> Ember.Enumerable = Ember.Mixin.create( /** @lends Ember.Enumerable */ {
<ide>
<ide> Ember.propertyWillChange(this, '[]');
<ide> if (hasDelta) Ember.propertyWillChange(this, 'length');
<del> Ember.sendEvent(this, '@enumerable:before', removing, adding);
<add> Ember.sendEvent(this, '@enumerable:before', this, removing, adding);
<ide>
<ide> return this;
<ide> },
<ide> Ember.Enumerable = Ember.Mixin.create( /** @lends Ember.Enumerable */ {
<ide> if (removing === -1) removing = null;
<ide> if (adding === -1) adding = null;
<ide>
<del> Ember.sendEvent(this, '@enumerable:change', removing, adding);
<add> Ember.sendEvent(this, '@enumerable:change', this, removing, adding);
<ide> if (hasDelta) Ember.propertyDidChange(this, 'length');
<ide> Ember.propertyDidChange(this, '[]');
<ide> | 1 |
Ruby | Ruby | move oldest_cpu to hardware | 159b9d8e2dd08ab4ad913e56669e961a7767b3d9 | <ide><path>Library/Homebrew/extend/ENV.rb
<ide> def set_cpu_flags flags, default, map = {}
<ide> append flags, xarch unless xarch.empty?
<ide>
<ide> if ARGV.build_bottle?
<del> append flags, Hardware::CPU.optimization_flags[MacOS.oldest_cpu]
<add> append flags, Hardware::CPU.optimization_flags[Hardware.oldest_cpu]
<ide> else
<ide> # Don't set -msse3 and older flags because -march does that for us
<ide> append flags, map.fetch(Hardware::CPU.family, default)
<ide><path>Library/Homebrew/hardware.rb
<ide> def self.cores_as_words
<ide> Hardware.processor_count
<ide> end
<ide> end
<add>
<add> def self.oldest_cpu
<add> if Hardware::CPU.type == :intel
<add> if Hardware::CPU.is_64_bit?
<add> :core2
<add> else
<add> :core
<add> end
<add> else
<add> Hardware::CPU.family
<add> end
<add> end
<ide> end
<ide><path>Library/Homebrew/macos.rb
<ide> def uncached_cat
<ide> end
<ide> end
<ide>
<del> def oldest_cpu
<del> if Hardware::CPU.type == :intel
<del> if Hardware::CPU.is_64_bit?
<del> :core2
<del> else
<del> :core
<del> end
<del> else
<del> Hardware::CPU.family
<del> end
<del> end
<del>
<ide> def locate tool
<ide> # Don't call tools (cc, make, strip, etc.) directly!
<ide> # Give the name of the binary you look for as a string to this method | 3 |
PHP | PHP | update doc blocks | 6ce10b28c92226252bb414511dcb64b72c9bf95f | <ide><path>lib/Cake/Model/Datasource/DboSource.php
<ide> public function getVersion() {
<ide> * Returns a quoted and escaped string of $data for use in an SQL statement.
<ide> *
<ide> * @param string $data String to be prepared for use in an SQL statement
<del> * @param string $column The column into which this data will be inserted
<add> * @param string $column The column datatype into which this data will be inserted.
<ide> * @return string Quoted and escaped data
<ide> */
<ide> public function value($data, $column = null) { | 1 |
Text | Text | add two more protocol attacks | 6648cdcca99bfd48876460a840b1b3ac919db8b2 | <ide><path>guide/english/security/cyberattacks/index.md
<ide> no one can be 100% that their data is secure.
<ide> * Cross-Site Scripting (XSS)
<ide> * Password Attacks
<ide> * Denial of Service Attacks (DoS)
<del>* Man in the Middle (MITM)
<add>* Man in the Middle (MITM)
<add>* False Data Injection
<add>* Replay Attack
<ide> * Credential Reuse
<ide> * Rogue Software
<ide> * ARP Poisoning (Network Pentest) | 1 |
PHP | PHP | apply fixes from styleci | be631a66933c99f599ca2bd88c61b21ff0a059b3 | <ide><path>config/mail.php
<ide> 'username' => env('MAIL_USERNAME'),
<ide>
<ide> 'password' => env('MAIL_PASSWORD'),
<del>
<add>
<ide> /*
<ide> |--------------------------------------------------------------------------
<ide> | Sendmail System Path
<ide> | been provided here, which will work well on most of your systems.
<ide> |
<ide> */
<del>
<add>
<ide> 'sendmail' => '/usr/sbin/sendmail -bs',
<ide>
<ide> /* | 1 |
Javascript | Javascript | update hints path to forum | 7bc6367d684a7ea9a6eca7df5aaab7be29eac0c6 | <ide><path>client/src/templates/Challenges/utils/index.js
<del>const guideBase = '/guide/certifications';
<add>const guideBase = 'https://www.freecodecamp.org/forum/search?q=';
<ide>
<ide> export function createGuideUrl(slug = '') {
<del> return guideBase + slug.replace(/^\/learn\//, '/');
<add> return (
<add> guideBase +
<add> slug.substring(slug.lastIndexOf('/') + 1) +
<add> '%20%40camperbot%20%23guide'
<add> );
<ide> }
<ide>
<ide> export function isGoodXHRStatus(status) { | 1 |
Text | Text | titleize header [ci skip] | 93e154ac2c632d689d1624176544395ad6a54230 | <ide><path>guides/source/action_controller_overview.md
<ide> class AdminsController < ApplicationController
<ide> before_action :authenticate
<ide>
<ide> private
<del>
<ide> def authenticate
<ide> authenticate_or_request_with_http_digest do |username|
<ide> USERS[username]
<ide> end
<ide>
<ide> As seen in the example above, the `authenticate_or_request_with_http_digest` block takes only one argument - the username. And the block returns the password. Returning `false` or `nil` from the `authenticate_or_request_with_http_digest` will cause authentication failure.
<ide>
<del>### HTTP Token authentication
<add>### HTTP Token Authentication
<ide>
<ide> HTTP token authentication is a scheme to enable the usage of Bearer tokens in the HTTP `Authorization` header. There are many token formats available and describing them is outside the scope of this document.
<ide>
<ide> class PostsController < ApplicationController
<ide> before_action :authenticate
<ide>
<ide> private
<del>
<ide> def authenticate
<ide> authenticate_or_request_with_http_token do |token, options|
<ide> ActiveSupport::SecurityUtils.secure_compare(token, TOKEN)
<ide> class ClientsController < ApplicationController
<ide> end
<ide>
<ide> private
<del>
<ide> def generate_pdf(client)
<ide> Prawn::Document.new do
<ide> text client.name, align: :center
<ide> class ApplicationController < ActionController::Base
<ide> rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
<ide>
<ide> private
<del>
<ide> def record_not_found
<ide> render plain: "404 Not Found", status: 404
<ide> end
<ide> class ApplicationController < ActionController::Base
<ide> rescue_from User::NotAuthorized, with: :user_not_authorized
<ide>
<ide> private
<del>
<ide> def user_not_authorized
<ide> flash[:error] = "You don't have access to this section."
<ide> redirect_back(fallback_location: root_path)
<ide> class ClientsController < ApplicationController
<ide> end
<ide>
<ide> private
<del>
<ide> # If the user is not authorized, just throw the exception.
<ide> def check_authorization
<ide> raise User::NotAuthorized unless current_user.admin? | 1 |
Go | Go | fix docker run -a stderr | 3ba279a3705b3417fea36e8d2eb7d54e95d60fad | <ide><path>commands.go
<ide> func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
<ide> defer term.RestoreTerminal(cli.terminalFd, oldState)
<ide> }
<ide>
<del> if stdout != nil {
<add> if stdout != nil || stderr != nil {
<ide> receiveStdout = utils.Go(func() (err error) {
<ide> defer func() {
<ide> if in != nil {
<ide> func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
<ide> return nil
<ide> })
<ide>
<del> if stdout != nil {
<add> if stdout != nil || stderr != nil {
<ide> if err := <-receiveStdout; err != nil {
<ide> utils.Errorf("Error receiveStdout: %s", err)
<ide> return err | 1 |
Javascript | Javascript | add minimal example to actionsheet | bbc3f603f1c06a4e1368990a76ee35d9371a5d02 | <ide><path>Libraries/ActionSheetIOS/ActionSheetIOS.js
<ide> var ActionSheetIOS = {
<ide> *
<ide> * The 'callback' function takes one parameter, the zero-based index
<ide> * of the selected item.
<add> *
<add> * Minimal example:
<add> *
<add> * ```
<add> * ActionSheetIOS.showActionSheetWithOptions({
<add> * options: ['Remove', 'Cancel'],
<add> * destructiveButtonIndex: 1,
<add> * cancelButtonIndex: 0,
<add> * },
<add> * (buttonIndex) => {
<add> * if (buttonIndex === 1) { // destructive action }
<add> * });
<add> * ```
<add> *
<ide> */
<ide> showActionSheetWithOptions(options: Object, callback: Function) {
<ide> invariant( | 1 |
Java | Java | update unprocessableentity to allow body | 0524a82c09689fab901e4718058f8c68f132d52a | <ide><path>spring-web/src/main/java/org/springframework/http/ResponseEntity.java
<ide> public static HeadersBuilder<?> notFound() {
<ide> * @return the created builder
<ide> * @since 4.1.3
<ide> */
<del> public static HeadersBuilder<?> unprocessableEntity() {
<add> public static BodyBuilder unprocessableEntity() {
<ide> return status(HttpStatus.UNPROCESSABLE_ENTITY);
<ide> }
<ide>
<ide><path>spring-web/src/test/java/org/springframework/http/ResponseEntityTests.java
<ide> public void notFound() throws URISyntaxException {
<ide>
<ide> @Test
<ide> public void unprocessableEntity() throws URISyntaxException {
<del> ResponseEntity<Void> responseEntity = ResponseEntity.unprocessableEntity().build();
<add> ResponseEntity<String> responseEntity = ResponseEntity.unprocessableEntity().body("error");
<ide>
<ide> assertNotNull(responseEntity);
<ide> assertEquals(HttpStatus.UNPROCESSABLE_ENTITY, responseEntity.getStatusCode());
<del> assertNull(responseEntity.getBody());
<add> assertEquals("error", responseEntity.getBody());
<ide> }
<ide>
<ide> @Test | 2 |
Javascript | Javascript | expose transition id | 553bd4e36b48151b05e524fa8eb29c21f3f9e32e | <ide><path>d3.js
<ide> function d3_selection_transition() {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups);
<add> return d3_transition(subgroups, d3_transitionInheritId || ++d3_transitionId);
<ide> }
<del>function d3_transition(groups) {
<add>function d3_transition(groups, id) {
<ide> d3_arraySubclass(groups, d3_transitionPrototype);
<ide>
<del> var id = d3_transitionInheritId || ++d3_transitionId,
<del> tweens = {},
<add> var tweens = {},
<ide> event = d3.dispatch("start", "end"),
<ide> ease = d3_transitionEase;
<ide>
<add> groups.id = id;
<add>
<ide> groups.tween = function(name, tween) {
<ide> if (arguments.length < 2) return tweens[name];
<ide> if (tween == null) delete tweens[name];
<ide> function d3_transition_select(selector) {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups).ease(this.ease());
<add> return d3_transition(subgroups, this.id).ease(this.ease());
<ide> }
<ide> function d3_transition_selectAll(selector) {
<ide> var subgroups = [],
<ide> function d3_transition_selectAll(selector) {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups).ease(this.ease());
<add> return d3_transition(subgroups, this.id).ease(this.ease());
<ide> }
<ide> function d3_transition_attr(name, value) {
<ide> return this.attrTween(name, d3_transitionTween(value));
<ide><path>d3.min.js
<del>(function(){function dj(){return"circle"}function di(){return 64}function dh(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(dg<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();dg=!e.f&&!e.e,d.remove()}dg?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function df(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cr;return[c*Math.cos(d),c*Math.sin(d)]}}function de(a){return[a.x,a.y]}function dd(a){return a.endAngle}function dc(a){return a.startAngle}function db(a){return a.radius}function da(a){return a.target}function c_(a){return a.source}function c$(a){return function(b,c){return a[c][1]}}function cZ(a){return function(b,c){return a[c][0]}}function cY(a){function i(f){if(f.length<1)return null;var i=cy(this,f,b,d),j=cy(this,f,b===c?cZ(i):c,d===e?c$(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=cz,c=cz,d=0,e=cA,f="linear",g=cB[f],h=.7;i.x=function(a){if(!arguments.length)return c;b=c=a;return i},i.x0=function(a){if(!arguments.length)return b;b=a;return i},i.x1=function(a){if(!arguments.length)return c;c=a;return i},i.y=function(a){if(!arguments.length)return e;d=e=a;return i},i.y0=function(a){if(!arguments.length)return d;d=a;return i},i.y1=function(a){if(!arguments.length)return e;e=a;return i},i.interpolate=function(a){if(!arguments.length)return f;g=cB[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cX(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cr,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cW(a){return a.length<3?cC(a):a[0]+cI(a,cV(a))}function cV(a){var b=[],c,d,e,f,g=cU(a),h=-1,i=a.length-1;while(++h<i)c=cT(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cU(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cT(e,f);while(++b<c)d[b]=g+(g=cT(e=f,f=a[b+1]));d[b]=g;return d}function cT(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cS(a,b,c){a.push("C",cO(cP,b),",",cO(cP,c),",",cO(cQ,b),",",cO(cQ,c),",",cO(cR,b),",",cO(cR,c))}function cO(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cN(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cK(a)}function cM(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cO(cR,g),",",cO(cR,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cS(b,g,h);return b.join("")}function cL(a){if(a.length<4)return cC(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cO(cR,f)+","+cO(cR,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cS(b,f,g);return b.join("")}function cK(a){if(a.length<3)return cC(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),cS(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);return b.join("")}function cJ(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cI(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cC(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cH(a,b,c){return a.length<3?cC(a):a[0]+cI(a,cJ(a,b))}function cG(a,b){return a.length<3?cC(a):a[0]+cI((a.push(a[0]),a),cJ([a[a.length-2]].concat(a,[a[1]]),b))}function cF(a,b){return a.length<4?cC(a):a[1]+cI(a.slice(1,a.length-1),cJ(a,b))}function cE(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function cD(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function cC(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function cA(a){return a[1]}function cz(a){return a[0]}function cy(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function cx(a){function g(d){return d.length<1?null:"M"+e(a(cy(this,d,b,c)),f)}var b=cz,c=cA,d="linear",e=cB[d],f=.7;g.x=function(a){if(!arguments.length)return b;b=a;return g},g.y=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=cB[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function cw(a){return a.endAngle}function cv(a){return a.startAngle}function cu(a){return a.outerRadius}function ct(a){return a.innerRadius}function cq(a,b,c){function g(){d=c.length/(b-a),e=c.length-1;return f}function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}var d,e;f.domain=function(c){if(!arguments.length)return[a,b];a=+c[0],b=+c[c.length-1];return g()},f.range=function(a){if(!arguments.length)return c;c=a;return g()},f.copy=function(){return cq(a,b,c)};return g()}function cp(a,b){function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}var c;e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending);return d()},e.range=function(a){if(!arguments.length)return b;b=a;return d()},e.quantiles=function(){return c},e.copy=function(){return cp(a,b)};return d()}function ck(a,b,c){function f(c){return d[((a[c]||(a[c]=++b))-1)%d.length]}var d,e;f.domain=function(d){if(!arguments.length)return d3.keys(a);a={},b=0;var e=-1,g=d.length,h;while(++e<g)a[h=d[e]]||(a[h]=++b);return f[c.t](c.x,c.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,c={t:"range",x:a};return f},f.rangePoints=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b-1+g);d=b<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,c={t:"rangePoints",x:a,p:g};return f},f.rangeBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b+g);d=d3.range(h+j*g,i,j),e=j*(1-g),c={t:"rangeBands",x:a,p:g};return f},f.rangeRoundBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=Math.floor((i-h)/(b+g)),k=i-h-(b-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),c={t:"rangeRoundBands",x:a,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){var d={},e;for(e in a)d[e]=a[e];return ck(d,b,c)};return f[c.t](c.x,c.p)}function cj(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function ci(a,b){function e(b){return a(c(b))}var c=cj(b),d=cj(1/b);e.invert=function(b){return d(a.invert(b))},e.domain=function(b){if(!arguments.length)return a.domain().map(d);a.domain(b.map(c));return e},e.ticks=function(a){return ca(e.domain(),a)},e.tickFormat=function(a){return cb(e.domain(),a)},e.nice=function(){return e.domain(bW(e.domain(),b$))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=cj(b=a),d=cj(1/b);return e.domain(f)},e.copy=function(){return ci(a.copy(),b)};return bZ(e,a)}function ch(a){return a.toPrecision(1)}function cg(a){return-Math.log(-a)/Math.LN10}function cf(a){return Math.log(a)/Math.LN10}function ce(a,b){function d(c){return a(b(c))}var c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=e[0]<0?cg:cf,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(bW(a.domain(),bX));return d},d.ticks=function(){var d=bV(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===cg){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return ch},d.copy=function(){return ce(a.copy(),b)};return bZ(d,a)}function cd(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function cc(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(b_(a,b)[2])/Math.LN10+.01))+"f")}function ca(a,b){return d3.range.apply(d3,b_(a,b))}function b_(a,b){var c=bV(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e;return c}function b$(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bZ(a,b){a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp);return a}function bY(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?cc:cd,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(b){return ca(a,b)},h.tickFormat=function(b){return cb(a,b)},h.nice=function(){bW(a,b$);return g()},h.copy=function(){return bY(a,b,c,d)};return g()}function bX(){return Math}function bW(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bV(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bU(){}function bS(){var a=null,b=bO,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bO=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bR(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bS()-b;d>24?(isFinite(d)&&(clearTimeout(bQ),bQ=setTimeout(bR,d)),bP=0):(bP=1,bT(bR))}function bN(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function bM(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))}function bL(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))}function bK(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})}function bJ(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})}function bI(a,b,c){arguments.length<3&&(c=null);return this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}})}function bH(a,b,c){arguments.length<3&&(c=null);return this.styleTween(a,by(b),c)}function bG(a,b){function d(c,d){var e=b.call(this,c,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function c(c,d){var e=b.call(this,c,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}a=d3.ns.qualify(a);return this.tween("attr."+a,a.local?d:c)}function bF(a,b){return this.attrTween(a,by(b))}function bE(a){var b=[],c,d;typeof a!="function"&&(a=$(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h]){b.push(c=a(d.node));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bx(b).ease(this.ease())}function bD(a){var b=[],c,d,e;typeof a!="function"&&(a=Y(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a(e.node))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bx(b).ease(this.ease())}function by(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function bx(a){e(a,bz);var b=bB||++bA,c={},d=d3.dispatch("start","end"),f=bC;a.tween=function(b,d){if(arguments.length<2)return c[b];d==null?delete c[b]:c[b]=d;return a},a.ease=function(b){if(!arguments.length)return f;f=typeof b=="function"?b:d3.ease.apply(d3,arguments);return a},a.each=function(b,c){if(arguments.length<2)return bN.call(a,b);d[b].add(c);return a},d3.timer(function(e){a.each(function(g,h,i){function p(a){if(n.active!==b)return!0;var c=Math.min(1,(a-l)/m),e=f(c),i=j.length;while(--i>=0)j[i].call(k,e);if(c===1){n.active=0,n.owner===b&&delete k.__transition__,bB=b,d.end.dispatch.call(k,g,h),bB=0;return!0}}function o(a){if(n.active<=b){n.active=b,d.start.dispatch.call(k,g,h);for(var e in c)(e=c[e].call(k,g,h))&&j.push(e);l-=a,d3.timer(p)}return!0}var j=[],k=this,l=a[i][h].delay-e,m=a[i][h].duration,n=k.__transition__;n?n.owner<b&&(n.owner=b):n=k.__transition__={active:0,owner:b},l<=0?o(0):d3.timer(o,l)});return!0});return a}function bw(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bx(a)}function bv(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null}function bu(){return!this.node()}function bt(a){a.apply(this,(arguments[0]=this,arguments));return this}function bs(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this}function br(a,b,c){arguments.length<3&&(c=!1);var d=a.indexOf("."),e=d===-1?a:a.substring(0,d),f="__on"+a;return this.each(function(a,d){function h(a){var c=d3.event;d3.event=a;try{b.call(this,g.__data__,d)}finally{d3.event=c}}this[f]&&this.removeEventListener(e,this[f],c),b&&this.addEventListener(e,this[f]=h,c);var g=this})}function bq(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bp(a){a=bq.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this}function bo(a){return this.each(function(){this.__data__=a.apply(this,arguments)})}function bn(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return S(b)}function bm(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a(f.parentNode)),d.__data__=g.__data__):c.push(null)}return S(b)}function bk(a){e(a,bl);return a}function bj(a){return{__data__:a}}function bi(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bj(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bj(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bj(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=S(d);j.enter=function(){return bk(c)},j.exit=function(){return S(e)};return j}function bh(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})}function bg(a,b){function d(c){return c.insertBefore(document.createElementNS(a.space,a.local),U(b,c))}function c(c){return c.insertBefore(document.createElement(a),U(b,c))}a=d3.ns.qualify(a);return this.select(a.local?d:c)}function bf(a){function c(b){return b.appendChild(document.createElementNS(a.space,a.local))}function b(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)}function be(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})}function bd(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})}function bc(a,b){function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}function d(){this[a]=b}function c(){delete this[a]}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)}function bb(a,b,c){function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}function e(){this.style.setProperty(a,b,c)}function d(){this.style.removeProperty(a)}arguments.length<3&&(c="");return arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)}function ba(a,b){function i(){(b.apply(this,arguments)?f:g).call(this)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=h(e.replace(c," ")),d?b.baseVal=e:this.className=e}function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=h(e+" "+a),d?b.baseVal=e:this.className=e)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;c.lastIndex=0;return c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)}function _(a,b){function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function g(){this.setAttributeNS(a.space,a.local,b)}function f(){this.setAttribute(a,b)}function e(){this.removeAttributeNS(a.space,a.local)}function d(){this.removeAttribute(a)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)}function $(a){return function(b){return V(a,b)}}function Z(a){var b=[],c,d;typeof a!="function"&&(a=$(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h])b.push(c=a(d)),c.parentNode=d;return S(b)}function Y(a){return function(b){return U(a,b)}}function X(a){var b=[],c,d,e,f;typeof a!="function"&&(a=Y(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a(f)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return S(b)}function S(a){e(a,T);return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return Math.pow(2,10*(a-1))}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function g(a){return a==null}function f(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.29.6"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}var e=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,f),c=Array(b);++a<b;)for(var d=-1,e,g=c[a]=Array(e);++d<e;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,h=a.length;arguments.length<2&&(b=g);while(++f<h)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,Math.min(20,b-c)))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in N||/^(#|rgb\(|hsl\()/.test(b):b instanceof I||b instanceof Q)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff"
<del>,aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"},d3.select=function(a){return typeof a=="string"?W.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?W.selectAll(b):S([a(b)])};var T=[];T.select=X,T.selectAll=Z,T.attr=_,T.classed=ba,T.style=bb,T.property=bc,T.text=bd,T.html=be,T.append=bf,T.insert=bg,T.remove=bh,T.data=bi,T.filter=bn,T.map=bo,T.sort=bp,T.on=br,T.transition=bw,T.each=bs,T.call=bt,T.empty=bu,T.node=bv;var U=function(a,b){return b.querySelector(a)},V=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(U=function(a,b){return Sizzle(a,b)[0]},V=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var W=S([[document]]);W[0].parentNode=document.documentElement;var bl=[];bl.select=bm,bl.append=bf,bl.insert=bg,bl.empty=bu;var bz=[],bA=0,bB=0,bC=d3.ease("cubic-in-out");bz.select=bD,bz.selectAll=bE,bz.attr=bF,bz.attrTween=bG,bz.style=bH,bz.styleTween=bI,bz.text=bJ,bz.remove=bK,bz.delay=bL,bz.duration=bM,bz.call=bt,d3.transition=function(){return W.transition()};var bO=null,bP,bQ;d3.timer=function(a,b){var c=Date.now(),d=!1,e,f=bO;if(arguments.length<2)b=0;else if(!isFinite(b))return;while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bO={callback:a,then:c,delay:b,next:bO}),bP||(bQ=clearTimeout(bQ),bP=1,bT(bR))},d3.timer.flush=function(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bS()};var bT=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bY([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return ce(d3.scale.linear(),cf)},cf.pow=function(a){return Math.pow(10,a)},cg.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return ci(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ck({},0,{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cl)},d3.scale.category20=function(){return d3.scale.ordinal().range(cm)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(co)};var cl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cm=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],co=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cp([],[])},d3.scale.quantize=function(){return cq(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+cr,h=d.apply(this,arguments)+cr,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=cs?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ct,b=cu,c=cv,d=cw;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cr;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var cr=-Math.PI/2,cs=2*Math.PI-1e-6;d3.svg.line=function(){return cx(Object)};var cB={linear:cC,"step-before":cD,"step-after":cE,basis:cK,"basis-open":cL,"basis-closed":cM,bundle:cN,cardinal:cH,"cardinal-open":cF,"cardinal-closed":cG,monotone:cW},cP=[0,2/3,1/3,0],cQ=[0,1/3,2/3,0],cR=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cx(cX);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cY(Object)},d3.svg.area.radial=function(){var a=cY(cX);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cr,k=e.call(a,h,g)+cr;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=c_,b=da,c=db,d=cv,e=cw;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=c_,b=da,c=de;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=de,c=a.projection;a.projection=function(a){return arguments.length?c(df(b=a)):b};return a},d3.svg.mouse=function(a){return dh(a,d3.event)};var dg=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=dh(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(dk[a.call(this,c,d)]||dk.circle)(b.call(this,c,d))}var a=dj,b=di;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var dk={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dm)),c=b*dm;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(dk);var dl=Math.sqrt(3),dm=Math.tan(30*Math.PI/180)})()
<ide>\ No newline at end of file
<add>(function(){function dj(){return"circle"}function di(){return 64}function dh(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(dg<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();dg=!e.f&&!e.e,d.remove()}dg?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function df(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cr;return[c*Math.cos(d),c*Math.sin(d)]}}function de(a){return[a.x,a.y]}function dd(a){return a.endAngle}function dc(a){return a.startAngle}function db(a){return a.radius}function da(a){return a.target}function c_(a){return a.source}function c$(a){return function(b,c){return a[c][1]}}function cZ(a){return function(b,c){return a[c][0]}}function cY(a){function i(f){if(f.length<1)return null;var i=cy(this,f,b,d),j=cy(this,f,b===c?cZ(i):c,d===e?c$(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=cz,c=cz,d=0,e=cA,f="linear",g=cB[f],h=.7;i.x=function(a){if(!arguments.length)return c;b=c=a;return i},i.x0=function(a){if(!arguments.length)return b;b=a;return i},i.x1=function(a){if(!arguments.length)return c;c=a;return i},i.y=function(a){if(!arguments.length)return e;d=e=a;return i},i.y0=function(a){if(!arguments.length)return d;d=a;return i},i.y1=function(a){if(!arguments.length)return e;e=a;return i},i.interpolate=function(a){if(!arguments.length)return f;g=cB[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cX(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cr,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cW(a){return a.length<3?cC(a):a[0]+cI(a,cV(a))}function cV(a){var b=[],c,d,e,f,g=cU(a),h=-1,i=a.length-1;while(++h<i)c=cT(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cU(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cT(e,f);while(++b<c)d[b]=g+(g=cT(e=f,f=a[b+1]));d[b]=g;return d}function cT(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cS(a,b,c){a.push("C",cO(cP,b),",",cO(cP,c),",",cO(cQ,b),",",cO(cQ,c),",",cO(cR,b),",",cO(cR,c))}function cO(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cN(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cK(a)}function cM(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cO(cR,g),",",cO(cR,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cS(b,g,h);return b.join("")}function cL(a){if(a.length<4)return cC(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cO(cR,f)+","+cO(cR,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cS(b,f,g);return b.join("")}function cK(a){if(a.length<3)return cC(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),cS(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);return b.join("")}function cJ(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cI(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cC(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cH(a,b,c){return a.length<3?cC(a):a[0]+cI(a,cJ(a,b))}function cG(a,b){return a.length<3?cC(a):a[0]+cI((a.push(a[0]),a),cJ([a[a.length-2]].concat(a,[a[1]]),b))}function cF(a,b){return a.length<4?cC(a):a[1]+cI(a.slice(1,a.length-1),cJ(a,b))}function cE(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function cD(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function cC(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function cA(a){return a[1]}function cz(a){return a[0]}function cy(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function cx(a){function g(d){return d.length<1?null:"M"+e(a(cy(this,d,b,c)),f)}var b=cz,c=cA,d="linear",e=cB[d],f=.7;g.x=function(a){if(!arguments.length)return b;b=a;return g},g.y=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=cB[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function cw(a){return a.endAngle}function cv(a){return a.startAngle}function cu(a){return a.outerRadius}function ct(a){return a.innerRadius}function cq(a,b,c){function g(){d=c.length/(b-a),e=c.length-1;return f}function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}var d,e;f.domain=function(c){if(!arguments.length)return[a,b];a=+c[0],b=+c[c.length-1];return g()},f.range=function(a){if(!arguments.length)return c;c=a;return g()},f.copy=function(){return cq(a,b,c)};return g()}function cp(a,b){function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}var c;e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending);return d()},e.range=function(a){if(!arguments.length)return b;b=a;return d()},e.quantiles=function(){return c},e.copy=function(){return cp(a,b)};return d()}function ck(a,b,c){function f(c){return d[((a[c]||(a[c]=++b))-1)%d.length]}var d,e;f.domain=function(d){if(!arguments.length)return d3.keys(a);a={},b=0;var e=-1,g=d.length,h;while(++e<g)a[h=d[e]]||(a[h]=++b);return f[c.t](c.x,c.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,c={t:"range",x:a};return f},f.rangePoints=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b-1+g);d=b<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,c={t:"rangePoints",x:a,p:g};return f},f.rangeBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b+g);d=d3.range(h+j*g,i,j),e=j*(1-g),c={t:"rangeBands",x:a,p:g};return f},f.rangeRoundBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=Math.floor((i-h)/(b+g)),k=i-h-(b-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),c={t:"rangeRoundBands",x:a,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){var d={},e;for(e in a)d[e]=a[e];return ck(d,b,c)};return f[c.t](c.x,c.p)}function cj(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function ci(a,b){function e(b){return a(c(b))}var c=cj(b),d=cj(1/b);e.invert=function(b){return d(a.invert(b))},e.domain=function(b){if(!arguments.length)return a.domain().map(d);a.domain(b.map(c));return e},e.ticks=function(a){return ca(e.domain(),a)},e.tickFormat=function(a){return cb(e.domain(),a)},e.nice=function(){return e.domain(bW(e.domain(),b$))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=cj(b=a),d=cj(1/b);return e.domain(f)},e.copy=function(){return ci(a.copy(),b)};return bZ(e,a)}function ch(a){return a.toPrecision(1)}function cg(a){return-Math.log(-a)/Math.LN10}function cf(a){return Math.log(a)/Math.LN10}function ce(a,b){function d(c){return a(b(c))}var c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=e[0]<0?cg:cf,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(bW(a.domain(),bX));return d},d.ticks=function(){var d=bV(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===cg){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return ch},d.copy=function(){return ce(a.copy(),b)};return bZ(d,a)}function cd(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function cc(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(b_(a,b)[2])/Math.LN10+.01))+"f")}function ca(a,b){return d3.range.apply(d3,b_(a,b))}function b_(a,b){var c=bV(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e;return c}function b$(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bZ(a,b){a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp);return a}function bY(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?cc:cd,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(b){return ca(a,b)},h.tickFormat=function(b){return cb(a,b)},h.nice=function(){bW(a,b$);return g()},h.copy=function(){return bY(a,b,c,d)};return g()}function bX(){return Math}function bW(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bV(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bU(){}function bS(){var a=null,b=bO,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bO=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bR(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bS()-b;d>24?(isFinite(d)&&(clearTimeout(bQ),bQ=setTimeout(bR,d)),bP=0):(bP=1,bT(bR))}function bN(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function bM(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))}function bL(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))}function bK(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})}function bJ(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})}function bI(a,b,c){arguments.length<3&&(c=null);return this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}})}function bH(a,b,c){arguments.length<3&&(c=null);return this.styleTween(a,by(b),c)}function bG(a,b){function d(c,d){var e=b.call(this,c,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function c(c,d){var e=b.call(this,c,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}a=d3.ns.qualify(a);return this.tween("attr."+a,a.local?d:c)}function bF(a,b){return this.attrTween(a,by(b))}function bE(a){var b=[],c,d;typeof a!="function"&&(a=$(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h]){b.push(c=a(d.node));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bx(b,this.id).ease(this.ease())}function bD(a){var b=[],c,d,e;typeof a!="function"&&(a=Y(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a(e.node))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bx(b,this.id).ease(this.ease())}function by(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function bx(a,b){e(a,bz);var c={},d=d3.dispatch("start","end"),f=bC;a.id=b,a.tween=function(b,d){if(arguments.length<2)return c[b];d==null?delete c[b]:c[b]=d;return a},a.ease=function(b){if(!arguments.length)return f;f=typeof b=="function"?b:d3.ease.apply(d3,arguments);return a},a.each=function(b,c){if(arguments.length<2)return bN.call(a,b);d[b].add(c);return a},d3.timer(function(e){a.each(function(g,h,i){function p(a){if(n.active!==b)return!0;var c=Math.min(1,(a-l)/m),e=f(c),i=j.length;while(--i>=0)j[i].call(k,e);if(c===1){n.active=0,n.owner===b&&delete k.__transition__,bB=b,d.end.dispatch.call(k,g,h),bB=0;return!0}}function o(a){if(n.active<=b){n.active=b,d.start.dispatch.call(k,g,h);for(var e in c)(e=c[e].call(k,g,h))&&j.push(e);l-=a,d3.timer(p)}return!0}var j=[],k=this,l=a[i][h].delay-e,m=a[i][h].duration,n=k.__transition__;n?n.owner<b&&(n.owner=b):n=k.__transition__={active:0,owner:b},l<=0?o(0):d3.timer(o,l)});return!0});return a}function bw(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bx(a,bB||++bA)}function bv(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null}function bu(){return!this.node()}function bt(a){a.apply(this,(arguments[0]=this,arguments));return this}function bs(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this}function br(a,b,c){arguments.length<3&&(c=!1);var d=a.indexOf("."),e=d===-1?a:a.substring(0,d),f="__on"+a;return this.each(function(a,d){function h(a){var c=d3.event;d3.event=a;try{b.call(this,g.__data__,d)}finally{d3.event=c}}this[f]&&this.removeEventListener(e,this[f],c),b&&this.addEventListener(e,this[f]=h,c);var g=this})}function bq(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bp(a){a=bq.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this}function bo(a){return this.each(function(){this.__data__=a.apply(this,arguments)})}function bn(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return S(b)}function bm(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a(f.parentNode)),d.__data__=g.__data__):c.push(null)}return S(b)}function bk(a){e(a,bl);return a}function bj(a){return{__data__:a}}function bi(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bj(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bj(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bj(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=S(d);j.enter=function(){return bk(c)},j.exit=function(){return S(e)};return j}function bh(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})}function bg(a,b){function d(c){return c.insertBefore(document.createElementNS(a.space,a.local),U(b,c))}function c(c){return c.insertBefore(document.createElement(a),U(b,c))}a=d3.ns.qualify(a);return this.select(a.local?d:c)}function bf(a){function c(b){return b.appendChild(document.createElementNS(a.space,a.local))}function b(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)}function be(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})}function bd(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})}function bc(a,b){function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}function d(){this[a]=b}function c(){delete this[a]}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)}function bb(a,b,c){function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}function e(){this.style.setProperty(a,b,c)}function d(){this.style.removeProperty(a)}arguments.length<3&&(c="");return arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)}function ba(a,b){function i(){(b.apply(this,arguments)?f:g).call(this)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=h(e.replace(c," ")),d?b.baseVal=e:this.className=e}function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=h(e+" "+a),d?b.baseVal=e:this.className=e)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;c.lastIndex=0;return c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)}function _(a,b){function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function g(){this.setAttributeNS(a.space,a.local,b)}function f(){this.setAttribute(a,b)}function e(){this.removeAttributeNS(a.space,a.local)}function d(){this.removeAttribute(a)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)}function $(a){return function(b){return V(a,b)}}function Z(a){var b=[],c,d;typeof a!="function"&&(a=$(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h])b.push(c=a(d)),c.parentNode=d;return S(b)}function Y(a){return function(b){return U(a,b)}}function X(a){var b=[],c,d,e,f;typeof a!="function"&&(a=Y(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a(f)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return S(b)}function S(a){e(a,T);return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return Math.pow(2,10*(a-1))}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function g(a){return a==null}function f(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.29.6"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}var e=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,f),c=Array(b);++a<b;)for(var d=-1,e,g=c[a]=Array(e);++d<e;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,h=a.length;arguments.length<2&&(b=g);while(++f<h)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,Math.min(20,b-c)))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in N||/^(#|rgb\(|hsl\()/.test(b):b instanceof I||b instanceof Q)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={aliceblue:"#f0f8ff",antiquewhite
<add>:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"},d3.select=function(a){return typeof a=="string"?W.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?W.selectAll(b):S([a(b)])};var T=[];T.select=X,T.selectAll=Z,T.attr=_,T.classed=ba,T.style=bb,T.property=bc,T.text=bd,T.html=be,T.append=bf,T.insert=bg,T.remove=bh,T.data=bi,T.filter=bn,T.map=bo,T.sort=bp,T.on=br,T.transition=bw,T.each=bs,T.call=bt,T.empty=bu,T.node=bv;var U=function(a,b){return b.querySelector(a)},V=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(U=function(a,b){return Sizzle(a,b)[0]},V=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var W=S([[document]]);W[0].parentNode=document.documentElement;var bl=[];bl.select=bm,bl.append=bf,bl.insert=bg,bl.empty=bu;var bz=[],bA=0,bB=0,bC=d3.ease("cubic-in-out");bz.select=bD,bz.selectAll=bE,bz.attr=bF,bz.attrTween=bG,bz.style=bH,bz.styleTween=bI,bz.text=bJ,bz.remove=bK,bz.delay=bL,bz.duration=bM,bz.call=bt,d3.transition=function(){return W.transition()};var bO=null,bP,bQ;d3.timer=function(a,b){var c=Date.now(),d=!1,e,f=bO;if(arguments.length<2)b=0;else if(!isFinite(b))return;while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bO={callback:a,then:c,delay:b,next:bO}),bP||(bQ=clearTimeout(bQ),bP=1,bT(bR))},d3.timer.flush=function(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bS()};var bT=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bY([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return ce(d3.scale.linear(),cf)},cf.pow=function(a){return Math.pow(10,a)},cg.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return ci(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ck({},0,{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cl)},d3.scale.category20=function(){return d3.scale.ordinal().range(cm)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(co)};var cl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cm=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],co=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cp([],[])},d3.scale.quantize=function(){return cq(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+cr,h=d.apply(this,arguments)+cr,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=cs?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ct,b=cu,c=cv,d=cw;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cr;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var cr=-Math.PI/2,cs=2*Math.PI-1e-6;d3.svg.line=function(){return cx(Object)};var cB={linear:cC,"step-before":cD,"step-after":cE,basis:cK,"basis-open":cL,"basis-closed":cM,bundle:cN,cardinal:cH,"cardinal-open":cF,"cardinal-closed":cG,monotone:cW},cP=[0,2/3,1/3,0],cQ=[0,1/3,2/3,0],cR=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cx(cX);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cY(Object)},d3.svg.area.radial=function(){var a=cY(cX);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cr,k=e.call(a,h,g)+cr;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=c_,b=da,c=db,d=cv,e=cw;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=c_,b=da,c=de;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=de,c=a.projection;a.projection=function(a){return arguments.length?c(df(b=a)):b};return a},d3.svg.mouse=function(a){return dh(a,d3.event)};var dg=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=dh(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(dk[a.call(this,c,d)]||dk.circle)(b.call(this,c,d))}var a=dj,b=di;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var dk={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dm)),c=b*dm;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(dk);var dl=Math.sqrt(3),dm=Math.tan(30*Math.PI/180)})()
<ide>\ No newline at end of file
<ide><path>src/core/selection-transition.js
<ide> function d3_selection_transition() {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups);
<add> return d3_transition(subgroups, d3_transitionInheritId || ++d3_transitionId);
<ide> }
<ide><path>src/core/transition-select.js
<ide> function d3_transition_select(selector) {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups).ease(this.ease());
<add> return d3_transition(subgroups, this.id).ease(this.ease());
<ide> }
<ide><path>src/core/transition-selectAll.js
<ide> function d3_transition_selectAll(selector) {
<ide> }
<ide> }
<ide>
<del> return d3_transition(subgroups).ease(this.ease());
<add> return d3_transition(subgroups, this.id).ease(this.ease());
<ide> }
<ide><path>src/core/transition.js
<del>function d3_transition(groups) {
<add>function d3_transition(groups, id) {
<ide> d3_arraySubclass(groups, d3_transitionPrototype);
<ide>
<del> var id = d3_transitionInheritId || ++d3_transitionId,
<del> tweens = {},
<add> var tweens = {},
<ide> event = d3.dispatch("start", "end"),
<ide> ease = d3_transitionEase;
<ide>
<add> groups.id = id;
<add>
<ide> groups.tween = function(name, tween) {
<ide> if (arguments.length < 2) return tweens[name];
<ide> if (tween == null) delete tweens[name];
<ide><path>test/core/transition-test-each.js
<ide> module.exports = {
<ide> context: context,
<ide> data: data,
<ide> index: index,
<del> count: count
<add> count: count,
<add> id: transition.id
<ide> });
<ide> });
<ide> },
<ide> module.exports = {
<ide> },
<ide>
<ide> "sets an exclusive lock on transitioning nodes": function(result) {
<del> var id = result.selection[0][0].__transition__.owner;
<add> var id = result.id;
<ide> assert.isTrue(id > 0);
<ide> assert.equal(result.selection[0][0].__transition__.owner, id);
<ide> assert.equal(result.selection[0][1].__transition__.owner, id);
<ide> module.exports = {
<ide> data = [],
<ide> index = [],
<ide> count = [],
<del> delay = [],
<del> id;
<del>
<del> // A callback to grab the transition id.
<del> transition.each("start", function() {
<del> id = this.__transition__.active;
<del> });
<add> delay = [];
<ide>
<ide> // A callback to verify that multiple callbacks are allowed.
<ide> transition.each("end", function() {
<ide> module.exports = {
<ide> data: data,
<ide> index: index,
<ide> count: count,
<del> id: id
<add> id: transition.id
<ide> });
<ide> });
<ide> },
<ide><path>test/core/transition-test-id.js
<add>require("../env");
<add>require("../../d3");
<add>
<add>var assert = require("assert");
<add>
<add>module.exports = {
<add> topic: function() {
<add> return d3.select("body").append("div").transition();
<add> },
<add> "has a positive integer id": function(transition) {
<add> var id = transition.id;
<add> assert.isTrue(id > 0);
<add> assert.equal(~~id, id);
<add> },
<add> "increases monotonically across transitions": function(transition) {
<add> var t0 = d3.select("body").append("div").transition(),
<add> t1 = d3.select("body").append("div").transition();
<add> assert.isTrue(t1.id > t0.id);
<add> }
<add>};
<ide><path>test/core/transition-test-select.js
<ide> module.exports = {
<ide> "returns null if no match is found": function(transition) {
<ide> var t = transition.select("span");
<ide> assert.isNull(t[0][0]);
<add> },
<add> "inherits transition id": function(transition) {
<add> var id = transition.id,
<add> t0 = transition.select("span"),
<add> t1 = transition.select("span");
<add> assert.equal(t0.id, id);
<add> assert.equal(t1.id, id);
<ide> }
<ide> };
<ide><path>test/core/transition-test-selectAll.js
<ide> module.exports = {
<ide> "returns empty if no match is found": function(transition) {
<ide> var t = transition.selectAll("span");
<ide> assert.isEmpty(t[0]);
<add> },
<add> "inherits transition id": function(transition) {
<add> var id = transition.id,
<add> t0 = transition.selectAll("span"),
<add> t1 = transition.selectAll("span");
<add> assert.equal(t0.id, id);
<add> assert.equal(t1.id, id);
<ide> }
<ide> };
<ide><path>test/core/transition-test.js
<ide> suite.addBatch({
<ide> // Control
<ide> "each": require("./transition-test-each"),
<ide> "call": require("./transition-test-call"),
<del> "tween": require("./transition-test-tween")
<add> "tween": require("./transition-test-tween"),
<add> "id": require("./transition-test-id")
<ide>
<ide> });
<ide> | 11 |
Text | Text | correct small typo | 62a5d8ad08d0181c2243d7febe66b4d336cf133d | <ide><path>guides/source/asset_pipeline.md
<ide> above. By default Rails assumes assets have been precompiled and will be
<ide> served as static assets by your web server.
<ide>
<ide> During the precompilation phase an MD5 is generated from the contents of the
<del>compiled files, and inserted into the filenames as they are written to disc.
<add>compiled files, and inserted into the filenames as they are written to disk.
<ide> These fingerprinted names are used by the Rails helpers in place of the manifest
<ide> name.
<ide> | 1 |
Ruby | Ruby | add fetch_artifact api | 5b1d0786a45e69b4af1d71d433cc11bb676fd6b6 | <ide><path>Library/Homebrew/utils/github.rb
<ide> # frozen_string_literal: true
<ide>
<del>require "uri"
<add>require "download_strategy"
<ide> require "tempfile"
<add>require "uri"
<ide>
<ide> module GitHub
<ide> module_function
<ide> def dispatch_event(user, repo, event, **payload)
<ide> scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)
<ide> end
<ide>
<add> def fetch_artifact(user, repo, pr, dir, workflow_id: "tests.yml", artifact_name: "bottles")
<add> base_url = "#{API_URL}/repos/#{user}/#{repo}"
<add> pr_payload = open_api("#{base_url}/pulls/#{pr}")
<add> pr_sha = pr_payload["head"]["sha"]
<add> pr_branch = pr_payload["head"]["ref"]
<add>
<add> workflow = open_api("#{base_url}/actions/workflows/#{workflow_id}/runs?branch=#{pr_branch}")
<add> workflow_run = workflow["workflow_runs"].select do |run|
<add> run["head_sha"] == pr_sha
<add> end
<add>
<add> if workflow_run.empty?
<add> raise Error, <<~EOS
<add> No matching workflow run found for these criteria!
<add> Commit SHA: #{pr_sha}
<add> Branch ref: #{pr_branch}
<add> Pull request: #{pr}
<add> Workflow: #{workflow_id}
<add> EOS
<add> end
<add>
<add> status = workflow_run.first["status"].sub("_", " ")
<add> if status != "completed"
<add> raise Error, <<~EOS
<add> The newest workflow run for ##{pr} is still #{status}!
<add> #{Formatter.url workflow_run.first["html_url"]}
<add> EOS
<add> end
<add>
<add> artifacts = open_api(workflow_run.first["artifacts_url"])
<add>
<add> artifact = artifacts["artifacts"].select do |art|
<add> art["name"] == artifact_name
<add> end
<add>
<add> if artifact.empty?
<add> raise Error, <<~EOS
<add> No artifact with the name `#{artifact_name}` was found!
<add> #{Formatter.url workflow_run.first["html_url"]}
<add> EOS
<add> end
<add>
<add> artifact_url = artifact.first["archive_download_url"]
<add>
<add> token, username = api_credentials
<add> case api_credentials_type
<add> when :env_username_password, :keychain_username_password
<add> curl_args = { user: "#{username}:#{token}" }
<add> when :env_token
<add> curl_args = { header: "Authorization: token #{token}" }
<add> end
<add>
<add> # Download the artifact as a zip file and unpack it into `dir`. This is
<add> # preferred over system `curl` and `tar` as this leverages the Homebrew
<add> # cache to avoid repeated downloads of (possibly large) bottles.
<add> FileUtils.chdir dir do
<add> curl_args[:cache] = Pathname.new(dir)
<add> curl_args[:secrets] = [token]
<add> downloader = CurlDownloadStrategy.new(artifact_url, "artifact", pr, **curl_args)
<add> downloader.fetch
<add> downloader.stage
<add> end
<add> end
<add>
<ide> def api_errors
<ide> [GitHub::AuthenticationFailedError, GitHub::HTTPNotFoundError,
<ide> GitHub::RateLimitExceededError, GitHub::Error, JSON::ParserError].freeze | 1 |
PHP | PHP | marshal empty string to null for booltype | 04e06e5fcccac30f50ed1c5370147f68ce360fe8 | <ide><path>src/Database/Type/BoolType.php
<ide> public function toStatement($value, Driver $driver): int
<ide> */
<ide> public function marshal($value): ?bool
<ide> {
<del> if ($value === null) {
<add> if ($value === null || $value === '') {
<ide> return null;
<ide> }
<ide>
<ide><path>tests/TestCase/Database/Type/BoolTypeTest.php
<ide> public function testMarshal()
<ide> $this->assertFalse($this->type->marshal('0'));
<ide> $this->assertFalse($this->type->marshal(0));
<ide> $this->assertFalse($this->type->marshal('off'));
<del> $this->assertFalse($this->type->marshal(''));
<add> $this->assertNull($this->type->marshal(''));
<ide> $this->assertNull($this->type->marshal('not empty'));
<ide> $this->assertNull($this->type->marshal(['2', '3']));
<ide> } | 2 |
PHP | PHP | remove unneeded check | c7c3a3dcb5104b42630bf23447bc4e86f276e289 | <ide><path>src/Controller/ControllerFactory.php
<ide> class ControllerFactory implements ControllerFactoryInterface
<ide> * @param \Psr\Http\Message\ServerRequestInterface $request The request to build a controller for.
<ide> * @return \Cake\Controller\Controller
<ide> * @throws \Cake\Http\Exception\MissingControllerException
<del> * @throws \ReflectionException
<ide> */
<ide> public function create(ServerRequestInterface $request): Controller
<ide> {
<ide> $className = $this->getControllerClass($request);
<del> if (!$className) {
<add> if ($className === null) {
<ide> $this->missingController($request);
<ide> }
<add>
<ide> /** @var string $className */
<ide> $reflection = new ReflectionClass($className);
<del> if ($reflection->isAbstract() || $reflection->isInterface()) {
<add> if ($reflection->isAbstract()) {
<ide> $this->missingController($request);
<ide> }
<ide> | 1 |
Python | Python | fix comment typo | 9ebb7ac0e1b3cc3d1c5a1c67683cce57cc780543 | <ide><path>celery/utils/dispatch/signal.py
<ide> class Signal(object): # pragma: no cover
<ide>
<ide> .. attribute:: receivers
<ide> Internal attribute, holds a dictionary of
<del> `{receriverkey (id): weakref(receiver)}` mappings.
<add> `{receiverkey (id): weakref(receiver)}` mappings.
<ide>
<ide> """
<ide> | 1 |
Go | Go | move "images -viz" to client | 2a5998baf172f94a8d6866e46207a0d7d75e70e5 | <ide><path>api.go
<ide> func getImagesJSON(srv *Server, version float64, w http.ResponseWriter, r *http.
<ide> }
<ide> }
<ide>
<del>func getImagesViz(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
<del> if err := srv.ImagesViz(w); err != nil {
<del> return err
<del> }
<del> return nil
<del>}
<del>
<ide> func getInfo(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
<ide> return writeJSON(w, http.StatusOK, srv.DockerInfo())
<ide> }
<ide> func createRouter(srv *Server, logging bool) (*mux.Router, error) {
<ide> "/info": getInfo,
<ide> "/version": getVersion,
<ide> "/images/json": getImagesJSON,
<del> "/images/viz": getImagesViz,
<ide> "/images/search": getImagesSearch,
<ide> "/images/{name:.*}/history": getImagesHistory,
<ide> "/images/{name:.*}/json": getImagesByName,
<ide><path>commands.go
<ide> func (cli *DockerCli) CmdImages(args ...string) error {
<ide> }
<ide>
<ide> if *flViz {
<del> body, _, err := cli.call("GET", "/images/viz", false)
<add> body, _, err := cli.call("GET", "/images/json?all=1", nil)
<ide> if err != nil {
<ide> return err
<ide> }
<del> fmt.Fprintf(cli.out, "%s", body)
<add>
<add> var outs []APIImages
<add> err = json.Unmarshal(body, &outs)
<add> if err != nil {
<add> return err
<add> }
<add>
<add> fmt.Fprintf(cli.out, "digraph docker {\n")
<add>
<add> for _, image := range outs {
<add> if image.ParentId == "" {
<add> fmt.Fprintf(cli.out, " base -> \"%s\" [style=invis]\n", utils.TruncateID(image.ID))
<add> } else {
<add> fmt.Fprintf(cli.out, " \"%s\" -> \"%s\"\n", utils.TruncateID(image.ParentId), utils.TruncateID(image.ID))
<add> }
<add> if image.RepoTags[0] != "<none>:<none>" {
<add> fmt.Fprintf(cli.out, " \"%s\" [label=\"%s\\n%s\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n", utils.TruncateID(image.ID), utils.TruncateID(image.ID), strings.Join(image.RepoTags, "\\n"))
<add> }
<add> }
<add>
<add> fmt.Fprintf(cli.out, " base [style=invisible]\n}\n")
<ide> } else {
<ide> v := url.Values{}
<ide> if cmd.NArg() == 1 {
<ide><path>server.go
<ide> func (srv *Server) ImageInsert(name, url, path string, out io.Writer, sf *utils.
<ide> return img.ShortID(), nil
<ide> }
<ide>
<del>func (srv *Server) ImagesViz(out io.Writer) error {
<del> images, _ := srv.runtime.graph.Map()
<del> if images == nil {
<del> return nil
<del> }
<del> out.Write([]byte("digraph docker {\n"))
<del>
<del> var (
<del> parentImage *Image
<del> err error
<del> )
<del> for _, image := range images {
<del> parentImage, err = image.GetParent()
<del> if err != nil {
<del> return err
<del> }
<del> if parentImage != nil {
<del> out.Write([]byte(" \"" + parentImage.ShortID() + "\" -> \"" + image.ShortID() + "\"\n"))
<del> } else {
<del> out.Write([]byte(" base -> \"" + image.ShortID() + "\" [style=invis]\n"))
<del> }
<del> }
<del>
<del> reporefs := make(map[string][]string)
<del>
<del> for name, repository := range srv.runtime.repositories.Repositories {
<del> for tag, id := range repository {
<del> reporefs[utils.TruncateID(id)] = append(reporefs[utils.TruncateID(id)], fmt.Sprintf("%s:%s", name, tag))
<del> }
<del> }
<del>
<del> for id, repos := range reporefs {
<del> out.Write([]byte(" \"" + id + "\" [label=\"" + id + "\\n" + strings.Join(repos, "\\n") + "\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n"))
<del> }
<del> out.Write([]byte(" base [style=invisible]\n}\n"))
<del> return nil
<del>}
<del>
<ide> func (srv *Server) Images(all bool, filter string) ([]APIImages, error) {
<ide> var (
<ide> allImages map[string]*Image
<ide> func (srv *Server) Images(all bool, filter string) ([]APIImages, error) {
<ide> for _, image := range allImages {
<ide> var out APIImages
<ide> out.ID = image.ID
<add> out.ParentId = image.Parent
<ide> out.RepoTags = []string{"<none>:<none>"}
<ide> out.Created = image.Created.Unix()
<ide> out.Size = image.Size | 3 |
Ruby | Ruby | do nothing if no args | 7ed76725c4c1b4871cb085709f737af52ffd5188 | <ide><path>Library/Homebrew/cmd/uses.rb
<ide>
<ide> module Homebrew extend self
<ide> def uses
<add> return if ARGV.formulae.empty?
<add>
<ide> uses = Formula.all.select do |f|
<ide> ARGV.formulae.all? do |ff|
<ide> # For each formula given, show which other formulas depend on it.
<ide> # We only go one level up, ie. direct dependencies.
<ide> f.deps.include? ff.name
<ide> end
<ide> end
<add>
<ide> if ARGV.include? "--installed"
<ide> uses = uses.select do |f|
<ide> keg = HOMEBREW_CELLAR/f
<ide> keg.directory? and not keg.subdirs.empty?
<ide> end
<ide> end
<add>
<ide> puts_columns uses.map{|f| f.to_s}.sort
<ide> end
<ide> end | 1 |
Javascript | Javascript | fix iterations for takewhile | d3f05e52a717f37dc9ad35ef35de20708f0287e4 | <ide><path>dist/Immutable.js
<ide> var $Sequence = Sequence;
<ide> }
<ide> var iterations = 0;
<ide> sequence.__iterate((function(v, k, c) {
<del> if (predicate.call(thisArg, v, k, c) && fn(v, k, $__0) !== false) {
<del> iterations++;
<del> } else {
<del> return false;
<del> }
<add> return predicate.call(thisArg, v, k, c) && ++iterations && fn(v, k, $__0);
<ide> }));
<ide> return iterations;
<ide> };
<ide><path>dist/Immutable.min.js
<ide> if(h&&!c)return t;if(n>0){var f=t&&t.array[o],_=ue(f,e,n-we,r,u,s);return _===f?
<ide> return t.__ownerID?(t.length=h.length,t._map=h,t._vector=o,t.__hash=void 0,t):_e(h,o)}function ve(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function ge(t,e){return e?pe(e,t,"",{"":t}):me(t)}function pe(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,Pe(e).map(function(n,r){return pe(t,n,r,e)})):e}function me(t){if(t){if(Array.isArray(t))return Pe(t).map(me).toVector();if(t.constructor===Object)return Pe(t).map(me).toMap()}return t}var de=Object,ye={};ye.createClass=t,ye.superCall=e,ye.defaultSuperCall=n;var we=5,Se=1<<we,Ie=Se-1,ke={},Me={value:!1},be={value:!1},qe={value:void 0,done:!1},De="delete",Oe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Ae=2147483647,xe=0,Ce="__immutablehash__";"undefined"!=typeof Symbol&&(Ce=Symbol(Ce));var Ee=!1,je=16,Ue=255,Re=0,We={},Pe=function(t){return Je.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},Je=Pe;ye.createClass(Pe,{toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e},__toStringMapper:function(t,e){return e+": "+A(t)},toJS:function(){return this.map(function(t){return t instanceof Je?t.toJS():t}).__toJS()},toArray:function(){E(this.length);var t=Array(this.length||0);return this.valueSeq().forEach(function(e,n){t[n]=e}),t},toObject:function(){E(this.length);var t={};return this.forEach(function(e,n){t[n]=e}),t},toVector:function(){return E(this.length),fn.from(this)},toMap:function(){return E(this.length),Te.from(this)},toOrderedMap:function(){return E(this.length),In.from(this)},toSet:function(){return E(this.length),dn.from(this)},toKeyedSeq:function(){return this},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,n){return t+(c(e)^(e===n?0:c(n)))&Ae},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof Je))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0
<ide> }return null!=this.__hash&&null!=t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t)},__deepEquals:function(t){var e=this.cacheResult().entrySeq().toArray(),n=0;return t.every(function(t,r){var i=e[n++];return P(r,i[0])&&P(t,i[1])})},join:function(t){t=void 0!==t?""+t:",";var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=null!=r?r:""):e+=t+(null!=r?r:"")}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(k)),this.length)},countBy:function(t){var e=this;return In.empty().withMutations(function(n){e.forEach(function(e,r,i){n.update(t(e,r,i),b)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return Je(t)})),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e){for(var r,i=0,u=n.length-1,s=0;u>=s&&!r;s++){var a=n[e?u-s:s];i+=a.__iterate(function(e,n,i){return t(e,n,i)===!1?(r=!0,!1):void 0},e)}return i},r},reverse:function(){var t=this,e=t.__makeSequence();return e.reverse=function(){return t},e.length=t.length,e.__iterateUncached=function(e,n){return t.__iterate(e,!n)},e},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var t=this,e=g(t);return e.length=t.length,e.__iterateUncached=function(e,n,r){var i,u=this,s=0;if(r){var a=this.length-1;i=function(t){return e(t,a-s++,u)!==!1}}else i=function(t){return e(t,s++,u)!==!1};return t.__iterate(i,n),s},e},entrySeq:function(){var t=this;if(t._cache)return Je(t._cache);var e=t.map(I).valueSeq();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,n){var r,i;return 2>arguments.length?i=!0:r=e,this.forEach(function(e,u,s){i?(i=!1,r=e):r=t.call(n,r,e,u,s)}),r},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},every:function(t,e){var n=!0;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?void 0:(n=!1,!1)}),n
<ide> },some:function(t,e){return!this.every(O(t),e)},first:function(){return this.find(k)},last:function(){return this.findLast(k)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,ke)!==ke},get:function(t,e){return this.find(function(e,n){return P(n,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?p(this,t,e,0):this},contains:function(t){return this.find(function(e){return P(e,t)},null,ke)!==ke},find:function(t,e,n){var r=n;return this.forEach(function(n,i,u){return t.call(e,n,i,u)?(r=n,!1):void 0}),r},findKey:function(t,e){var n;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?(n=i,!1):void 0}),n},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},flip:function(){var t=this,e=v();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e},map:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){var u=this;return n.__iterate(function(n,i,s){return r(t.call(e,n,i,s),i,u)!==!1},i)},r},mapKeys:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){var u=this;return n.__iterate(function(n,i,s){return r(n,t.call(e,i,n,s),u)!==!1},i)},r},filter:function(t,e){return q(this,t,e,!0)},slice:function(t,e){if(m(t,e,this.length))return this;var n=d(t,this.length),r=y(e,this.length);if(n!==n||r!==r)return this.entrySeq().slice(t,e).fromEntrySeq();var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(t){var e=this;if(t>e.length)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=0;return e.__iterate(function(e,r){return t>s&&++s&&n(e,r,u)}),s},n.length=this.length&&Math.min(this.length,t),n},takeLast:function(t){return this.reverse().take(t).reverse()
<del>},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&r(n,i,s)!==!1?void a++:!1}),a},r},takeUntil:function(t,e){return this.takeWhile(O(t),e)},skip:function(t){var e=this;if(0===t)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=!0,a=0,h=0;return e.__iterate(function(e,r){if(!s||!(s=h++<t)){if(n(e,r,u)===!1)return!1;a++}}),a},n.length=this.length&&Math.max(0,this.length-t),n},skipLast:function(t){return this.reverse().skip(t).reverse()},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=!0,h=0;return n.__iterate(function(n,i,u){if(!a||!(a=t.call(e,n,i,u))){if(r(n,i,s)===!1)return!1;h++}}),h},r},skipUntil:function(t,e){return this.skipWhile(O(t),e)},groupBy:function(t,e){return D(this,t,e,!0)},sort:function(t){return this.sortBy(S,t)},sortBy:function(t,e){e=e||x;var n=this;return Je(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(E(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e){var n=this._cache;if(n){for(var r=n.length-1,i=0;r>=i;i++){var u=n[e?r-i:i];if(t(u[1],u[0],this)===!1)break}return i}return this.__iterateUncached(t,e)},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Je)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ne(t);t=[t]}return new Fe(t)}});var ze=Pe.prototype;ze.toJSON=ze.toJS,ze.__toJS=ze.toObject,ze.inspect=ze.toSource=function(){return""+this};var Ke=function(){ye.defaultSuperCall(this,Be.prototype,arguments)},Be=Ke;
<del>ye.createClass(Ke,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){E(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,n){t[n]=e}),t},toKeyedSeq:function(){return new Ve(this)},valueSeq:function(){return this},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t){return t&&e(t[1],t[0],r)},n)},e},join:function(t){t=void 0!==t?""+t:",";var e="";return this.forEach(function(n,r){e+=(r?t:"")+(null!=n?n:"")}),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t),r=Pe(n).flatten();return r.length=n.reduce(function(t,e){if(void 0!==t){var n=Pe(e).length;if(null!=n)return t+n}},0),r},reverse:function(){var t=this,e=t.__makeSequence();return e.reverse=function(){return t},e.length=t.length,e.__reversedIndices=t.__reversedIndices,e.__iterateUncached=function(e,n,r){var i=this,u=r?this.length:0;return t.__iterate(function(t){return e(t,r?--u:u++,i)!==!1},!n)},e},filter:function(t,e){return q(this,t,e,!1)},get:function(t,e){return t=C(this,t),this.find(function(e,n){return n===t},null,e)},indexOf:function(t){return this.findIndex(function(e){return P(e,t)})},lastIndexOf:function(t){return this.toKeyedSeq().reverse().indexOf(t)},findIndex:function(t,e){var n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.toKeyedSeq().reverse().findIndex(t,e)},slice:function(t,e){var n=this;if(m(t,e,n.length))return n;var r=n.__makeSequence(),i=d(t,n.length),u=y(e,n.length);return r.length=n.length&&u-i,r.__reversedIndices=n.__reversedIndices,r.__iterateUncached=function(r,s,a){var h=this;if(s)return this.cacheResult().__iterate(r,s,a);var o=this.__reversedIndices^a;if(i!==i||u!==u||o&&null==n.length){var c=n.count();i=d(t,c),u=y(e,c)}var f=o?n.length-u:i,_=o?n.length-i:u,l=n.__iterate(function(t,e){return o?null!=_&&e>=_||e>=f&&r(t,e-f,h)!==!1:f>e||(null==_||_>e)&&r(t,e-f,h)!==!1},s,a);return null!=this.length?this.length:Math.max(0,l-f)
<del>},r},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=d(t,this.length);var r=this.slice(0,t);return 1===n?r:r.concat(s(arguments,2),this.slice(t+e))},flatten:function(){var t=this,e=this.__makeSequence();return e.__iterateUncached=function(e,n,r){var i=this,u=0,s=this.length-1;return t.__iterate(function(t){var a=!1;return Pe(t).__iterate(function(t){return e(t,r?s-u++:u++,i)===!1?(a=!0,!1):void 0},n),!a},n),u},e},flatMap:function(t,e){return this.map(t,e).flatten()},skip:function(t){var e=this;if(0===t)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=e.__reversedIndices^i,a=!0,h=0,o=0,c=e.__iterate(function(e,r){return a&&(a=o++<t,a||(h=r)),a||n(e,s?r:r-h,u)!==!1},r,i);return s?h+1:c-h},n.length=this.length&&Math.max(0,this.length-t),n},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=n.__reversedIndices^u,h=!0,o=0,c=n.__iterate(function(n,i,u){return h&&(h=t.call(e,n,i,u),h||(o=i)),h||r(n,a?i:i-o,s)!==!1},i,u);return a?o+1:c-o},r},groupBy:function(t,e){return D(this,t,e,!1)},sortBy:function(t,e){e=e||x;var n=this;return Pe(this.entrySeq().toArray().sort(function(r,i){return e(t(r[1],r[0],n),t(i[1],i[0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq()},__iterate:function(t,e,n){var r=this._cache;if(r){n^=e;for(var i=r.length-1,u=0;i>=u;u++){var s=r[e?i-u:u],a=s[0];if(t(s[1],n?i-a:a,this)===!1)break}return u}return n&&!this.length?this.cacheResult().__iterate(t,e,n):this.__iterateUncached(t,e,n)},__makeSequence:function(){return g(this)}},{},Pe);var Le=Ke.prototype;Le.__toJS=Le.toArray,Le.__toStringMapper=A,Le.chain=Le.flatMap;var Ve=function(t){this._seq=t,this.length=t.length};ye.createClass(Ve,{get:function(t,e){return this._seq.get(t,e)},has:function(t){return this._seq.has(t)},__iterate:function(t,e){return this._seq.__iterate(t,e,e)}},{},Pe);var Ne=function(t){var e=Object.keys(t);
<del>this._object=t,this._keys=e,this.length=e.length};ye.createClass(Ne,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},Pe);var Fe=function(t){this._array=t,this.length=t.length};ye.createClass(Fe,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[C(this,t)]:e},has:function(t){return t=C(this,t),t>=0&&this.length>t},__iterate:function(t,e,n){var r,i,u=this._array,s=u.length-1,a=e^n;for(r=0;s>=r;r++)if(i=s-r,t(u[e?i:r],n?i:r,u)===!1)return a?e?i:r:u.length;return u.length}},{},Ke);var Ge=function(){};ye.createClass(Ge,{toString:function(){return"[Iterator]"}},{});var He=Ge.prototype;He[Oe]=M,He.inspect=He.toSource=function(){return""+this};var Qe=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Pe?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};ye.createClass(Qe,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),ke);return n===ke?e:U(this,t,n)},set:function(t,e){return W(this,function(n){return n.set(t,e)},t)},remove:function(t){return W(this,function(e){return e.remove(t)},t)},clear:function(){return W(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?W(this,t):W(this,function(r){return r.update(t,e,n)},t)},withMutations:function(t){return W(this,function(e){return(e||Te.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:R(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(e,n,i){return t(U(r,n,e),n,i)},e,n):0}},{},Pe),Qe.prototype[De]=Qe.prototype.remove,Qe.prototype.getIn=Qe.prototype.get;var Te=function(t){var e=Xe.empty();return t?t.constructor===Xe?t:e.merge(t):e
<del>},Xe=Te;ye.createClass(Te,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return B(this,t,e)},remove:function(t){return B(this,t,ke)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),X(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe.empty()},merge:function(){return H(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return H(this,t,e)},mergeDeep:function(){return H(this,Q(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return H(this,Q(t),e)},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Qe(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new an(this,0)},values:function(){return new an(this,1)},entries:function(){return new an(this,2)},__iterator:function(t){return new an(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEquals:function(t){var e=this;return t.every(function(t,n){return P(e.get(n,ke),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?K(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return hn||(hn=K(0))}},Pe);var Ye=Te.prototype;Ye[De]=Ye.remove,Ye[Oe]=function(){return this.entries()},Te.from=Te;var Ze=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},$e=Ze;
<del>ye.createClass(Ze,{get:function(t,e,n,r){var i=1<<((0===t?e:e>>>t)&Ie),u=this.bitmap;return 0===(u&i)?r:this.nodes[Y(u&i-1)].get(t+we,e,n,r)},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Ie,h=1<<a,o=this.bitmap,c=0!==(o&h);if(!c&&i===ke)return this;var f=Y(o&h-1),_=this.nodes,l=c?_[f]:null,v=L(l,t,e+we,n,r,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=on)return G(t,_,o,a,v);if(c&&!v&&2===_.length&&V(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&V(v))return v;var g=t&&t===this.ownerID,p=c?v?o:o^h:o|h,m=c?v?Z(_,f,v,g):te(_,f,g):$(_,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new $e(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var tn=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},en=tn;ye.createClass(tn,{get:function(t,e,n,r){var i=(0===t?e:e>>>t)&Ie,u=this.nodes[i];return u?u.get(t+we,e,n,r):r},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Ie,h=i===ke,o=this.nodes,c=o[a];if(h&&!c)return this;var f=L(c,t,e+we,n,r,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,cn>_))return F(t,o,_,a)}else _++;var l=t&&t===this.ownerID,v=Z(o,a,f,l);return l?(this.count=_,this.nodes=v,this):new en(t,_,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];if(u&&u.iterate(t,e)===!1)return!1}}},{});var nn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},rn=nn;ye.createClass(nn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(P(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,h){var o=u===ke;if(n!==this.hash)return o?this:(i(h),i(a),N(this,t,e,n,[r,u]));for(var c=this.entries,f=0,_=c.length;_>f&&!P(r,c[f][0]);f++);var l=_>f;if(o&&!l)return this;if(i(h),(o||!l)&&i(a),o&&2===_)return new un(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return l?o?f===_-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new rn(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1
<del>}},{});var un=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},sn=un;ye.createClass(un,{get:function(t,e,n,r){return P(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var h=u===ke,o=P(r,this.entry[0]);return(o?u===this.entry[1]:h)?this:(i(a),h?(i(s),null):o?t&&t===this.ownerID?(this.entry[1]=u,this):new sn(t,n,[r,u]):(i(s),N(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var an=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&z(t._root)};ye.createClass(an,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return J(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return J(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return J(t,u.entry);e=this._stack=z(u,e)}continue}e=this._stack=this._stack.__prev}return h()}},{},Ge);var hn,on=Se/2,cn=Se/4,fn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return _n.from(t)},_n=fn;ye.createClass(fn,{toString:function(){return this.__toString("Vector [","]")},has:function(t){return t=C(this,t),t>=0&&this.length>t},get:function(t,e){if(t=C(this,t),0>t||t>=this.length)return e;t+=this._origin;var n=ae(this,t);return n&&n.array[t&Ie]},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){return ie(this,t,e)},remove:function(t){return ie(this,t,ke)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=we,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):_n.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){he(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return he(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){he(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return he(this,1)},merge:function(){return oe(this,null,arguments)
<del>},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return oe(this,t,e)},mergeDeep:function(){return oe(this,Q(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return oe(this,Q(t),e)},setLength:function(t){return he(this,0,t)},slice:function(t,e){var n=ye.superCall(this,_n.prototype,"slice",[t,e]);if(n!==this){var r=this,i=r.length;n.toVector=function(){return he(r,0>t?Math.max(0,i+t):i?Math.min(i,t):t,null==e?i:0>e?Math.max(0,i+e):i?Math.min(i,e):e)}}return n},keys:function(){return new pn(this,0)},values:function(){return new pn(this,1)},entries:function(){return new pn(this,2)},__iterator:function(t,e){return new pn(this,2,t,e)},__iterate:function(t,e,n){var r=this,i=0,u=r.length-1;n^=e;var s,a=function(e,s){return t(e,n?u-s:s,r)===!1?!1:(i=s,!0)},h=ce(this._size);return s=e?ee(this._tail,0,h-this._origin,this._size-this._origin,a,e)&&ee(this._root,this._level,-this._origin,h-this._origin,a,e):ee(this._root,this._level,-this._origin,h-this._origin,a,e)&&ee(this._tail,0,h-this._origin,this._size-this._origin,a,e),(s?u:e?u-i:i)+1},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&P(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?re(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return mn||(mn=re(0,0,we))},from:function(t){if(!t||0===t.length)return _n.empty();if(t.constructor===_n)return t;var e=Array.isArray(t);return t.length>0&&Se>t.length?re(0,t.length,we,null,new vn(e?s(t):Pe(t).toArray())):(e||(t=Pe(t),t instanceof Ke||(t=t.valueSeq())),_n.empty().merge(t))}},Ke);var ln=fn.prototype;ln[De]=ln.remove,ln[Oe]=ln.values,ln.update=Ye.update,ln.updateIn=Ye.updateIn,ln.cursor=Ye.cursor,ln.withMutations=Ye.withMutations,ln.asMutable=Ye.asMutable,ln.asImmutable=Ye.asImmutable,ln.wasAltered=Ye.wasAltered;var vn=function(t,e){this.array=t,this.ownerID=e},gn=vn;ye.createClass(vn,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;
<add>},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&++a&&r(n,i,s)}),a},r},takeUntil:function(t,e){return this.takeWhile(O(t),e)},skip:function(t){var e=this;if(0===t)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=!0,a=0,h=0;return e.__iterate(function(e,r){if(!s||!(s=h++<t)){if(n(e,r,u)===!1)return!1;a++}}),a},n.length=this.length&&Math.max(0,this.length-t),n},skipLast:function(t){return this.reverse().skip(t).reverse()},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=!0,h=0;return n.__iterate(function(n,i,u){if(!a||!(a=t.call(e,n,i,u))){if(r(n,i,s)===!1)return!1;h++}}),h},r},skipUntil:function(t,e){return this.skipWhile(O(t),e)},groupBy:function(t,e){return D(this,t,e,!0)},sort:function(t){return this.sortBy(S,t)},sortBy:function(t,e){e=e||x;var n=this;return Je(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(E(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e){var n=this._cache;if(n){for(var r=n.length-1,i=0;r>=i;i++){var u=n[e?r-i:i];if(t(u[1],u[0],this)===!1)break}return i}return this.__iterateUncached(t,e)},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Je)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ne(t);t=[t]}return new Fe(t)}});var ze=Pe.prototype;ze.toJSON=ze.toJS,ze.__toJS=ze.toObject,ze.inspect=ze.toSource=function(){return""+this};var Ke=function(){ye.defaultSuperCall(this,Be.prototype,arguments)},Be=Ke;ye.createClass(Ke,{toString:function(){return this.__toString("Seq [","]")
<add>},toArray:function(){E(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,n){t[n]=e}),t},toKeyedSeq:function(){return new Ve(this)},valueSeq:function(){return this},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t){return t&&e(t[1],t[0],r)},n)},e},join:function(t){t=void 0!==t?""+t:",";var e="";return this.forEach(function(n,r){e+=(r?t:"")+(null!=n?n:"")}),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t),r=Pe(n).flatten();return r.length=n.reduce(function(t,e){if(void 0!==t){var n=Pe(e).length;if(null!=n)return t+n}},0),r},reverse:function(){var t=this,e=t.__makeSequence();return e.reverse=function(){return t},e.length=t.length,e.__reversedIndices=t.__reversedIndices,e.__iterateUncached=function(e,n,r){var i=this,u=r?this.length:0;return t.__iterate(function(t){return e(t,r?--u:u++,i)!==!1},!n)},e},filter:function(t,e){return q(this,t,e,!1)},get:function(t,e){return t=C(this,t),this.find(function(e,n){return n===t},null,e)},indexOf:function(t){return this.findIndex(function(e){return P(e,t)})},lastIndexOf:function(t){return this.toKeyedSeq().reverse().indexOf(t)},findIndex:function(t,e){var n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.toKeyedSeq().reverse().findIndex(t,e)},slice:function(t,e){var n=this;if(m(t,e,n.length))return n;var r=n.__makeSequence(),i=d(t,n.length),u=y(e,n.length);return r.length=n.length&&u-i,r.__reversedIndices=n.__reversedIndices,r.__iterateUncached=function(r,s,a){var h=this;if(s)return this.cacheResult().__iterate(r,s,a);var o=this.__reversedIndices^a;if(i!==i||u!==u||o&&null==n.length){var c=n.count();i=d(t,c),u=y(e,c)}var f=o?n.length-u:i,_=o?n.length-i:u,l=n.__iterate(function(t,e){return o?null!=_&&e>=_||e>=f&&r(t,e-f,h)!==!1:f>e||(null==_||_>e)&&r(t,e-f,h)!==!1},s,a);return null!=this.length?this.length:Math.max(0,l-f)},r},splice:function(t,e){var n=arguments.length;
<add>if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=d(t,this.length);var r=this.slice(0,t);return 1===n?r:r.concat(s(arguments,2),this.slice(t+e))},flatten:function(){var t=this,e=this.__makeSequence();return e.__iterateUncached=function(e,n,r){var i=this,u=0,s=this.length-1;return t.__iterate(function(t){var a=!1;return Pe(t).__iterate(function(t){return e(t,r?s-u++:u++,i)===!1?(a=!0,!1):void 0},n),!a},n),u},e},flatMap:function(t,e){return this.map(t,e).flatten()},skip:function(t){var e=this;if(0===t)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=e.__reversedIndices^i,a=!0,h=0,o=0,c=e.__iterate(function(e,r){return a&&(a=o++<t,a||(h=r)),a||n(e,s?r:r-h,u)!==!1},r,i);return s?h+1:c-h},n.length=this.length&&Math.max(0,this.length-t),n},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=n.__reversedIndices^u,h=!0,o=0,c=n.__iterate(function(n,i,u){return h&&(h=t.call(e,n,i,u),h||(o=i)),h||r(n,a?i:i-o,s)!==!1},i,u);return a?o+1:c-o},r},groupBy:function(t,e){return D(this,t,e,!1)},sortBy:function(t,e){e=e||x;var n=this;return Pe(this.entrySeq().toArray().sort(function(r,i){return e(t(r[1],r[0],n),t(i[1],i[0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq()},__iterate:function(t,e,n){var r=this._cache;if(r){n^=e;for(var i=r.length-1,u=0;i>=u;u++){var s=r[e?i-u:u],a=s[0];if(t(s[1],n?i-a:a,this)===!1)break}return u}return n&&!this.length?this.cacheResult().__iterate(t,e,n):this.__iterateUncached(t,e,n)},__makeSequence:function(){return g(this)}},{},Pe);var Le=Ke.prototype;Le.__toJS=Le.toArray,Le.__toStringMapper=A,Le.chain=Le.flatMap;var Ve=function(t){this._seq=t,this.length=t.length};ye.createClass(Ve,{get:function(t,e){return this._seq.get(t,e)},has:function(t){return this._seq.has(t)},__iterate:function(t,e){return this._seq.__iterate(t,e,e)}},{},Pe);var Ne=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length
<add>};ye.createClass(Ne,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},Pe);var Fe=function(t){this._array=t,this.length=t.length};ye.createClass(Fe,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[C(this,t)]:e},has:function(t){return t=C(this,t),t>=0&&this.length>t},__iterate:function(t,e,n){var r,i,u=this._array,s=u.length-1,a=e^n;for(r=0;s>=r;r++)if(i=s-r,t(u[e?i:r],n?i:r,u)===!1)return a?e?i:r:u.length;return u.length}},{},Ke);var Ge=function(){};ye.createClass(Ge,{toString:function(){return"[Iterator]"}},{});var He=Ge.prototype;He[Oe]=M,He.inspect=He.toSource=function(){return""+this};var Qe=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Pe?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};ye.createClass(Qe,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),ke);return n===ke?e:U(this,t,n)},set:function(t,e){return W(this,function(n){return n.set(t,e)},t)},remove:function(t){return W(this,function(e){return e.remove(t)},t)},clear:function(){return W(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?W(this,t):W(this,function(r){return r.update(t,e,n)},t)},withMutations:function(t){return W(this,function(e){return(e||Te.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:R(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(e,n,i){return t(U(r,n,e),n,i)},e,n):0}},{},Pe),Qe.prototype[De]=Qe.prototype.remove,Qe.prototype.getIn=Qe.prototype.get;var Te=function(t){var e=Xe.empty();return t?t.constructor===Xe?t:e.merge(t):e},Xe=Te;ye.createClass(Te,{toString:function(){return this.__toString("Map {","}")
<add>},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return B(this,t,e)},remove:function(t){return B(this,t,ke)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),X(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe.empty()},merge:function(){return H(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return H(this,t,e)},mergeDeep:function(){return H(this,Q(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return H(this,Q(t),e)},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Qe(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new an(this,0)},values:function(){return new an(this,1)},entries:function(){return new an(this,2)},__iterator:function(t){return new an(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEquals:function(t){var e=this;return t.every(function(t,n){return P(e.get(n,ke),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?K(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return hn||(hn=K(0))}},Pe);var Ye=Te.prototype;Ye[De]=Ye.remove,Ye[Oe]=function(){return this.entries()},Te.from=Te;var Ze=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},$e=Ze;ye.createClass(Ze,{get:function(t,e,n,r){var i=1<<((0===t?e:e>>>t)&Ie),u=this.bitmap;
<add>return 0===(u&i)?r:this.nodes[Y(u&i-1)].get(t+we,e,n,r)},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Ie,h=1<<a,o=this.bitmap,c=0!==(o&h);if(!c&&i===ke)return this;var f=Y(o&h-1),_=this.nodes,l=c?_[f]:null,v=L(l,t,e+we,n,r,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=on)return G(t,_,o,a,v);if(c&&!v&&2===_.length&&V(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&V(v))return v;var g=t&&t===this.ownerID,p=c?v?o:o^h:o|h,m=c?v?Z(_,f,v,g):te(_,f,g):$(_,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new $e(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var tn=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},en=tn;ye.createClass(tn,{get:function(t,e,n,r){var i=(0===t?e:e>>>t)&Ie,u=this.nodes[i];return u?u.get(t+we,e,n,r):r},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Ie,h=i===ke,o=this.nodes,c=o[a];if(h&&!c)return this;var f=L(c,t,e+we,n,r,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,cn>_))return F(t,o,_,a)}else _++;var l=t&&t===this.ownerID,v=Z(o,a,f,l);return l?(this.count=_,this.nodes=v,this):new en(t,_,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];if(u&&u.iterate(t,e)===!1)return!1}}},{});var nn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},rn=nn;ye.createClass(nn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(P(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,h){var o=u===ke;if(n!==this.hash)return o?this:(i(h),i(a),N(this,t,e,n,[r,u]));for(var c=this.entries,f=0,_=c.length;_>f&&!P(r,c[f][0]);f++);var l=_>f;if(o&&!l)return this;if(i(h),(o||!l)&&i(a),o&&2===_)return new un(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return l?o?f===_-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new rn(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1}},{});var un=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n
<add>},sn=un;ye.createClass(un,{get:function(t,e,n,r){return P(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var h=u===ke,o=P(r,this.entry[0]);return(o?u===this.entry[1]:h)?this:(i(a),h?(i(s),null):o?t&&t===this.ownerID?(this.entry[1]=u,this):new sn(t,n,[r,u]):(i(s),N(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var an=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&z(t._root)};ye.createClass(an,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return J(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return J(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return J(t,u.entry);e=this._stack=z(u,e)}continue}e=this._stack=this._stack.__prev}return h()}},{},Ge);var hn,on=Se/2,cn=Se/4,fn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return _n.from(t)},_n=fn;ye.createClass(fn,{toString:function(){return this.__toString("Vector [","]")},has:function(t){return t=C(this,t),t>=0&&this.length>t},get:function(t,e){if(t=C(this,t),0>t||t>=this.length)return e;t+=this._origin;var n=ae(this,t);return n&&n.array[t&Ie]},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){return ie(this,t,e)},remove:function(t){return ie(this,t,ke)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=we,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):_n.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){he(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return he(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){he(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return he(this,1)},merge:function(){return oe(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];
<add>return oe(this,t,e)},mergeDeep:function(){return oe(this,Q(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return oe(this,Q(t),e)},setLength:function(t){return he(this,0,t)},slice:function(t,e){var n=ye.superCall(this,_n.prototype,"slice",[t,e]);if(n!==this){var r=this,i=r.length;n.toVector=function(){return he(r,0>t?Math.max(0,i+t):i?Math.min(i,t):t,null==e?i:0>e?Math.max(0,i+e):i?Math.min(i,e):e)}}return n},keys:function(){return new pn(this,0)},values:function(){return new pn(this,1)},entries:function(){return new pn(this,2)},__iterator:function(t,e){return new pn(this,2,t,e)},__iterate:function(t,e,n){var r=this,i=0,u=r.length-1;n^=e;var s,a=function(e,s){return t(e,n?u-s:s,r)===!1?!1:(i=s,!0)},h=ce(this._size);return s=e?ee(this._tail,0,h-this._origin,this._size-this._origin,a,e)&&ee(this._root,this._level,-this._origin,h-this._origin,a,e):ee(this._root,this._level,-this._origin,h-this._origin,a,e)&&ee(this._tail,0,h-this._origin,this._size-this._origin,a,e),(s?u:e?u-i:i)+1},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&P(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?re(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return mn||(mn=re(0,0,we))},from:function(t){if(!t||0===t.length)return _n.empty();if(t.constructor===_n)return t;var e=Array.isArray(t);return t.length>0&&Se>t.length?re(0,t.length,we,null,new vn(e?s(t):Pe(t).toArray())):(e||(t=Pe(t),t instanceof Ke||(t=t.valueSeq())),_n.empty().merge(t))}},Ke);var ln=fn.prototype;ln[De]=ln.remove,ln[Oe]=ln.values,ln.update=Ye.update,ln.updateIn=Ye.updateIn,ln.cursor=Ye.cursor,ln.withMutations=Ye.withMutations,ln.asMutable=Ye.asMutable,ln.asImmutable=Ye.asImmutable,ln.wasAltered=Ye.wasAltered;var vn=function(t,e){this.array=t,this.ownerID=e},gn=vn;ye.createClass(vn,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;
<ide> var r=n>>>e&Ie;if(r>=this.array.length)return new gn([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-we,n),i===s&&u)return this}if(u&&!i)return this;var a=se(this,t);if(!u)for(var h=0;r>h;h++)a.array[h]=void 0;return i&&(a.array[r]=i),a},removeAfter:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n-1>>>e&Ie;if(r>=this.array.length)return this;var i,u=r===this.array.length-1;if(e>0){var s=this.array[r];if(i=s&&s.removeAfter(t,e-we,n),i===s&&u)return this}if(u&&!i)return this;var a=se(this,t);return u||a.array.pop(),i&&(a.array[r]=i),a}},{});var pn=function(t,e,n,r){this._type=e,this._reverse=!!n,this._flipIndices=!!(r^n),this._maxIndex=t.length-1;var i=ce(t._size),u=ne(t._root&&t._root.array,t._level,-t._origin,i-t._origin-1),s=ne(t._tail&&t._tail.array,0,i-t._origin,t._size-t._origin-1);this._stack=n?s:u,this._stack.__prev=n?u:s};ye.createClass(pn,{next:function(){for(var t=this._stack;t;){var e=t.array,n=t.index++;if(this._reverse&&(n=Ie-n,n>t.rawMax&&(n=t.rawMax,t.index=Se-n)),n>=0&&Se>n&&t.rawMax>=n){var r=e&&e[n];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(n<<t.level),this._flipIndices&&(i=this._maxIndex-i)),a(0===u?i:1===u?r:[i,r])}this._stack=t=ne(r&&r.array,t.level-we,t.offset+(n<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return h()}},{},Ge);var mn,dn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return yn.from(t)},yn=dn;ye.createClass(dn,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},get:function(t,e){return this.has(t)?t:e},add:function(t){var e=this._map.set(t,null);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:fe(e)},remove:function(t){var e=this._map.remove(t);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:0===e.length?yn.empty():fe(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):yn.empty()},union:function(){var t=arguments;
<ide> return 0===t.length?this:this.withMutations(function(e){for(var n=0;t.length>n;n++)Pe(t[n]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Pe(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(t){return t.contains(n)})||e.remove(n)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Pe(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(t){return t.contains(n)})&&e.remove(n)})})},isSubset:function(t){return t=Pe(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=Pe(t),t.every(function(t){return e.contains(t)})},wasAltered:function(){return this._map.wasAltered()},values:function(){return this._map.keys()},entries:function(){return j(this.values(),function(t){return[t,t]})},hashCode:function(){return this._map.hashCode()},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__deepEquals:function(t){return this.isSuperset(t)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?fe(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return Sn||(Sn=fe(Te.empty()))},from:function(t){var e=yn.empty();return t?t.constructor===yn?t:e.union(t):e},fromKeys:function(t){return yn.from(Pe(t).flip())}},Pe);var wn=dn.prototype;wn[De]=wn.remove,wn[Oe]=wn.keys=wn.values,wn.contains=wn.has,wn.mergeDeep=wn.merge=wn.union,wn.mergeDeepWith=wn.mergeWith=function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.merge.apply(this,t)},wn.withMutations=Ye.withMutations,wn.asMutable=Ye.asMutable,wn.asImmutable=Ye.asImmutable,wn.__toJS=Le.__toJS,wn.__toStringMapper=Le.__toStringMapper;var Sn,In=function(t){var e=kn.empty();return t?t.constructor===kn?t:e.merge(t):e},kn=In;ye.createClass(In,{toString:function(){return this.__toString("OrderedMap {","}")
<ide> },get:function(t,e){var n=this._map.get(t);return null!=n?this._vector.get(n)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):kn.empty()},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,ke)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return j(this.entries(),function(t){return t[0]})},values:function(){return j(this.entries(),function(t){return t[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(t,e){return this._vector.fromEntrySeq().__iterate(t,e)},__deepEquals:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&P(r[0],n)&&P(r[1],t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._vector.__ensureOwner(t);return t?_e(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=n,this)}},{empty:function(){return Mn||(Mn=_e(Te.empty(),fn.empty()))}},Te),In.from=In,In.prototype[De]=In.prototype.remove;var Mn,bn=function(t,e){var n=function(t){return this instanceof n?void(this._map=Te(t)):new n(t)};t=Pe(t);var r=n.prototype=Object.create(Dn);r.constructor=n,r._name=e,r._defaultValues=t;var i=Object.keys(t);return n.prototype.length=i.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(n.prototype,e,{get:function(){return this.get(e)},set:function(t){o(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}),n},qn=bn;ye.createClass(bn,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(t){return this._defaultValues.has(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues.get(t)):e},clear:function(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;return qn._empty||(qn._empty=ve(this,Te.empty()))},set:function(t,e){if(null==t||!this.has(t))return this;var n=this._map.set(t,e);return this.__ownerID||n===this._map?this:ve(this,n)
<ide><path>src/Sequence.js
<ide> class Sequence {
<ide> return this.cacheResult().__iterate(fn, reverse, flipIndices);
<ide> }
<ide> var iterations = 0;
<del> sequence.__iterate((v, k, c) => {
<del> if (predicate.call(thisArg, v, k, c) && fn(v, k, this) !== false) {
<del> iterations++;
<del> } else {
<del> return false;
<del> }
<del> });
<add> sequence.__iterate((v, k, c) =>
<add> predicate.call(thisArg, v, k, c) && ++iterations && fn(v, k, this)
<add> );
<ide> return iterations;
<ide> };
<ide> return takeSequence; | 3 |
Text | Text | remove extra whitespace from features.md | 1c77b908ec3f431b150db9a89e3f964a0d13e509 | <ide><path>FEATURES.md
<ide> for a detailed explanation.
<ide>
<ide> Deprecates `Route#serialize` and introduces a `serialize` option to the router DSL as a replacement (as per the [Route Serializers RFC](https://github.com/emberjs/rfcs/blob/master/text/0120-route-serializers.md)).
<ide>
<del> * `ember-runtime-computed-uniq-by`
<add>* `ember-runtime-computed-uniq-by`
<ide>
<del> Introduces a computed and enumerable method "uniqBy" that allows creation of a new enumerable with unique values as determined by the given property key.
<add> Introduces a computed and enumerable method "uniqBy" that allows creation of a new enumerable with unique values as determined by the given property key.
<ide>
<del> Example:
<add> Example:
<ide>
<del> ```
<del> comments: [
<del> {id: 1, comment: 'I\'m a duplicate comment!'},
<del> {id: 2, comment: 'Then you should be fixed!'},
<del> {id: 1, comment: 'I\'m a duplicate comment!'}
<del> ],
<del> dedupedComments: Ember.computed.uniqBy('comments', 'id')
<del> ```
<add> ```
<add> comments: [
<add> {id: 1, comment: 'I\'m a duplicate comment!'},
<add> {id: 2, comment: 'Then you should be fixed!'},
<add> {id: 1, comment: 'I\'m a duplicate comment!'}
<add> ],
<add> dedupedComments: Ember.computed.uniqBy('comments', 'id')
<add> ```
<ide>
<ide> * `ember-improved-instrumentation`
<ide> | 1 |
Javascript | Javascript | fix eslint usage for node.js 8 and before | 5f18991f270754a3dca7f64ba56afe10fbb7627c | <ide><path>.eslintrc.js
<ide> Module._findPath = (request, paths, isMain) => {
<ide> if (!r && hacks.includes(request)) {
<ide> try {
<ide> return require.resolve(`./tools/node_modules/${request}`);
<del> } catch {
<add> // Keep the variable in place to ensure that ESLint started by older Node.js
<add> // versions work as expected.
<add> // eslint-disable-next-line no-unused-vars
<add> } catch (e) {
<ide> return require.resolve(
<ide> `./tools/node_modules/eslint/node_modules/${request}`);
<ide> } | 1 |
Text | Text | fix broken links in changelogs | 3d54ea430458c1a11d9a9e96bbd5a5ddc466cc68 | <ide><path>doc/changelogs/CHANGELOG_ARCHIVE.md
<ide> https://github.com/nodejs/node/commit/fdf91afb494a7a2fff2913d817f589c191a2c88f
<ide> <a id="0.8.14"></a>
<ide> ## 2012.10.25, Version 0.8.14 (Stable)
<ide>
<del>https://github.com/nodejs/node/commit/b00527fcf05c3d9f https://github.com/nodejs/node/commit/b5d5d790f9472906a59fe218
<add>https://github.com/nodejs/node/commit/b00527fcf05c3d9f
<ide>
<ide> * events: Don't clobber pre-existing _events obj in EE ctor (isaacs)
<ide>
<ide> https://github.com/nodejs/node/commit/a72120190a8ffdbcd3d6ad2a2e6ceecd2087111e
<ide> <a id="0.7.11"></a>
<ide> ## 2012.06.15, Version 0.7.11 (unstable)
<ide>
<del>https://github.com/nodejs/node/commit/5cfe0b86d5be266ef51bbba369c39e412ee51944
<add>https://github.com/nodejs/node/commit/1f93aa5d5d207e8bd739d365dbf9ad6dbcc69571
<ide>
<ide> * V8: Upgrade to v3.11.10
<ide> * npm: Upgrade to 1.1.26
<ide> https://github.com/nodejs/node/commit/5cfe0b86d5be266ef51bbba369c39e412ee51944
<ide> <a id="0.7.10"></a>
<ide> ## 2012.06.11, Version 0.7.10 (unstable)
<ide>
<del>https://github.com/nodejs/node/commit/12a32a48a30182621b3f8e9b9695d1946b53c131
<add>https://github.com/nodejs/node/commit/8d9766a9dfb1eea901219d2a865ce9300fe4d68e
<ide>
<ide> * Roll V8 back to 3.9.24.31
<ide> * build: x64 target should always pass -m64 (Robert Mustacchi)
<ide> https://github.com/nodejs/node/commit/99059aad8d654acda4abcfaa68df182b50f2ec90
<ide> <a id="0.7.2"></a>
<ide> ## 2012.02.01, Version 0.7.2 (unstable)
<ide>
<del>https://github.com/nodejs/node/commit/ec79acb3a6166e30f0bf271fbbfda1fb575b3321
<add>https://github.com/nodejs/node/commit/a3efcd2006614c3835c9395b91ab89c1f260806c
<ide>
<ide> * Update V8 to 3.8.9
<ide> * Support for sharing streams across Isolates (Igor Zinkovsky)
<ide> https://github.com/nodejs/node/commit/eca2de73ed786b935507fd1c6faccd8df9938fd3
<ide> <a id="0.1.14"></a>
<ide> ## 2009.10.09, Version 0.1.14
<ide>
<del>https://github.com/nodejs/node/commit/b12c809bb84d1265b6a4d970a5b54ee8a4890513
<add>https://github.com/nodejs/node/commit/d79b6e9f7ffad4c6aabbe5bd89108e2005366469
<ide>
<ide> * Feature: Improved addon builds with node-waf
<ide> * Feature: node.SignalHandler (Brandon Beacher)
<ide> https://github.com/nodejs/node/commit/b12c809bb84d1265b6a4d970a5b54ee8a4890513
<ide> <a id="0.1.13"></a>
<ide> ## 2009.09.30, Version 0.1.13
<ide>
<del>https://github.com/nodejs/node/commit/58493bb05b3da3dc8051fabc0bdea9e575c1a107
<add>https://github.com/nodejs/node/commit/9c9d67eb6ce1162c8da05ff59624f6c3ade19bf7
<ide>
<ide> * Feature: Multipart stream parser (Felix Geisendörfer)
<ide> * API: Move node.puts(), node.exec() and others to /utils.js
<ide> https://github.com/nodejs/node/commit/12bb0d46ce761e3d00a27170e63b40408c15b558
<ide> <a id="0.1.9"></a>
<ide> ## 2009.09.05, Version 0.1.9
<ide>
<del>https://github.com/nodejs/node/commit/d029764bb32058389ecb31ed54a5d24d2915ad4c
<add>https://github.com/nodejs/node/commit/ba6c5e38d54de30adfce69a21bafc81c35b07a03
<ide>
<ide> * Bugfix: Compile on Snow Leopard.
<ide> * Bugfix: Malformed URIs raising exceptions.
<del>
<add>
<ide> <a id="0.1.8"></a>
<ide> ## 2009.09.04, Version 0.1.8
<ide>
<del>https://github.com/nodejs/node/commit/e6d712a937b61567e81b15085edba863be16ba96
<add>https://github.com/nodejs/node/commit/734e86b9e568de5f694ae290a2b5c9395b70937c
<ide>
<ide> * Feature: External modules
<ide> * Feature: setTimeout() for node.tcp.Connection
<ide> https://github.com/nodejs/node/commit/e6d712a937b61567e81b15085edba863be16ba96
<ide> <a id="0.1.7"></a>
<ide> ## 2009.08.27, Version 0.1.7
<ide>
<del>https://github.com/nodejs/node/commit/f7acef9acf8ba8433d697ad5ed99d2e857387e4b
<add>https://github.com/nodejs/node/commit/31db4f1ed837f3835937f60d31368bdb31998386
<ide>
<ide> * Feature: global 'process' object. Emits "exit".
<ide> * Feature: promise.wait()
<ide> https://github.com/nodejs/node/commit/9c97b1db3099d61cd292aa59ec2227a619f3a7ab
<ide> <a id="0.1.5"></a>
<ide> ## 2009.08.21, Version 0.1.5
<ide>
<del>https://github.com/nodejs/node/commit/b0fd3e281cb5f7cd8d3a26bd2b89e1b59998e5ed
<add>https://github.com/nodejs/node/commit/a73998d6f491227e595524dc70589369fb458224
<ide>
<ide> * Bugfix: Buggy connections could crash node.js. Now check
<ide> connection before sending data every time (Kevin van Zonneveld)
<ide> https://github.com/nodejs/node/commit/0f888ed6de153f68c17005211d7e0f960a5e34f3
<ide> <a id="0.1.3"></a>
<ide> ## 2009.08.06, Version 0.1.3
<ide>
<del>https://github.com/nodejs/node/commit/695f0296e35b30cf8322fd1bd934810403cca9f3
<add>https://github.com/nodejs/node/commit/7464d423103b96c400d6875d390c19b637532ebf
<ide>
<ide> * Upgrade v8 to 1.3.2
<ide> * Bugfix: node.http.ServerRequest.setBodyEncoding('ascii') not
<ide> https://github.com/nodejs/node/commit/695f0296e35b30cf8322fd1bd934810403cca9f3
<ide> <a id="0.1.2"></a>
<ide> ## 2009.08.01, Version 0.1.2
<ide>
<del>https://github.com/nodejs/node/commit/025a34244d1cea94d6d40ad7bf92671cb909a96c
<add>https://github.com/nodejs/node/commit/e10fbab00fd8325a7d05d1f854292143b8361e1f
<ide>
<ide> * Add DNS API
<ide> * node.tcp.Server's backlog option is now an argument to listen()
<ide> https://github.com/nodejs/node/commit/77d407df2826b20e9177c26c0d2bb4481e497937
<ide> <a id="0.1.0"></a>
<ide> ## 2009.06.30, Version 0.1.0
<ide>
<del>https://github.com/nodejs/node/commit/0fe44d52fe75f151bceb59534394658aae6ac328
<add>https://github.com/nodejs/node/commit/813b53938b40484f63e7324c030e33711f26a149
<ide>
<ide> * Update documentation, use asciidoc.
<ide> * EventEmitter and Promise interfaces. (Breaks previous API.)
<ide> https://github.com/nodejs/node/commit/fbe0be19ebfb422d8fa20ea5204c1713e9214d5f
<ide> <a id="0.0.5"></a>
<ide> ## 2009.06.18, Version 0.0.5
<ide>
<del>https://github.com/nodejs/node/commit/3a2b41de74b6c343b8464a68eff04c4bfd9aebea
<add>https://github.com/nodejs/node/commit/ec5f3dbae11ed121d24744861a8fce55636ecd66
<ide>
<ide> * Support for IPv6
<ide> * Remove namespace node.constants
<ide> https://github.com/nodejs/node/commit/916b9ca715b229b0703f0ed6c2fc065410fb189c
<ide> <a id="0.0.3"></a>
<ide> ## 2009.06.11, Version 0.0.3
<ide>
<del>https://github.com/nodejs/node/commit/6e0dfe50006ae4f5dac987f055e0c9338662f40a
<add>https://github.com/nodejs/node/commit/4cfc982c776475eb65fb1080e6b575a86505a347
<ide>
<ide> * Many bug fixes including the problem with http.Client on
<ide> macintosh
<ide><path>doc/changelogs/CHANGELOG_IOJS.md
<ide> See https://github.com/nodejs/node/labels/confirmed-bug for complete and current
<ide>
<ide> ### Commits
<ide>
<del>* [[`52b1230628`](https://github.com/nodejs/node/commit/52b1230628)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141)
<del>* [[`20ff1e2ecb`](https://github.com/nodejs/node/commit/20ff1e2ecb)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141)
<add>* [[`c70e68fa32`](https://github.com/nodejs/node/commit/c70e68fa32)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141)
<add>* [[`ca93f7f2e6`](https://github.com/nodejs/node/commit/ca93f7f2e6)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141)
<ide>
<ide>
<ide> <a id="2.3.3"></a>
<ide> See https://github.com/nodejs/node/labels/confirmed-bug for complete and current
<ide> * [[`2e2fce0502`](https://github.com/nodejs/node/commit/2e2fce0502)] - **repl**: fix persistent history and env variable name (Roman Reiss) [#1593](https://github.com/nodejs/node/pull/1593)
<ide> * [[`ea5195ccaf`](https://github.com/nodejs/node/commit/ea5195ccaf)] - **repl**: do not save history for non-terminal repl (Fedor Indutny) [#1575](https://github.com/nodejs/node/pull/1575)
<ide> * [[`0450ce7db2`](https://github.com/nodejs/node/commit/0450ce7db2)] - **repl**: add mode detection, cli persistent history (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513)
<del>* [[`af9fe3bbc7`](https://github.com/nodejs/node/commit/af9fe3bbc7)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION due to V8 API (Rod Vagg) [#1532](https://github.com/nodejs/node/pull/1532)
<add>* [[`c1b9913e1f`](https://github.com/nodejs/node/commit/c1b9913e1f)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION due to V8 API (Rod Vagg) [#1532](https://github.com/nodejs/node/pull/1532)
<ide> * [[`279f6116aa`](https://github.com/nodejs/node/commit/279f6116aa)] - **src**: fix -Wmissing-field-initializers warning (Ben Noordhuis) [#1606](https://github.com/nodejs/node/pull/1606)
<ide> * [[`73062521a4`](https://github.com/nodejs/node/commit/73062521a4)] - **src**: deprecate smalloc public functions (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565)
<ide> * [[`ccb199af17`](https://github.com/nodejs/node/commit/ccb199af17)] - **src**: fix deprecation warnings (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565)
<ide> will be removed at a later point. (Roman Reiss) [#1363](https://github.com/nodej
<ide> ### Commits
<ide>
<ide> * [[`53ed89d927`](https://github.com/nodejs/node/commit/53ed89d927)] - ***Revert*** "**build**: use %PYTHON% instead of python" (Rod Vagg) [#1475](https://github.com/nodejs/node/pull/1475)
<del>* [[`2b744b0ab7`](https://github.com/nodejs/node/commit/2b744b0ab7)] - **src**: revert NODE_MODULE_VERSION to 43 (Chris Dickinson) [#1460](https://github.com/nodejs/node/pull/1460)
<add>* [[`f23b96352b`](https://github.com/nodejs/node/commit/f23b96352b)] - **src**: revert NODE_MODULE_VERSION to 43 (Chris Dickinson) [#1460](https://github.com/nodejs/node/pull/1460)
<ide> * [[`431673ebd1`](https://github.com/nodejs/node/commit/431673ebd1)] - **buffer**: fast-case for empty string in byteLength (Jackson Tian) [#1441](https://github.com/nodejs/node/pull/1441)
<ide> * [[`1b22bad35f`](https://github.com/nodejs/node/commit/1b22bad35f)] - **build**: fix logic for shared library flags (Jeremiah Senkpiel) [#1454](https://github.com/nodejs/node/pull/1454)
<ide> * [[`91943a99d5`](https://github.com/nodejs/node/commit/91943a99d5)] - **build**: use %PYTHON% instead of python (Rod Vagg) [#1444](https://github.com/nodejs/node/pull/1444)
<ide><path>doc/changelogs/CHANGELOG_V4.md
<ide> * [io.js](CHANGELOG_IOJS.md)
<ide> * [Archive](CHANGELOG_ARCHIVE.md)
<ide>
<del>
<del>**Note:** Node.js v4 is covered by the
<add>
<add>**Note:** Node.js v4 is covered by the
<ide> [Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and
<ide> will be supported actively until April 2017 and maintained until April 2018.
<ide>
<ide> Maintenance update.
<ide> * [[`1e1173fc5c`](https://github.com/nodejs/node/commit/1e1173fc5c)] - **configure**: respect CC_host in host arch detection (João Reis) [#4117](https://github.com/nodejs/node/pull/4117)
<ide> * [[`2e9b886fbf`](https://github.com/nodejs/node/commit/2e9b886fbf)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756)
<ide> * [[`00b77d9e84`](https://github.com/nodejs/node/commit/00b77d9e84)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753)
<del>* [[`3dd90ddc73`](https://github.com/nodejs/node/commit/3dd90ddc73)] - **deps**: upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110)
<add>* [[`810f76e440`](https://github.com/nodejs/node/commit/810f76e440)] - **deps**: upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110)
<ide> * [[`51ae8d10b3`](https://github.com/nodejs/node/commit/51ae8d10b3)] - **deps**: Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110)
<ide> * [[`9e1edead22`](https://github.com/nodejs/node/commit/9e1edead22)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938)
<ide> * [[`a2ce3843cc`](https://github.com/nodejs/node/commit/a2ce3843cc)] - **deps**: upgrade npm to 2.14.9 (Forrest L Norvell) [#3686](https://github.com/nodejs/node/pull/3686)
<ide><path>doc/changelogs/CHANGELOG_V5.md
<ide> This is a security release. All Node.js users should consult the security releas
<ide> * [[`5ee5fa292f`](https://github.com/nodejs/node/commit/5ee5fa292f)] - **build**: add missing `openssl_fips%` to common.gypi (Fedor Indutny) [#5919](https://github.com/nodejs/node/pull/5919)
<ide> * [[`5681ffecf7`](https://github.com/nodejs/node/commit/5681ffecf7)] - **build**: enable compilation for linuxOne (Michael Dawson) [#5941](https://github.com/nodejs/node/pull/5941)
<ide> * [[`660ec9f889`](https://github.com/nodejs/node/commit/660ec9f889)] - **child_process**: refactor self=this in socket_list (Benjamin Gruenbaum) [#5860](https://github.com/nodejs/node/pull/5860)
<del>* [[`e1a012f277`](https://github.com/nodejs/node/commit/e1a012f277)] - **deps**: upgrade npm to 3.8.3 (Forrest L Norvell)
<add>* [[`0928584444`](https://github.com/nodejs/node/commit/0928584444)] - **deps**: upgrade npm to 3.8.3 (Forrest L Norvell)
<ide> * [[`ec1813199d`](https://github.com/nodejs/node/commit/ec1813199d)] - **deps**: backport 8d00c2c from v8 upstream (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577)
<ide> * [[`2a5c6d7006`](https://github.com/nodejs/node/commit/2a5c6d7006)] - **dns**: Refactor forEach to map (Benjamin Gruenbaum) [#5803](https://github.com/nodejs/node/pull/5803)
<ide> * [[`6a6112a2f3`](https://github.com/nodejs/node/commit/6a6112a2f3)] - **dns**: Use object without protoype for map (Benjamin Gruenbaum) [#5843](https://github.com/nodejs/node/pull/5843)
<ide> This is a security release. All Node.js users should consult the security releas
<ide> * [[`8e790b7a0c`](https://github.com/nodejs/node/commit/8e790b7a0c)] - **doc**: add instructions to only sign a release (Jeremiah Senkpiel) [#5876](https://github.com/nodejs/node/pull/5876)
<ide> * [[`f1f9aff855`](https://github.com/nodejs/node/commit/f1f9aff855)] - **doc**: fix doc for Buffer.readInt32LE() (ghaiklor) [#5890](https://github.com/nodejs/node/pull/5890)
<ide> * [[`731f7b8055`](https://github.com/nodejs/node/commit/731f7b8055)] - **etw**: fix descriptors of events 9 and 23 (João Reis) [#5742](https://github.com/nodejs/node/pull/5742)
<del>* [[`aac9ead379`](https://github.com/nodejs/node/commit/aac9ead379)] - **etw,build**: always generate .rc and .h files (João Reis) [#5657](https://github.com/nodejs/node/pull/5657)
<add>* [[`ccd81889fa`](https://github.com/nodejs/node/commit/ccd81889fa)] - **etw,build**: always generate .rc and .h files (João Reis) [#5657](https://github.com/nodejs/node/pull/5657)
<ide> * [[`80155d398c`](https://github.com/nodejs/node/commit/80155d398c)] - **(SEMVER-MINOR)** **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333)
<del>* [[`ae15d68ad1`](https://github.com/nodejs/node/commit/ae15d68ad1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879)
<add>* [[`bb28770aa1`](https://github.com/nodejs/node/commit/bb28770aa1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879)
<ide> * [[`63c601bc15`](https://github.com/nodejs/node/commit/63c601bc15)] - **http**: speed up checkIsHttpToken (Jackson Tian) [#4790](https://github.com/nodejs/node/pull/4790)
<del>* [[`40847b0b8b`](https://github.com/nodejs/node/commit/40847b0b8b)] - **lib**: rename /node.js to /bootstrap_node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<del>* [[`e644eb3d69`](https://github.com/nodejs/node/commit/e644eb3d69)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753)
<del>* [[`a757e0583c`](https://github.com/nodejs/node/commit/a757e0583c)] - **lib,src**: move src/node.js to lib/internal/node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<del>* [[`e3c7b46326`](https://github.com/nodejs/node/commit/e3c7b46326)] - **lib,src**: refactor src/node.js into internal files (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<add>* [[`ec6af31eba`](https://github.com/nodejs/node/commit/ec6af31eba)] - **lib**: rename /node.js to /bootstrap_node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<add>* [[`91466b855f`](https://github.com/nodejs/node/commit/91466b855f)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753)
<add>* [[`4bf2acaa1e`](https://github.com/nodejs/node/commit/4bf2acaa1e)] - **lib,src**: move src/node.js to lib/internal/node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<add>* [[`015cef25eb`](https://github.com/nodejs/node/commit/015cef25eb)] - **lib,src**: refactor src/node.js into internal files (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103)
<ide> * [[`b07bc5d996`](https://github.com/nodejs/node/commit/b07bc5d996)] - **(SEMVER-MINOR)** **net**: emit host in lookup event (HUANG Wei) [#5598](https://github.com/nodejs/node/pull/5598)
<del>* [[`2fa959be15`](https://github.com/nodejs/node/commit/2fa959be15)] - **(SEMVER-MINOR)** **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853)
<add>* [[`8363ede855`](https://github.com/nodejs/node/commit/8363ede855)] - **(SEMVER-MINOR)** **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853)
<ide> * [[`a2ad21645f`](https://github.com/nodejs/node/commit/a2ad21645f)] - **querystring**: don't stringify bad surrogate pair (Brian White) [#5858](https://github.com/nodejs/node/pull/5858)
<ide> * [[`427173204e`](https://github.com/nodejs/node/commit/427173204e)] - **(SEMVER-MINOR)** **repl**: support standalone blocks (Prince J Wesley) [#5581](https://github.com/nodejs/node/pull/5581)
<del>* [[`d044898495`](https://github.com/nodejs/node/commit/d044898495)] - **src**: Add missing `using v8::MaybeLocal` (Anna Henningsen) [#5974](https://github.com/nodejs/node/pull/5974)
<add>* [[`bfd723f3ba`](https://github.com/nodejs/node/commit/bfd723f3ba)] - **src**: Add missing `using v8::MaybeLocal` (Anna Henningsen) [#5974](https://github.com/nodejs/node/pull/5974)
<ide> * [[`0d0c57ff5e`](https://github.com/nodejs/node/commit/0d0c57ff5e)] - **(SEMVER-MINOR)** **src**: override v8 thread defaults using cli options (Tom Gallacher) [#4344](https://github.com/nodejs/node/pull/4344)
<ide> * [[`f9d0166291`](https://github.com/nodejs/node/commit/f9d0166291)] - **src**: reword command and add ternary (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756)
<ide> * [[`f1488bb24c`](https://github.com/nodejs/node/commit/f1488bb24c)] - **src,http_parser**: remove KickNextTick call (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756)
<del>* [[`8e8768ecbb`](https://github.com/nodejs/node/commit/8e8768ecbb)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920)
<del>* [[`bf94b5a1b9`](https://github.com/nodejs/node/commit/bf94b5a1b9)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939)
<del>* [[`2192528326`](https://github.com/nodejs/node/commit/2192528326)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914)
<add>* [[`c5c7ae8e14`](https://github.com/nodejs/node/commit/c5c7ae8e14)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920)
<add>* [[`6113f6af45`](https://github.com/nodejs/node/commit/6113f6af45)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939)
<add>* [[`0acca7654f`](https://github.com/nodejs/node/commit/0acca7654f)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914)
<ide> * [[`aebe6245b7`](https://github.com/nodejs/node/commit/aebe6245b7)] - **test**: add test for piping large input from stdin (Anna Henningsen) [#5949](https://github.com/nodejs/node/pull/5949)
<ide> * [[`a19de97d2f`](https://github.com/nodejs/node/commit/a19de97d2f)] - **test**: remove the use of curl in the test suite (Santiago Gimeno) [#5750](https://github.com/nodejs/node/pull/5750)
<ide> * [[`6928a17aa3`](https://github.com/nodejs/node/commit/6928a17aa3)] - **test**: exclude new fs watch test for AIX (Michael Dawson) [#5937](https://github.com/nodejs/node/pull/5937)
<ide> This is an important security release. All Node.js users should consult the secu
<ide> * [[`0d4b538175`](https://github.com/nodejs/node/commit/0d4b538175)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919)
<ide> * [[`abb0f6cd53`](https://github.com/nodejs/node/commit/abb0f6cd53)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914)
<ide> * [[`755619c554`](https://github.com/nodejs/node/commit/755619c554)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913)
<del>* [[`d5d2f86f89`](https://github.com/nodejs/node/commit/d5d2f86f89)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.6.1 (James M Snell)
<add>* [[`4f4c8ab3b4`](https://github.com/nodejs/node/commit/4f4c8ab3b4)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.6.1 (James M Snell)
<ide> * [[`f0bd176d6d`](https://github.com/nodejs/node/commit/f0bd176d6d)] - **deps**: reapply c-ares floating patch (Ben Noordhuis) [#5090](https://github.com/nodejs/node/pull/5090)
<ide> * [[`f1a0827417`](https://github.com/nodejs/node/commit/f1a0827417)] - **deps**: sync with upstream bagder/c-ares@2bae2d5 (Fedor Indutny) [#5090](https://github.com/nodejs/node/pull/5090)
<ide> * [[`cbf36de8f1`](https://github.com/nodejs/node/commit/cbf36de8f1)] - **deps**: upgrade npm to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958)
<ide> This is an important security release. All Node.js users should consult the secu
<ide> * [[`66c74548de`](https://github.com/nodejs/node/commit/66c74548de)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733)
<ide> * [[`54e8845b5e`](https://github.com/nodejs/node/commit/54e8845b5e)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959)
<ide> * [[`fa940cf9bc`](https://github.com/nodejs/node/commit/fa940cf9bc)] - **fs**: remove unused branches (Benjamin Gruenbaum) [#4795](https://github.com/nodejs/node/pull/4795)
<del>* [[`a3b84a4c93`](https://github.com/nodejs/node/commit/a3b84a4c93)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell)
<add>* [[`7bef1b7907`](https://github.com/nodejs/node/commit/7bef1b7907)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell)
<ide> * [[`9b03af254a`](https://github.com/nodejs/node/commit/9b03af254a)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773)
<ide> * [[`101de9de3f`](https://github.com/nodejs/node/commit/101de9de3f)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982)
<ide> * [[`b2c8b7f6d3`](https://github.com/nodejs/node/commit/b2c8b7f6d3)] - **internal/child_process**: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752)
<ide> This is an important security release. All Node.js users should consult the secu
<ide> * [[`85743c0e92`](https://github.com/nodejs/node/commit/85743c0e92)] - **querystring**: check that maxKeys is finite (Myles Borins) [#5066](https://github.com/nodejs/node/pull/5066)
<ide> * [[`5a10fe932c`](https://github.com/nodejs/node/commit/5a10fe932c)] - **querystring**: use String.prototype.split's limit (Manuel Valls) [#2288](https://github.com/nodejs/node/pull/2288)
<ide> * [[`2844cc03dc`](https://github.com/nodejs/node/commit/2844cc03dc)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977)
<del>* [[`ac6627a0fe`](https://github.com/nodejs/node/commit/ac6627a0fe)] - **src**: avoid compiler warning in node_revert.cc (James M Snell)
<del>* [[`459c5844c8`](https://github.com/nodejs/node/commit/459c5844c8)] - **(SEMVER-MINOR)** **src**: add --security-revert command line flag (James M Snell)
<add>* [[`b5b5bb1e3c`](https://github.com/nodejs/node/commit/b5b5bb1e3c)] - **src**: avoid compiler warning in node_revert.cc (James M Snell)
<add>* [[`d387591bbb`](https://github.com/nodejs/node/commit/d387591bbb)] - **(SEMVER-MINOR)** **src**: add --security-revert command line flag (James M Snell)
<ide> * [[`95615196de`](https://github.com/nodejs/node/commit/95615196de)] - **src**: clean up usage of `__proto__` (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069)
<ide> * [[`e93b024214`](https://github.com/nodejs/node/commit/e93b024214)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843)
<ide> * [[`a2c257a3ef`](https://github.com/nodejs/node/commit/a2c257a3ef)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757)
<ide> This is an important security release. All Node.js users should consult the secu
<ide> * [[`ebd9addcd1`](https://github.com/nodejs/node/commit/ebd9addcd1)] - **crypto**: clear error stack in ECDH::Initialize (Fedor Indutny) [#4689](https://github.com/nodejs/node/pull/4689)
<ide> * [[`66b9c0d8bd`](https://github.com/nodejs/node/commit/66b9c0d8bd)] - **debugger**: remove variable redeclarations (Rich Trott) [#4633](https://github.com/nodejs/node/pull/4633)
<ide> * [[`88b2889679`](https://github.com/nodejs/node/commit/88b2889679)] - **dgram**: prevent disabled optimization of bind() (Brian White) [#4613](https://github.com/nodejs/node/pull/4613)
<del>* [[`d56e3f8b67`](https://github.com/nodejs/node/commit/d56e3f8b67)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762)
<add>* [[`8a11b8c0ef`](https://github.com/nodejs/node/commit/8a11b8c0ef)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762)
<ide> * [[`212a44df03`](https://github.com/nodejs/node/commit/212a44df03)] - **doc**: clarify protocol default in http.request() (cjihrig) [#4714](https://github.com/nodejs/node/pull/4714)
<ide> * [[`3297036345`](https://github.com/nodejs/node/commit/3297036345)] - **doc**: update branch-diff arguments in release doc (Rod Vagg) [#4691](https://github.com/nodejs/node/pull/4691)
<ide> * [[`666c089e68`](https://github.com/nodejs/node/commit/666c089e68)] - **doc**: fix named anchors in addons.markdown and http.markdown (Michael Theriot) [#4708](https://github.com/nodejs/node/pull/4708)
<ide> This is an important security release. All Node.js users should consult the secu
<ide> * [[`4bc1a47761`](https://github.com/nodejs/node/commit/4bc1a47761)] - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675)
<ide> * [[`ad63d350d4`](https://github.com/nodejs/node/commit/ad63d350d4)] - **readline**: Remove XXX and output debuglog (Kohei TAKATA) [#4690](https://github.com/nodejs/node/pull/4690)
<ide> * [[`da550aa063`](https://github.com/nodejs/node/commit/da550aa063)] - **repl**: make sure historyPath is trimmed (Evan Lucas) [#4539](https://github.com/nodejs/node/pull/4539)
<del>* [[`1a6e7d1b52`](https://github.com/nodejs/node/commit/1a6e7d1b52)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757)
<add>* [[`a2c257a3ef`](https://github.com/nodejs/node/commit/a2c257a3ef)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757)
<ide> * [[`8bad51977a`](https://github.com/nodejs/node/commit/8bad51977a)] - **src**: return UV_EAI_NODATA on empty lookup (cjihrig) [#4715](https://github.com/nodejs/node/pull/4715)
<ide> * [[`761cf2bf6a`](https://github.com/nodejs/node/commit/761cf2bf6a)] - **src**: don't check failure with ERR_peek_error() (Ben Noordhuis) [#4731](https://github.com/nodejs/node/pull/4731)
<del>* [[`953f4a3999`](https://github.com/nodejs/node/commit/953f4a3999)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761)
<add>* [[`426ff820f5`](https://github.com/nodejs/node/commit/426ff820f5)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761)
<ide> * [[`e65f1f7954`](https://github.com/nodejs/node/commit/e65f1f7954)] - **test**: fix tls-multi-key race condition (Santiago Gimeno) [#3966](https://github.com/nodejs/node/pull/3966)
<ide> * [[`3727ae0d7d`](https://github.com/nodejs/node/commit/3727ae0d7d)] - **test**: use addon.md block headings as test dir names (Rod Vagg) [#4412](https://github.com/nodejs/node/pull/4412)
<del>* [[`47960a07c0`](https://github.com/nodejs/node/commit/47960a07c0)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736)
<del>* [[`9926b5a25f`](https://github.com/nodejs/node/commit/9926b5a25f)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753)
<add>* [[`a347cd793f`](https://github.com/nodejs/node/commit/a347cd793f)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736)
<add>* [[`a39b28bb5a`](https://github.com/nodejs/node/commit/a39b28bb5a)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753)
<ide> * [[`d1aabd6264`](https://github.com/nodejs/node/commit/d1aabd6264)] - **test**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286)
<ide> * [[`e98bcfa2cb`](https://github.com/nodejs/node/commit/e98bcfa2cb)] - **test**: remove 1 second delay from test (Rich Trott) [#4616](https://github.com/nodejs/node/pull/4616)
<ide> * [[`6cfd0b5a32`](https://github.com/nodejs/node/commit/6cfd0b5a32)] - **test**: fix flaky test-net-socket-local-address (cjihrig) [#4650](https://github.com/nodejs/node/pull/4650)
<ide> * [[`e22cc6c2eb`](https://github.com/nodejs/node/commit/e22cc6c2eb)] - **test**: fix race in test-net-server-pause-on-connect (Rich Trott) [#4637](https://github.com/nodejs/node/pull/4637)
<ide> * [[`9164c00bdb`](https://github.com/nodejs/node/commit/9164c00bdb)] - **test**: move resource intensive tests to sequential (Rich Trott) [#4615](https://github.com/nodejs/node/pull/4615)
<ide> * [[`d8ba2c0de4`](https://github.com/nodejs/node/commit/d8ba2c0de4)] - **test**: fix `http-upgrade-client` flakiness (Santiago Gimeno) [#4602](https://github.com/nodejs/node/pull/4602)
<ide> * [[`6018fa1f57`](https://github.com/nodejs/node/commit/6018fa1f57)] - **test**: fix `http-upgrade-agent` flakiness (Santiago Gimeno) [#4520](https://github.com/nodejs/node/pull/4520)
<del>* [[`c33f6a87d0`](https://github.com/nodejs/node/commit/c33f6a87d0)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753)
<add>* [[`8f4f5b3ca5`](https://github.com/nodejs/node/commit/8f4f5b3ca5)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753)
<ide> * [[`162e16afdb`](https://github.com/nodejs/node/commit/162e16afdb)] - **tools**: enable no-extra-semi rule in eslint (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205)
<ide> * [[`031b87d42d`](https://github.com/nodejs/node/commit/031b87d42d)] - **tools**: add license-builder.sh to construct LICENSE (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194)
<ide> * [[`ec8e0ae697`](https://github.com/nodejs/node/commit/ec8e0ae697)] - **tools**: fix style issue after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286)
<ide> * [[`4d5ee7a512`](https://github.com/nodejs/node/commit/4d5ee7a512)] - **tools**: update eslint config (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286)
<ide> * [[`2d441493a4`](https://github.com/nodejs/node/commit/2d441493a4)] - **tools**: update eslint to v1.10.3 (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286)
<del>* [[`aba3cc834e`](https://github.com/nodejs/node/commit/aba3cc834e)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762)
<add>* [[`fe23f4241f`](https://github.com/nodejs/node/commit/fe23f4241f)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762)
<ide> * [[`5f57005ec9`](https://github.com/nodejs/node/commit/5f57005ec9)] - **(SEMVER-MINOR)** **v8,src**: expose statistics about heap spaces (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463)
<ide>
<ide> <a id="5.4.1"></a> | 4 |
Go | Go | fix some go_vet issues | 9c831243022f9b5bf028be819c62bb0b5b23b977 | <ide><path>pkg/mount/mounter_linux.go
<ide> func mount(device, target, mType string, flags uintptr, data string) error {
<ide> flags: flags & pflags,
<ide> err: err,
<ide> }
<del> return err
<ide> }
<ide> }
<ide>
<ide><path>pkg/system/lstat_unix.go
<ide> import (
<ide> func Lstat(path string) (*StatT, error) {
<ide> s := &syscall.Stat_t{}
<ide> if err := syscall.Lstat(path, s); err != nil {
<del> return nil, &os.PathError{"Lstat", path, err}
<add> return nil, &os.PathError{Op: "Lstat", Path: path, Err: err}
<ide> }
<ide> return fromStatT(s)
<ide> }
<ide><path>pkg/system/stat_unix.go
<ide> func (s StatT) IsDir() bool {
<ide> func Stat(path string) (*StatT, error) {
<ide> s := &syscall.Stat_t{}
<ide> if err := syscall.Stat(path, s); err != nil {
<del> return nil, &os.PathError{"Stat", path, err}
<add> return nil, &os.PathError{Op: "Stat", Path: path, Err: err}
<ide> }
<ide> return fromStatT(s)
<ide> } | 3 |
PHP | PHP | add arrayaccess support to data_get | 08c89f5124dac73e5283c11ff78f2b2dd9e9535f | <ide><path>src/Illuminate/Support/helpers.php
<ide> function data_get($target, $key, $default = null)
<ide>
<ide> $target = $target[$segment];
<ide> }
<add> elseif ($target instanceof ArrayAccess)
<add> {
<add> if ( ! isset($target[$segment]))
<add> {
<add> return value($default);
<add> }
<add>
<add> $target = $target[$segment];
<add> }
<ide> elseif (is_object($target))
<ide> {
<ide> if ( ! isset($target->{$segment}))
<ide><path>tests/Support/SupportHelpersTest.php
<ide> public function testDataGet()
<ide> {
<ide> $object = (object) array('users' => array('name' => array('Taylor', 'Otwell')));
<ide> $array = array((object) array('users' => array((object) array('name' => 'Taylor'))));
<add> $arrayAccess = new SupportTestArrayAccess(['price' => 56, 'user' => new SupportTestArrayAccess(['name' => 'John'])]);
<ide>
<ide> $this->assertEquals('Taylor', data_get($object, 'users.name.0'));
<ide> $this->assertEquals('Taylor', data_get($array, '0.users.0.name'));
<ide> $this->assertNull(data_get($array, '0.users.3'));
<ide> $this->assertEquals('Not found', data_get($array, '0.users.3', 'Not found'));
<ide> $this->assertEquals('Not found', data_get($array, '0.users.3', function (){ return 'Not found'; }));
<add> $this->assertEquals(56, data_get($arrayAccess, 'price'));
<add> $this->assertEquals('John', data_get($arrayAccess, 'user.name'));
<add> $this->assertEquals('void', data_get($arrayAccess, 'foo', 'void'));
<add> $this->assertEquals('void', data_get($arrayAccess, 'user.foo', 'void'));
<add> $this->assertNull(data_get($arrayAccess, 'foo'));
<add> $this->assertNull(data_get($arrayAccess, 'user.foo'));
<ide> }
<ide>
<ide>
<ide> class SupportTestClassOne {
<ide> }
<ide>
<ide> class SupportTestClassTwo extends SupportTestClassOne {}
<add>
<add>class SupportTestArrayAccess implements ArrayAccess {
<add>
<add> protected $attributes = [];
<add>
<add> public function __construct ($attributes = []){ $this->attributes = $attributes; }
<add>
<add> public function offsetExists ($offset){ return isset($this->attributes[$offset]); }
<add>
<add> public function offsetGet ($offset){ return $this->attributes[$offset]; }
<add>
<add> public function offsetSet ($offset, $value){ $this->attributes[$offset] = $value; }
<add>
<add> public function offsetUnset ($offset){ unset($this->attributes[$offset]); }
<add>
<add>} | 2 |
Mixed | Javascript | support readable hwm in incomingmessage | 11276af5dd60354af3db1b578804ca3839044420 | <ide><path>doc/api/http.md
<ide> the request body should be sent.
<ide> ## Class: http.IncomingMessage
<ide> <!-- YAML
<ide> added: v0.1.17
<add>changes:
<add> - version: REPLACEME
<add> pr-url: https://github.com/nodejs/node/pull/30135
<add> description: The `readableHighWaterMark` value mirrors that of the socket.
<ide> -->
<ide>
<ide> * Extends: {stream.Readable}
<ide><path>lib/_http_incoming.js
<ide> function readStop(socket) {
<ide>
<ide> /* Abstract base class for ServerRequest and ClientResponse. */
<ide> function IncomingMessage(socket) {
<del> Stream.Readable.call(this);
<add> let streamOptions;
<add>
<add> if (socket) {
<add> streamOptions = {
<add> highWaterMark: socket.readableHighWaterMark
<add> };
<add> }
<add>
<add> Stream.Readable.call(this, streamOptions);
<ide>
<ide> this._readableState.readingMore = true;
<ide>
<ide><path>test/parallel/test-http-incoming-message-options.js
<add>'use strict';
<add>const common = require('../common');
<add>const assert = require('assert');
<add>const http = require('http');
<add>const net = require('net');
<add>const readableHighWaterMark = 1024;
<add>const server = http.createServer((req, res) => { res.end(); });
<add>
<add>server.listen(0, common.mustCall(() => {
<add> const req = http.request({
<add> port: server.address().port,
<add> createConnection(options) {
<add> options.readableHighWaterMark = readableHighWaterMark;
<add> return net.createConnection(options);
<add> }
<add> }, common.mustCall((res) => {
<add> assert.strictEqual(res.socket, req.socket);
<add> assert.strictEqual(res.socket.readableHighWaterMark, readableHighWaterMark);
<add> assert.strictEqual(res.readableHighWaterMark, readableHighWaterMark);
<add> server.close();
<add> }));
<add>
<add> req.end();
<add>})); | 3 |
Javascript | Javascript | fix build date formatting | 5b59a63b2b9247b326c654ca941a1dfe77914024 | <ide><path>Gruntfile.js
<ide> module.exports = function( grunt ) {
<ide> // Embed Date
<ide> compiled = compiled.replace( /@VERSION/g, version )
<ide> .replace( "@DATE", function () {
<del> var date = new Date();
<del>
<ide> // YYYY-MM-DD
<del> return [
<del> date.getFullYear(),
<del> date.getMonth() + 1,
<del> date.getDate()
<del> ].join( "-" );
<add> return ( new Date() ).toISOString().replace( /T.*/, "" );
<ide> });
<ide>
<ide> // Write concatenated source to file | 1 |
Python | Python | add more tests | 56f8bc73ef1880ded2abe9da5a5ff26ca6babc20 | <ide><path>spacy/tests/pipeline/test_initialize.py
<ide> def test_initialize_arguments():
<ide> name = "test_initialize_arguments"
<ide>
<add> class CustomTokenizer:
<add> def __init__(self, tokenizer):
<add> self.tokenizer = tokenizer
<add> self.from_initialize = None
<add>
<add> def __call__(self, text):
<add> return self.tokenizer(text)
<add>
<add> def initialize(self, get_examples, nlp, custom: int):
<add> self.from_initialize = custom
<add>
<ide> class Component:
<ide> def __init__(self):
<del> ...
<add> self.from_initialize = None
<ide>
<ide> def initialize(
<ide> self, get_examples, nlp, custom1: str, custom2: StrictBool = False
<ide> ):
<del> ...
<add> self.from_initialize = (custom1, custom2)
<ide>
<ide> Language.factory(name, func=lambda nlp, name: Component())
<ide>
<ide> nlp = English()
<add> nlp.tokenizer = CustomTokenizer(nlp.tokenizer)
<ide> example = Example.from_dict(nlp("x"), {})
<ide> get_examples = lambda: [example]
<ide> nlp.add_pipe(name)
<ide> # The settings here will typically come from the [initialize] block
<ide> with pytest.raises(ConfigValidationError) as e:
<ide> # Empty settings, no required custom1 argument
<del> nlp.initialize(get_examples, settings={"components": {name: {}}})
<add> settings = {"tokenizer": {"custom": 1}, "components": {name: {}}}
<add> nlp.initialize(get_examples, settings=settings)
<ide> errors = e.value.errors
<ide> assert len(errors) == 1
<ide> assert errors[0]["loc"] == ("custom1",)
<ide> assert errors[0]["type"] == "value_error.missing"
<ide> with pytest.raises(ConfigValidationError) as e:
<ide> # Wrong type
<del> settings = {"components": {name: {"custom1": "x", "custom2": 1}}}
<add> settings = {
<add> "tokenizer": {"custom": 1},
<add> "components": {name: {"custom1": "x", "custom2": 1}},
<add> }
<ide> nlp.initialize(get_examples, settings=settings)
<ide> errors = e.value.errors
<ide> assert len(errors) == 1
<ide> assert errors[0]["loc"] == ("custom2",)
<ide> assert errors[0]["type"] == "value_error.strictbool"
<add> settings = {
<add> "tokenizer": {"custom": 1},
<add> "components": {name: {"custom1": "x", "custom2": True}},
<add> }
<add> nlp.initialize(get_examples, settings=settings)
<add> assert nlp.tokenizer.from_initialize == 1
<add> pipe = nlp.get_pipe(name)
<add> assert pipe.from_initialize == ("x", True) | 1 |
Ruby | Ruby | capitalize descriptions of --head, --devel | a70a80511146ec35d9da82f678a0d36efe5c72d4 | <ide><path>Library/Homebrew/cmd/options.rb
<ide> def dump_options_for_formula f
<ide> f.options.sort_by(&:flag).each do |opt|
<ide> puts "#{opt.flag}\n\t#{opt.description}"
<ide> end
<del> puts "--devel\n\tinstall development version #{f.devel.version}" if f.devel
<del> puts "--HEAD\n\tinstall HEAD version" if f.head
<add> puts "--devel\n\tInstall development version #{f.devel.version}" if f.devel
<add> puts "--HEAD\n\tInstall HEAD version" if f.head
<ide> end
<ide> end | 1 |
Text | Text | clarify instructions for cafe menu step 41 | 399eaa01ed6c5cdff4f3d08b60c5cc51237fb2e4 | <ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f3cade9fa77275d9f4efe62.md
<ide> dashedName: step-41
<ide>
<ide> That worked, but there is still a little space on the right of the price.
<ide>
<del>You could keep trying various percentages for the widths. Instead, simply move the price `p` element to be on the same line and make sure there is no space between them.
<add>You could keep trying various percentages for the widths. Instead, use the back space key on your keyboard to move the `p` element with the class `price` next to the `p` element with the class `flavor` so that they are on the same line in the editor. Make sure there is no space between them.
<ide>
<ide> # --hints--
<ide> | 1 |
Python | Python | change compute_accuracy() argument order and names | bfd800ad38132b924af2421008acda970823bb8a | <ide><path>examples/mnist_siamese_graph.py
<ide> def create_base_network(input_dim):
<ide> return seq
<ide>
<ide>
<del>def compute_accuracy(predictions, labels):
<add>def compute_accuracy(y_true, y_pred):
<ide> '''Compute classification accuracy with a fixed threshold on distances.
<ide> '''
<del> preds = predictions.ravel() < 0.5
<del> return np.mean(preds == labels)
<add> pred = y_pred.ravel() < 0.5
<add> return np.mean(pred == y_true)
<ide>
<ide>
<ide> def accuracy(y_true, y_pred):
<ide> def accuracy(y_true, y_pred):
<ide> validation_data=([te_pairs[:, 0], te_pairs[:, 1]], te_y))
<ide>
<ide> # compute final accuracy on training and test sets
<del>pred = model.predict([tr_pairs[:, 0], tr_pairs[:, 1]])
<del>tr_acc = compute_accuracy(pred, tr_y)
<del>pred = model.predict([te_pairs[:, 0], te_pairs[:, 1]])
<del>te_acc = compute_accuracy(pred, te_y)
<add>y_pred = model.predict([tr_pairs[:, 0], tr_pairs[:, 1]])
<add>tr_acc = compute_accuracy(tr_y, y_pred)
<add>y_pred = model.predict([te_pairs[:, 0], te_pairs[:, 1]])
<add>te_acc = compute_accuracy(te_y, y_pred)
<ide>
<ide> print('* Accuracy on training set: %0.2f%%' % (100 * tr_acc))
<ide> print('* Accuracy on test set: %0.2f%%' % (100 * te_acc)) | 1 |
Ruby | Ruby | use the tab in place of build during tests | 5ccce044ca04b9586667b538f818d4a018f21fa7 | <ide><path>Library/Homebrew/formula.rb
<ide> def verify_download_integrity fn
<ide> end
<ide>
<ide> def test
<del> # Adding the used options allows us to use `build.with?` inside of tests
<del> tab = Tab.for_name(name)
<del> tab.used_options.each { |opt| build.args << opt unless build.has_opposite_of? opt }
<add> @build = Tab.for_formula(self)
<ide> ret = nil
<ide> mktemp do
<ide> @testpath = Pathname.pwd | 1 |
PHP | PHP | add templates option to create() | 31003389b9865525da0b7d362918de30138adbb0 | <ide><path>src/View/Helper/FormHelper.php
<ide> protected function _isRequiredField($validationRules) {
<ide> * - `url` The URL the form submits to. Can be a string or a URL array. If you use 'url'
<ide> * you should leave 'action' undefined.
<ide> * - `encoding` Set the accept-charset encoding for the form. Defaults to `Configure::read('App.encoding')`
<add> * - `templates` The templates you want to use for this form. Any templates will be merged on top of
<add> * the already loaded templates. This option can either be a filename in App/Config that contains
<add> * the templates you want to load, or an array of templates to use. You can use
<add> * resetTemplates() to restore the original templates.
<ide> * - `context` Additional options for the context class. For example the EntityContext accepts a 'table'
<ide> * option that allows you to set the specific Table class the form should be based on.
<ide> * - `idPrefix` Prefix for generated ID attributes.
<ide> public function create($model = null, $options = []) {
<ide> 'action' => null,
<ide> 'url' => null,
<ide> 'encoding' => strtolower(Configure::read('App.encoding')),
<del> 'idPrefix' => null
<add> 'templates' => null,
<add> 'idPrefix' => null,
<ide> ];
<ide>
<ide> $this->_idPrefix = $options['idPrefix'];
<add>
<add> if (!empty($options['templates'])) {
<add> $this->templates($options['templates']);
<add> }
<add> unset($options['templates']);
<add>
<ide> $action = $this->url($this->_formUrl($context, $options));
<ide> unset($options['url'], $options['action'], $options['idPrefix']);
<ide>
<ide><path>tests/TestCase/View/Helper/FormHelperTest.php
<ide> public function testCreateGet() {
<ide> $this->assertTags($result, $expected);
<ide> }
<ide>
<add>/**
<add> * Test create() with the templates option.
<add> *
<add> * @return void
<add> */
<add> public function testCreateTemplates() {
<add> $result = $this->Form->create($this->article, [
<add> 'templates' => [
<add> 'formstart' => '<form class="form-horizontal"{{attrs}}>',
<add> ]
<add> ]);
<add> $expected = [
<add> 'form' => [
<add> 'class' => 'form-horizontal',
<add> 'method' => 'post',
<add> 'action' => '/articles/add',
<add> 'accept-charset' => 'utf-8'
<add> ]
<add> ];
<add> $this->assertTags($result, $expected);
<add> }
<add>
<ide> /**
<ide> * test the create() method
<ide> * | 2 |
Javascript | Javascript | move plugin into folder | faa56f175158a6c9d8868b40eec9329f0c64acce | <ide><path>lib/WebpackOptionsApply.js
<ide> const SourceMapDevToolPlugin = require("./SourceMapDevToolPlugin");
<ide> const EntryOptionPlugin = require("./EntryOptionPlugin");
<ide> const RecordIdsPlugin = require("./RecordIdsPlugin");
<ide>
<del>const InferAsyncModulesPlugin = require("./InferAsyncModulesPlugin");
<add>const InferAsyncModulesPlugin = require("./async-modules/InferAsyncModulesPlugin");
<ide> const RuntimePlugin = require("./RuntimePlugin");
<ide>
<ide> const APIPlugin = require("./APIPlugin");
<add><path>lib/async-modules/InferAsyncModulesPlugin.js
<del><path>lib/InferAsyncModulesPlugin.js
<ide>
<ide> "use strict";
<ide>
<del>const HarmonyImportDependency = require("./dependencies/HarmonyImportDependency");
<del>const HarmonyImportSideEffectDependency = require("./dependencies/HarmonyImportSideEffectDependency");
<del>const WebpackError = require("./WebpackError");
<add>const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency");
<add>const HarmonyImportSideEffectDependency = require("../dependencies/HarmonyImportSideEffectDependency");
<add>const WebpackError = require("../WebpackError");
<ide>
<del>/** @typedef {import("./Compiler")} Compiler */
<del>/** @typedef {import("./Module")} Module */
<add>/** @typedef {import("../Compiler")} Compiler */
<add>/** @typedef {import("../Module")} Module */
<ide>
<ide> class InferAsyncModulesPlugin {
<ide> constructor(options) { | 2 |
Python | Python | remove redundant method in kubernetesexecutor | bcb24373436962849cfc83d6d35389d7258da72c | <ide><path>airflow/executors/kubernetes_executor.py
<ide> For more information on how the KubernetesExecutor works, take a look at the guide:
<ide> :ref:`executor:KubernetesExecutor`
<ide> """
<del>import base64
<add>
<ide> import functools
<ide> import json
<ide> import multiprocessing
<ide> def clear_not_launched_queued_tasks(self, session=None) -> None:
<ide> TaskInstance.execution_date == task.execution_date,
<ide> ).update({TaskInstance.state: State.NONE})
<ide>
<del> def _inject_secrets(self) -> None:
<del> def _create_or_update_secret(secret_name, secret_path):
<del> try:
<del> return self.kube_client.create_namespaced_secret(
<del> self.kube_config.executor_namespace,
<del> kubernetes.client.V1Secret(
<del> data={'key.json': base64.b64encode(open(secret_path).read())},
<del> metadata=kubernetes.client.V1ObjectMeta(name=secret_name),
<del> ),
<del> **self.kube_config.kube_client_request_args,
<del> )
<del> except ApiException as e:
<del> if e.status == 409:
<del> return self.kube_client.replace_namespaced_secret(
<del> secret_name,
<del> self.kube_config.executor_namespace,
<del> kubernetes.client.V1Secret(
<del> data={'key.json': base64.b64encode(open(secret_path).read())},
<del> metadata=kubernetes.client.V1ObjectMeta(name=secret_name),
<del> ),
<del> **self.kube_config.kube_client_request_args,
<del> )
<del> self.log.exception(
<del> 'Exception while trying to inject secret. Secret name: %s, error details: %s',
<del> secret_name,
<del> e,
<del> )
<del> raise
<del>
<ide> def start(self) -> None:
<ide> """Starts the executor"""
<ide> self.log.info('Start Kubernetes executor')
<ide> def start(self) -> None:
<ide> self.kube_scheduler = AirflowKubernetesScheduler(
<ide> self.kube_config, self.task_queue, self.result_queue, self.kube_client, self.scheduler_job_id
<ide> )
<del> self._inject_secrets()
<ide> self.clear_not_launched_queued_tasks()
<ide>
<ide> def execute_async( | 1 |
Ruby | Ruby | fix numericdata.average test on ruby 2.6 | 89b4612ffc97e6648f5cf807906ae210e05acdda | <ide><path>activerecord/test/cases/calculations_test.rb
<ide> def test_should_return_integer_average_if_db_returns_such
<ide> assert_equal 3, value
<ide> end
<ide>
<del> def test_should_return_nil_as_average
<del> assert_nil NumericData.average(:bank_balance)
<add> def test_should_return_nil_to_d_as_average
<add> if nil.respond_to?(:to_d)
<add> assert_equal BigDecimal(0), NumericData.average(:bank_balance)
<add> else
<add> assert_nil NumericData.average(:bank_balance)
<add> end
<ide> end
<ide>
<ide> def test_should_get_maximum_of_field | 1 |
Text | Text | add new course for angular 2++ | edd427277756e9a3331f95a3cc935293906088d1 | <ide><path>guide/english/angular/angular-resources/index.md
<ide> A collection of helpful Angular resources
<ide> * <a href='https://frontendmasters.com/courses/building-apps-angular' target='_blank' rel='nofollow'>FrontendMasters - Building Awesomer Apps with Angular</a>
<ide> * <a href='https://ultimateangular.com/' target='_blank' rel='nofollow'>Ultimate Angular - Todd Motto</a>
<ide> * <a href='https://www.udemy.com/the-complete-guide-to-angular-2/' target='_blank' rel='nofollow'>Angular 6 (formerly Angular 2) - The Complete Guide($) Maximilian Schwarzmüller </a>
<add>* <a href='https://scrimba.com/g/gyourfirstangularapp' target='_blank' rel='nofollow'>Build your first Angular app (Free 33-part course) - Dan Wahlin </a>
<ide>
<ide> ## Blogs
<ide> | 1 |
Python | Python | add tests for generalized linalg functions | 9bfa19b11f38b5fe710d872db6a8628fc6a72359 | <ide><path>numpy/linalg/tests/test_linalg.py
<ide> def test_matrix_a_and_b(self):
<ide> b = matrix([2., 1.]).T
<ide> self.do(a, b)
<ide>
<del>
<ide> class LinalgNonsquareTestCase(object):
<ide> def test_single_nsq_1(self):
<ide> a = array([[1.,2.,3.], [3.,4.,6.]], dtype=single)
<ide> def test_cdouble_nsq_2_2(self):
<ide> self.do(a, b)
<ide>
<ide>
<del>class TestSolve(LinalgTestCase, TestCase):
<add>def _generalized_testcase(new_cls_name, old_cls):
<add> def get_method(old_name, new_name):
<add> def method(self):
<add> base = old_cls()
<add> def do(a, b):
<add> a = np.array([a, a, a])
<add> b = np.array([b, b, b])
<add> self.do(a, b)
<add> base.do = do
<add> getattr(base, old_name)()
<add> method.__name__ = new_name
<add> return method
<add>
<add> dct = dict()
<add> for old_name in dir(old_cls):
<add> if old_name.startswith('test_'):
<add> new_name = old_name + '_generalized'
<add> dct[new_name] = get_method(old_name, new_name)
<add>
<add> return type(new_cls_name, (object,), dct)
<add>
<add>LinalgGeneralizedTestCase = _generalized_testcase(
<add> 'LinalgGeneralizedTestCase', LinalgTestCase)
<add>LinalgGeneralizedNonsquareTestCase = _generalized_testcase(
<add> 'LinalgGeneralizedNonsquareTestCase', LinalgNonsquareTestCase)
<add>
<add>
<add>def dot_generalized(a, b):
<add> a = asarray(a)
<add> if a.ndim == 3:
<add> return np.array([dot(ax, bx) for ax, bx in zip(a, b)])
<add> elif a.ndim > 3:
<add> raise ValueError("Not implemented...")
<add> return dot(a, b)
<add>
<add>def identity_like_generalized(a):
<add> a = asarray(a)
<add> if a.ndim == 3:
<add> return np.array([identity(a.shape[-2]) for ax in a])
<add> elif a.ndim > 3:
<add> raise ValueError("Not implemented...")
<add> return identity(a.shape[0])
<add>
<add>
<add>class TestSolve(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> x = linalg.solve(a, b)
<del> assert_almost_equal(b, dot(a, x))
<add> assert_almost_equal(b, dot_generalized(a, x))
<ide> assert_(imply(isinstance(b, matrix), isinstance(x, matrix)))
<ide>
<ide>
<del>class TestInv(LinalgTestCase, TestCase):
<add>class TestInv(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> a_inv = linalg.inv(a)
<del> assert_almost_equal(dot(a, a_inv), identity(asarray(a).shape[0]))
<add> assert_almost_equal(dot_generalized(a, a_inv),
<add> identity_like_generalized(a))
<ide> assert_(imply(isinstance(a, matrix), isinstance(a_inv, matrix)))
<ide>
<ide>
<del>class TestEigvals(LinalgTestCase, TestCase):
<add>class TestEigvals(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> ev = linalg.eigvals(a)
<ide> evalues, evectors = linalg.eig(a)
<ide> assert_almost_equal(ev, evalues)
<ide>
<ide>
<del>class TestEig(LinalgTestCase, TestCase):
<add>class TestEig(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> evalues, evectors = linalg.eig(a)
<del> assert_almost_equal(dot(a, evectors), multiply(evectors, evalues))
<add> if evectors.ndim == 3:
<add> assert_almost_equal(dot_generalized(a, evectors), evectors * evalues[:,None,:])
<add> else:
<add> assert_almost_equal(dot(a, evectors), multiply(evectors, evalues))
<ide> assert_(imply(isinstance(a, matrix), isinstance(evectors, matrix)))
<ide>
<ide>
<del>class TestSVD(LinalgTestCase, TestCase):
<add>class TestSVD(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> u, s, vt = linalg.svd(a, 0)
<del> assert_almost_equal(a, dot(multiply(u, s), vt))
<add> if u.ndim == 3:
<add> assert_almost_equal(a, dot_generalized(u * s[:,None,:], vt))
<add> else:
<add> assert_almost_equal(a, dot(multiply(u, s), vt))
<ide> assert_(imply(isinstance(a, matrix), isinstance(u, matrix)))
<ide> assert_(imply(isinstance(a, matrix), isinstance(vt, matrix)))
<ide>
<ide>
<del>class TestCondSVD(LinalgTestCase, TestCase):
<add>class TestCondSVD(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> c = asarray(a) # a might be a matrix
<ide> s = linalg.svd(c, compute_uv=False)
<ide> def do(self, a, b):
<ide> assert_(imply(isinstance(a, matrix), isinstance(a_ginv, matrix)))
<ide>
<ide>
<del>class TestDet(LinalgTestCase, TestCase):
<add>class TestDet(LinalgTestCase, LinalgGeneralizedTestCase, TestCase):
<ide> def do(self, a, b):
<ide> d = linalg.det(a)
<ide> (s, ld) = linalg.slogdet(a)
<ide> def do(self, a, b):
<ide> else:
<ide> ad = asarray(a).astype(cdouble)
<ide> ev = linalg.eigvals(ad)
<del> assert_almost_equal(d, multiply.reduce(ev))
<del> assert_almost_equal(s * np.exp(ld), multiply.reduce(ev))
<del> if s != 0:
<del> assert_almost_equal(np.abs(s), 1)
<del> else:
<del> assert_equal(ld, -inf)
<add> assert_almost_equal(d, multiply.reduce(ev, axis=-1))
<add> assert_almost_equal(s * np.exp(ld), multiply.reduce(ev, axis=-1))
<add>
<add> s = np.atleast_1d(s)
<add> ld = np.atleast_1d(ld)
<add> m = (s != 0)
<add> assert_almost_equal(np.abs(s[m]), 1)
<add> assert_equal(ld[~m], -inf)
<ide>
<ide> def test_zero(self):
<ide> assert_equal(linalg.det([[0.0]]), 0.0)
<ide> def test_square(self):
<ide> class HermitianTestCase(object):
<ide> def test_single(self):
<ide> a = array([[1.,2.], [2.,1.]], dtype=single)
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_double(self):
<ide> a = array([[1.,2.], [2.,1.]], dtype=double)
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_csingle(self):
<ide> a = array([[1.,2+3j], [2-3j,1]], dtype=csingle)
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_cdouble(self):
<ide> a = array([[1.,2+3j], [2-3j,1]], dtype=cdouble)
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_empty(self):
<ide> a = atleast_2d(array([], dtype = double))
<del> assert_raises(linalg.LinAlgError, self.do, a)
<add> assert_raises(linalg.LinAlgError, self.do, a, None)
<ide>
<ide> def test_nonarray(self):
<ide> a = [[1,2], [2,1]]
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_matrix_b_only(self):
<ide> """Check that matrix type is preserved."""
<ide> a = array([[1.,2.], [2.,1.]])
<del> self.do(a)
<add> self.do(a, None)
<ide>
<ide> def test_matrix_a_and_b(self):
<ide> """Check that matrix type is preserved."""
<ide> a = matrix([[1.,2.], [2.,1.]])
<del> self.do(a)
<add> self.do(a, None)
<add>
<ide>
<add>HermitianGeneralizedTestCase = _generalized_testcase(
<add> 'HermitianGeneralizedTestCase', HermitianTestCase)
<ide>
<del>class TestEigvalsh(HermitianTestCase, TestCase):
<del> def do(self, a):
<add>class TestEigvalsh(HermitianTestCase, HermitianGeneralizedTestCase, TestCase):
<add> def do(self, a, b):
<ide> # note that eigenvalue arrays must be sorted since
<ide> # their order isn't guaranteed.
<ide> ev = linalg.eigvalsh(a)
<ide> evalues, evectors = linalg.eig(a)
<del> ev.sort()
<del> evalues.sort()
<add> ev.sort(axis=-1)
<add> evalues.sort(axis=-1)
<ide> assert_almost_equal(ev, evalues)
<ide>
<ide>
<del>class TestEigh(HermitianTestCase, TestCase):
<del> def do(self, a):
<add>class TestEigh(HermitianTestCase, HermitianGeneralizedTestCase, TestCase):
<add> def do(self, a, b):
<ide> # note that eigenvalue arrays must be sorted since
<ide> # their order isn't guaranteed.
<ide> ev, evc = linalg.eigh(a)
<ide> evalues, evectors = linalg.eig(a)
<del> ev.sort()
<del> evalues.sort()
<add> ev.sort(axis=-1)
<add> evalues.sort(axis=-1)
<ide> assert_almost_equal(ev, evalues)
<ide>
<ide> | 1 |
PHP | PHP | add doesntexpectjobs method | 1d8463250f8a44868d19df77aa701df8f39f1fe7 | <ide><path>src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
<ide> trait MocksApplicationServices
<ide> */
<ide> protected $firedEvents = [];
<ide>
<add> /**
<add> * All of the dispatched jobs.
<add> *
<add> * @var array
<add> */
<add> protected $dispatchedJobs = [];
<add>
<ide> /**
<ide> * Specify a list of events that should be fired for the given operation.
<ide> *
<ide> protected function withoutEvents()
<ide> */
<ide> protected function getFiredEvents(array $events)
<ide> {
<del> return array_filter($events, function ($event) {
<del> return $this->wasFired($event);
<del> });
<add> return $this->getDispatched($events, $this->firedEvents);
<ide> }
<ide>
<ide> /**
<del> * Check if the given event is fired.
<add> * Specify a list of jobs that should be dispatched for the given operation.
<ide> *
<del> * @param object|string $event
<del> * @return bool
<add> * These jobs will be mocked, so that handlers will not actually be executed.
<add> *
<add> * @param array|string $jobs
<add> * @return $this
<ide> */
<del> protected function wasFired($event)
<add> protected function expectsJobs($jobs)
<ide> {
<del> foreach ($this->firedEvents as $called) {
<del> if ((is_string($called) && $called === $event) ||
<del> (is_string($called) && is_subclass_of($called, $event)) ||
<del> (is_object($called) && $called instanceof $event)) {
<del> return true;
<add> $jobs = is_array($jobs) ? $jobs : func_get_args();
<add>
<add> $this->withoutJobs();
<add>
<add> $this->beforeApplicationDestroyed(function () use ($jobs) {
<add> $dispatched = $this->getDispatchedJobs($jobs);
<add>
<add> if ($jobsNotDispatched = array_diff($jobs, $dispatched)) {
<add> throw new Exception(
<add> 'These expected jobs were not dispatched: ['.implode(', ', $jobsNotDispatched).']'
<add> );
<ide> }
<del> }
<add> });
<ide>
<del> return false;
<add> return $this;
<ide> }
<ide>
<ide> /**
<del> * Specify a list of jobs that should be dispatched for the given operation.
<add> * Specify a list of jobs that should not be dispatched for the given operation.
<ide> *
<ide> * These jobs will be mocked, so that handlers will not actually be executed.
<ide> *
<ide> * @param array|string $jobs
<ide> * @return $this
<ide> */
<del> protected function expectsJobs($jobs)
<add> protected function doesntExpectJobs($jobs)
<ide> {
<ide> $jobs = is_array($jobs) ? $jobs : func_get_args();
<ide>
<del> $mock = Mockery::mock('Illuminate\Bus\Dispatcher[dispatch]', [$this->app]);
<add> $this->withoutJobs();
<ide>
<del> foreach ($jobs as $job) {
<del> $mock->shouldReceive('dispatch')->atLeast()->once()
<del> ->with(Mockery::type($job));
<del> }
<add> $this->beforeApplicationDestroyed(function () use ($jobs) {
<add> if ($dispatched = $this->getDispatchedJobs($jobs)) {
<add> throw new Exception(
<add> 'These unexpected jobs were dispatched: ['.implode(', ', $dispatched).']'
<add> );
<add> }
<add> });
<add>
<add> return $this;
<add> }
<add>
<add> /**
<add> * Mock the job dispatcher so all jobs are silenced and collected.
<add> *
<add> * @return $this
<add> */
<add> protected function withoutJobs()
<add> {
<add> $mock = Mockery::mock('Illuminate\Contracts\Bus\Dispatcher');
<add>
<add> $mock->shouldReceive('dispatch')->andReturnUsing(function ($dispatched) {
<add> $this->dispatchedJobs[] = $dispatched;
<add> });
<ide>
<ide> $this->app->instance(
<ide> 'Illuminate\Contracts\Bus\Dispatcher', $mock
<ide> );
<ide>
<ide> return $this;
<ide> }
<add>
<add> /**
<add> * Filter the given jobs against the dispatched jobs.
<add> *
<add> * @param array $jobs
<add> * @return array
<add> */
<add> protected function getDispatchedJobs(array $jobs)
<add> {
<add> return $this->getDispatched($jobs, $this->dispatchedJobs);
<add> }
<add>
<add> /**
<add> * Filter the given classes against an array of dispatched classes.
<add> *
<add> * @param array $classes
<add> * @param array $dispatched
<add> * @return array
<add> */
<add> protected function getDispatched(array $classes, array $dispatched)
<add> {
<add> return array_filter($classes, function ($class) use ($dispatched) {
<add> return $this->wasDispatched($class, $dispatched);
<add> });
<add> }
<add>
<add> /**
<add> * Check if the given class exists in an array of dispatched classes.
<add> *
<add> * @param string $needle
<add> * @param array $haystack
<add> * @return bool
<add> */
<add> protected function wasDispatched($needle, array $haystack)
<add> {
<add> foreach ($haystack as $dispatched) {
<add> if ((is_string($dispatched) && $dispatched === $needle) ||
<add> (is_string($dispatched) && is_subclass_of($dispatched, $needle)) ||
<add> (is_object($dispatched) && $dispatched instanceof $needle)) {
<add> return true;
<add> }
<add> }
<add>
<add> return false;
<add> }
<ide> } | 1 |
Text | Text | improve hints for cat photo app step 46 | 86901091a63d7ac16e31dcfe93551caeed153678 | <ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5f05a1d8e233dff4a68508d8.md
<ide> Create another radio button below the first one. Nest it inside a `label` elemen
<ide>
<ide> # --hints--
<ide>
<del>You will need to add a new `label` element in which to nest your new radio button. Make sure it has both an opening and closing tag.
<add>Only the original `Indoor` radio button `input` should have an `id` set to `indoor`. You can restart the step to get the original HTML back if needed.
<ide>
<ide> ```js
<del>assert(
<del> document.querySelectorAll('label').length === 2 &&
<del> code.match(/<\/label\>/g).length === 2
<del>);
<add>assert(document.querySelectorAll('#indoor').length < 2);
<ide> ```
<ide>
<del>The text ` Outdoor` should be located directly to the right of your new `radio` button. Make sure there is a space between the element and the text. You have either omitted the text or have a typo.
<add>You should not make any changes to the `Indoor` radio button. You can restart the step to get the original HTML back if needed.
<ide>
<ide> ```js
<del>const radioButtons = [...$('input')];
<add>const indoorInput = document.querySelectorAll('#indoor');
<ide> assert(
<del> radioButtons.filter((btn) =>
<del> btn.nextSibling.nodeValue.replace(/\s+/g, ' ').match(/ *Outdoor/i)
<del> ).length
<add> indoorInput.length == 1 &&
<add> indoorInput[0]?.nodeName?.toUpperCase() === 'INPUT' &&
<add> indoorInput[0]?.type === 'radio' &&
<add> code.match(/<label\s*>\s*<input [^>]*(id=["']?indoor["']?)[^>]*>\s*Indoor\s*<\/label>/)
<ide> );
<ide> ```
<ide>
<del>Your new radio button and associated label should be below the first one. You have them in the wrong order.
<add>You should add exactly one new `input` element nested in a new `label` element. Make sure your new `label` has both an opening and closing tag.
<add>
<add>```js
<add>assert(document.querySelectorAll('label input').length === 2);
<add>```
<add>
<add>You should not add any attributes to either opening `label` tag.
<add>
<add>```js
<add>assert(code.match(/<label\s*>/g).length === 2);
<add>```
<add>
<add>Your new `input` should have an `id` attribute with the value `outdoor`.
<add>
<add>```js
<add>assert(document.querySelector('label input[id="outdoor"]'));
<add>```
<add>
<add>Your new `input` should have a `type` attribute with the value `radio`.
<add>
<add>```js
<add>assert(document.querySelector('label input[id="outdoor"][type="radio"]'));
<add>```
<add>
<add>You should not add any new elements other than an `input` nested in a `label`.
<ide>
<ide> ```js
<del>const collection = [
<del> ...document.querySelectorAll('input[type="radio"]')
<del>].map((node) => node.nextSibling.nodeValue.replace(/\s+/g, ''));
<del>assert(collection.indexOf('Indoor') < collection.indexOf('Outdoor'));
<add>assert(document.querySelector('label input[id="outdoor"]:only-child'));
<add>```
<add>
<add>There should be no text to the left of your new `input`.
<add>
<add>```js
<add>const outdoorBtn = document.querySelector('label input[id="outdoor"]');
<add>assert(
<add> outdoorBtn?.previousSibling?.nodeName !== '#text' ||
<add> outdoorBtn?.previousSibling?.nodeValue?.replace(/\s/g, '') === ''
<add>);
<ide> ```
<ide>
<del>Your new radio button should have an `id` attribute. Check that there is a space after the opening tag's name and/or there are spaces before all attribute names.
<add>The label text for your new radio button must be exactly `Outdoor`. This includes capitalization.
<ide>
<ide> ```js
<del>assert($('input')[1].hasAttribute('id'));
<add>assert(document.querySelector('label > input[id="outdoor"]')?.nextSibling?.nodeValue?.replace(/^\s+|\s+$/g, '') === 'Outdoor');
<ide> ```
<ide>
<del>Your new radio button should have an `id` attribute with the value `outdoor`. You have either omitted the value or have a typo. Remember that attribute values should be surrounded with quotation marks.
<add>Your new radio button and label should be immediately below/after the `Indoor` radio button and label. There should be no other tags between them.
<ide>
<ide> ```js
<del>assert($('input')[1].id.match(/^outdoor$/));
<add>assert(code.match(/<\/label>\s*<label\s*>\s*<input [^>]+>\s*Outdoor/i));
<ide> ```
<ide>
<ide> # --seed-- | 1 |
Text | Text | add omitted word in readme | 95bb1579c48376bdc3818361fc4c946a4ce41033 | <ide><path>README.md
<ide> webpack can do many optimizations to **reduce the output size**. It also can mak
<ide>
<ide>
<ide>
<del># A small example what's possible
<add># A small example of what's possible
<ide>
<ide> ``` javascript
<ide> // webpack is a module bundler | 1 |
Ruby | Ruby | fix bug when url_for changes controller | e154823935859ae918ca26a7e73477d331e4a142 | <ide><path>actionpack/lib/action_dispatch/routing/route_set.rb
<ide> def normalize_options!
<ide>
<ide> if options[:controller]
<ide> options[:action] ||= 'index'
<del> options[:controller] = options[:controller].to_s
<add> options[:controller] = options[:controller].to_s.dup
<ide> end
<ide>
<ide> if options[:action]
<del> options[:action] = options[:action].to_s
<add> options[:action] = options[:action].to_s.dup
<ide> end
<ide> end
<ide>
<ide><path>actionpack/test/dispatch/routing_test.rb
<ide> def test_url_for_with_no_side_effects
<ide> assert_equal original_options, options
<ide> end
<ide>
<add> # checks that url_for doesn't change controller and action
<add> def test_url_for_with_no_side_effects_on_strings
<add> # freeze controller and action to be sure they are not changed
<add> # we'll get RuntimeError if somebody tries to modify them
<add> options = {:controller => '/projects'.freeze, :action => 'status'.freeze}
<add>
<add> url_for options
<add> end
<add>
<ide> # tests the arguments modification free version of define_hash_access
<ide> def test_named_route_with_no_side_effects
<ide> original_options = { :host => 'test.host' } | 2 |
Javascript | Javascript | fix error message check for openssl-1.0.2a | deb9d23d7b6f85f8631cd5fe804eb7e6411d4034 | <ide><path>test/parallel/test-tls-no-sslv3.js
<ide> server.listen(common.PORT, '127.0.0.1', function() {
<ide> });
<ide>
<ide> server.once('clientError', common.mustCall(function(err, conn) {
<del> assert(/SSL3_GET_CLIENT_HELLO:wrong version number/.test(err.message));
<add> assert(/:wrong version number/.test(err.message));
<ide> })); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.