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
PHP
PHP
update bladecompiler.php
65927fc67b27ddf861ffebdbadc7f87ea48cf934
<ide><path>src/Illuminate/View/Compilers/BladeCompiler.php <ide> protected function compileEndpush($expression) <ide> * @param string $expression <ide> * @return string <ide> */ <del> protected function stripParentheses($expression) <add> public function stripParentheses($expression) <ide> { <ide> if (Str::startsWith($expression, '(')) { <ide> $expression = substr($expression, 1, -1);
1
Text
Text
fix merge issue on docker-hub/builds.md
c37b4828dd1062a2e031344a536bf54147481a95
<ide><path>docs/sources/docker-hub/builds.md <ide> to Docker Hub. <ide> <ide> #### Creating an Automated Build <ide> <del><<<<<<< HEAD:docs/sources/docker-io/builds.md <del>You can [create an Automated <del>Build](https://index.docker.io/builds/bitbucket/select/) from any of <del>your public or private BitBucket repositories with a `Dockerfile`. <del>======= <del>You can [create a Trusted <del>Build](https://registry.hub.docker.com/builds/bitbucket/select/) <del>from any of your public or private BitBucket repositories with a <del>`Dockerfile`. <del>>>>>>>> Initial links:docs/sources/docker-hub/builds.md <add>You can [create an Automated Build]( <add>https://registry.hub.docker.com/builds/bitbucket/select/) from any of your <add>public or private BitBucket repositories with a `Dockerfile`. <ide> <ide> ### The Dockerfile and Automated Builds <ide>
1
Go
Go
use c to change interface name
ee39033073ece35e91c6c5a8cb66d23246511fb0
<ide><path>pkg/netlink/netlink_linux.go <ide> <ide> package netlink <ide> <add>/* <add>#include <string.h> <add>#include <errno.h> <add>#include <sys/ioctl.h> <add>#include <net/if.h> <add> <add>static int get_socket(void) { <add> int s_errno; <add> int fd; <add> <add> fd = socket(PF_INET, SOCK_DGRAM, 0); <add> if (fd >= 0) { <add> return fd; <add> } <add> s_errno = errno; <add> <add> fd = socket(PF_PACKET, SOCK_DGRAM, 0); <add> if (fd >= 0) { <add> return fd; <add> } <add> <add> fd = socket(PF_INET6, SOCK_DGRAM, 0); <add> if (fd >= 0) { <add> return fd; <add> } <add> errno = s_errno; <add> return -1; <add>} <add> <add> <add>static int change_name(const char *old_name, const char *new_name) { <add> struct ifreq ifr; <add> int err; <add> int fd; <add> <add> fd = get_socket(); <add> if (fd < 0) { <add> return -1; <add> } <add> <add> strncpy(ifr.ifr_name, old_name, IFNAMSIZ); <add> strncpy(ifr.ifr_newname, new_name, IFNAMSIZ); <add> <add> err = ioctl(fd, SIOCSIFNAME, &ifr); <add> if (err) { <add> close(fd); <add> return -1; <add> } <add> close(fd); <add> return err; <add>} <add>*/ <add>import "C" <add> <ide> import ( <ide> "encoding/binary" <ide> "fmt" <ide> done: <ide> <ide> return res, nil <ide> } <add> <add>func NetworkChangeName(oldName, newName string) error { <add> var ( <add> cold = C.CString(oldName) <add> cnew = C.CString(newName) <add> ) <add> <add> if errno := int(C.change_name(cold, cnew)); errno != 0 { <add> return fmt.Errorf("unable to change name %d", errno) <add> } <add> return nil <add>}
1
PHP
PHP
update another usage
ed32e0b39b90d609e53f2e95aa123d0ef8ffe198
<ide><path>lib/Cake/TestSuite/Fixture/CakeTestFixture.php <ide> public function init() { <ide> $records = $db->fetchAll($db->buildStatement($query, $model), false, $model->alias); <ide> <ide> if ($records !== false && !empty($records)) { <del> $this->records = Set::extract($records, '{n}.' . $model->alias); <add> $this->records = Hash::extract($records, '{n}.' . $model->alias); <ide> } <ide> } <ide> }
1
Ruby
Ruby
expect xcode 7.1.1
cbab4566dd9a36f5d37507490069f0989cf9dc5d
<ide><path>Library/Homebrew/os/mac.rb <ide> def preferred_arch <ide> "7.0" => { :clang => "7.0", :clang_build => 700 }, <ide> "7.0.1" => { :clang => "7.0", :clang_build => 700 }, <ide> "7.1" => { :clang => "7.0", :clang_build => 700 }, <add> "7.1.1" => { :clang => "7.0", :clang_build => 700 }, <ide> } <ide> <ide> def compilers_standard?
1
Javascript
Javascript
add minrotation support
3bef974c25e61c7f8b45fd105d59aca363906acd
<ide><path>src/core/core.scale.js <ide> module.exports = function(Chart) { <ide> // label settings <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide> module.exports = function(Chart) { <ide> var lastWidth = this.ctx.measureText(this.ticks[this.ticks.length - 1]).width; <ide> var firstRotated; <ide> <del> this.labelRotation = 0; <add> this.labelRotation = this.options.ticks.minRotation || 0; <ide> this.paddingRight = 0; <ide> this.paddingLeft = 0; <ide> <ide><path>test/core.helpers.tests.js <ide> describe('Core helper tests', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide> describe('Core helper tests', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide><path>test/scale.category.tests.js <ide> describe('Category scale tests', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide><path>test/scale.linear.tests.js <ide> describe('Linear Scale', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide> describe('Linear Scale', function() { <ide> } <ide> } <ide> }); <del> <add> <ide> var xScale = chartInstance.scales.xScale0; <ide> expect(xScale.getPixelForValue(1, 0, 0)).toBeCloseToPixel(501); // right - paddingRight <ide> expect(xScale.getPixelForValue(-1, 0, 0)).toBeCloseToPixel(41); // left + paddingLeft <ide><path>test/scale.logarithmic.tests.js <ide> describe('Logarithmic Scale tests', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide><path>test/scale.radialLinear.tests.js <ide> describe('Test the radial linear scale', function() { <ide> backdropPaddingY: 2, <ide> backdropPaddingX: 2, <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10, <ide><path>test/scale.time.tests.js <ide> describe('Time scale tests', function() { <ide> }, <ide> ticks: { <ide> beginAtZero: false, <add> minRotation: 0, <ide> maxRotation: 50, <ide> mirror: false, <ide> padding: 10,
7
Javascript
Javascript
fix text selection with hdpi screens
51c8e2f3ab543bd25ac69e8ecb4a0869fb978222
<ide><path>src/display/text_layer.js <ide> function appendText(task, geom, styles, ctx) { <ide> paddingRight: 0, <ide> paddingTop: 0, <ide> scale: 1, <add> fontSize: 0, <ide> } <ide> : { <ide> angle: 0, <ide> canvasWidth: 0, <ide> hasText: geom.str !== "", <ide> hasEOL: geom.hasEOL, <add> fontSize: 0, <ide> }; <ide> <ide> task._textDivs.push(textDiv); <ide> function appendText(task, geom, styles, ctx) { <ide> textDiv.style.fontSize = `${fontHeight}px`; <ide> textDiv.style.fontFamily = style.fontFamily; <ide> <add> textDivProperties.fontSize = fontHeight; <add> <ide> // Keeps screen readers from pausing on every new text span. <ide> textDiv.setAttribute("role", "presentation"); <ide> <ide> class TextLayerRenderTask { <ide> this._capability = createPromiseCapability(); <ide> this._renderTimer = null; <ide> this._bounds = []; <add> this._devicePixelRatio = globalThis.devicePixelRatio || 1; <ide> <ide> // Always clean-up the temporary canvas once rendering is no longer pending. <ide> this._capability.promise <ide> class TextLayerRenderTask { <ide> <ide> let transform = ""; <ide> if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) { <del> const { fontSize, fontFamily } = textDiv.style; <add> const { fontFamily } = textDiv.style; <add> const { fontSize } = textDivProperties; <ide> <ide> // Only build font string and set to context if different from last. <ide> if ( <ide> fontSize !== this._layoutTextLastFontSize || <ide> fontFamily !== this._layoutTextLastFontFamily <ide> ) { <del> this._layoutTextCtx.font = `${fontSize} ${fontFamily}`; <add> this._layoutTextCtx.font = `${ <add> fontSize * this._devicePixelRatio <add> }px ${fontFamily}`; <ide> this._layoutTextLastFontSize = fontSize; <ide> this._layoutTextLastFontFamily = fontFamily; <ide> } <ide> // Only measure the width for multi-char text divs, see `appendText`. <ide> const { width } = this._layoutTextCtx.measureText(textDiv.textContent); <ide> <ide> if (width > 0) { <del> const scale = textDivProperties.canvasWidth / width; <add> const scale = <add> (this._devicePixelRatio * textDivProperties.canvasWidth) / width; <ide> if (this._enhanceTextSelection) { <ide> textDivProperties.scale = scale; <ide> }
1
Ruby
Ruby
add install_formula helper method
15e8852128bfe0da12c02d105fabccbed3758b8e
<ide><path>Library/Homebrew/install.rb <ide> def install_formula?( <ide> elsif f.linked? <ide> message = "#{f.name} #{f.linked_version} is already installed" <ide> if f.outdated? && !head <del> return true unless Homebrew::EnvConfig.no_install_upgrade? <add> unless Homebrew::EnvConfig.no_install_upgrade? <add> puts "#{message} but outdated" <add> return true <add> end <ide> <ide> onoe <<~EOS <ide> #{message} <ide> def install_formula(formula_installer) <ide> <ide> f.print_tap_action <ide> <del> if f.linked? && f.outdated? && !f.head? && !Homebrew::EnvConfig.no_install_upgrade? <del> puts "#{f.full_name} #{f.linked_version} is installed but outdated" <del> kegs = Upgrade.outdated_kegs(f) <del> linked_kegs = kegs.select(&:linked?) <del> Upgrade.print_upgrade_message(f, formula_installer.options) <del> end <add> upgrade = f.linked? && f.outdated? && !f.head? && !Homebrew::EnvConfig.no_install_upgrade? <ide> <del> kegs.each(&:unlink) if kegs.present? <del> <del> formula_installer.install <del> formula_installer.finish <del> rescue FormulaInstallationAlreadyAttemptedError <del> # We already attempted to install f as part of the dependency tree of <del> # another formula. In that case, don't generate an error, just move on. <del> nil <del> ensure <del> # Re-link kegs if upgrade fails <del> begin <del> linked_kegs.each(&:link) if linked_kegs.present? && !f.latest_version_installed? <del> rescue <del> nil <del> end <add> Upgrade.install_formula(formula_installer, upgrade: upgrade) <ide> end <ide> private_class_method :install_formula <ide> end <ide><path>Library/Homebrew/upgrade.rb <ide> def create_formula_installer( <ide> def upgrade_formula(formula_installer, dry_run: false, verbose: false) <ide> formula = formula_installer.formula <ide> <del> kegs = outdated_kegs(formula) <del> linked_kegs = kegs.select(&:linked?) <del> <ide> if dry_run <ide> print_dry_run_dependencies(formula, formula_installer.compute_dependencies) <ide> return <ide> end <ide> <ide> formula_installer.check_installation_already_attempted <ide> <del> print_upgrade_message(formula, formula_installer.options) <add> install_formula(formula_installer, upgrade: true) <add> rescue BuildError => e <add> e.dump(verbose: verbose) <add> puts <add> Homebrew.failed = true <add> end <add> private_class_method :upgrade_formula <add> <add> def install_formula(formula_installer, upgrade:) <add> formula = formula_installer.formula <add> <add> if upgrade <add> print_upgrade_message(formula, formula_installer.options) <add> <add> kegs = outdated_kegs(formula) <add> linked_kegs = kegs.select(&:linked?) <add> end <ide> <ide> # first we unlink the currently active keg for this formula otherwise it is <ide> # possible for the existing build to interfere with the build we are about to <ide> # do! Seriously, it happens! <del> kegs.each(&:unlink) <add> kegs.each(&:unlink) if kegs.present? <ide> <ide> formula_installer.install <ide> formula_installer.finish <ide> rescue FormulaInstallationAlreadyAttemptedError <ide> # We already attempted to upgrade f as part of the dependency tree of <ide> # another formula. In that case, don't generate an error, just move on. <ide> nil <del> rescue BuildError => e <del> e.dump(verbose: verbose) <del> puts <del> Homebrew.failed = true <ide> ensure <ide> # restore previous installation state if build failed <ide> begin <del> linked_kegs.each(&:link) unless formula.latest_version_installed? <add> linked_kegs.each(&:link) if linked_kegs.present? && !f.latest_version_installed? <ide> rescue <ide> nil <ide> end <ide> end <del> private_class_method :upgrade_formula <ide> <ide> def check_broken_dependents(installed_formulae) <ide> CacheStoreDatabase.use(:linkage) do |db|
2
Javascript
Javascript
fix bugs related to paths with trailing slashes
bb1c03989f8702e06072e6d9228b52661bf00ace
<ide><path>lib/path.js <ide> if (isWindows) { <ide> // 'root' is just a slash, or nothing. <ide> var splitPathRe = <ide> /^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/; <add> var trailingSlash = /\/+$/; <ide> var splitPath = function(filename) { <add> <add> // removes trailing slashes before spliting the path <add> var tail = trailingSlash.exec(filename); <add> if (tail) { <add> if (tail.index === 0) return ['/', '', '', '']; <add> <add> filename = filename.slice(0, tail.index); <add> } <add> <ide> var result = splitPathRe.exec(filename); <ide> return [result[1] || '', result[2] || '', result[3] || '', result[4] || '']; <ide> }; <ide><path>test/simple/test-path.js <ide> var f = __filename; <ide> <ide> assert.equal(path.basename(f), 'test-path.js'); <ide> assert.equal(path.basename(f, '.js'), 'test-path'); <add>assert.equal(path.basename('/dir/basename.ext'), 'basename.ext'); <add>assert.equal(path.basename('/basename.ext'), 'basename.ext'); <add>assert.equal(path.basename('basename.ext'), 'basename.ext'); <add>assert.equal(path.basename('basename.ext/'), 'basename.ext'); <add>assert.equal(path.basename('basename.ext//'), 'basename.ext'); <ide> <ide> // POSIX filenames may include control characters <ide> // c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html <ide> assert.equal(path.dirname('/a/b/'), '/a'); <ide> assert.equal(path.dirname('/a/b'), '/a'); <ide> assert.equal(path.dirname('/a'), '/'); <ide> assert.equal(path.dirname('/'), '/'); <add>assert.equal(path.dirname('////'), '/'); <ide> <ide> if (isWindows) { <ide> assert.equal(path.dirname('c:\\'), 'c:\\'); <ide> assert.equal(path.extname('..file..'), '.'); <ide> assert.equal(path.extname('...'), '.'); <ide> assert.equal(path.extname('...ext'), '.ext'); <ide> assert.equal(path.extname('....'), '.'); <del>assert.equal(path.extname('file.ext/'), ''); <add>assert.equal(path.extname('file.ext/'), '.ext'); <add>assert.equal(path.extname('file.ext//'), '.ext'); <ide> <ide> if (isWindows) { <ide> // On windows, backspace is a path separator.
2
Javascript
Javascript
fix jquery.extend for older browsers - fixes #344
d9e44a37a01132ecba52d3415b13ff70eafe09d4
<ide><path>packages/ember-metal/lib/utils.js <ide> var EMPTY_META = { <ide> <ide> if (Object.freeze) Object.freeze(EMPTY_META); <ide> <add>var createMeta = Ember.platform.defineProperty.isSimulated ? o_create : function(meta) { return meta; }; <add> <ide> /** <ide> @private <ide> @function <ide> Ember.meta = function meta(obj, writable) { <ide> <ide> if (!ret) { <ide> o_defineProperty(obj, META_KEY, META_DESC); <del> ret = obj[META_KEY] = { <add> ret = obj[META_KEY] = createMeta({ <ide> descs: {}, <ide> watching: {}, <ide> values: {}, <ide> lastSetValues: {}, <ide> cache: {}, <ide> source: obj <del> }; <add> }); <ide> <ide> // make sure we don't accidentally try to create constructor like desc <ide> ret.descs.constructor = null; <ide> <ide> } else if (ret.source !== obj) { <del> ret = obj[META_KEY] = o_create(ret); <add> ret = o_create(ret); <ide> ret.descs = o_create(ret.descs); <ide> ret.values = o_create(ret.values); <ide> ret.watching = o_create(ret.watching); <ide> ret.lastSetValues = {}; <ide> ret.cache = {}; <ide> ret.source = obj; <add> ret = obj[META_KEY] = createMeta(ret); <ide> } <ide> return ret; <ide> }; <ide><path>packages/ember-metal/tests/utils/meta_test.js <ide> test("getMeta and setMeta", function() { <ide> Ember.setMeta(obj, 'foo', "bar"); <ide> equal(Ember.getMeta(obj, 'foo'), "bar", "foo property on meta now exists"); <ide> }); <add> <add>if (window.jQuery) { <add> // Tests fix for https://github.com/emberjs/ember.js/issues/344 <add> // This is primarily for older browsers such as IE8 <add> // We would use NativeArray but it's not defined in metal <add> test("jQuery.extend works on an extended Array", function() { <add> var mixin = Ember.Mixin.create({ prop: 'val' }) <add> array = mixin.apply([1,2,3]), <add> result = {}; <add> <add> jQuery.extend(true, result, { arr: array }); <add> <add> equals(result.arr.length, 3); <add> }); <add>}
2
Ruby
Ruby
remove outdated cross-origin redirection tests
3d70e9609760cb3046cf219cd49f3e9a838a0291
<ide><path>activestorage/test/controllers/blobs_controller_test.rb <ide> class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest <ide> assert_equal "max-age=300, private", @response.headers["Cache-Control"] <ide> end <ide> end <del> <del>if SERVICE_CONFIGURATIONS[:s3] && SERVICE_CONFIGURATIONS[:s3][:access_key_id].present? <del> class ActiveStorage::S3BlobsControllerTest < ActionDispatch::IntegrationTest <del> setup do <del> @old_service = ActiveStorage::Blob.service <del> ActiveStorage::Blob.service = ActiveStorage::Service.configure(:s3, SERVICE_CONFIGURATIONS) <del> end <del> <del> teardown do <del> ActiveStorage::Blob.service = @old_service <del> end <del> <del> test "allow redirection to the different host" do <del> blob = create_file_blob filename: "racecar.jpg" <del> <del> assert_nothing_raised { get rails_blob_url(blob) } <del> assert_response :redirect <del> assert_no_match @request.host, @response.headers["Location"] <del> ensure <del> blob.purge <del> end <del> end <del>else <del> puts "Skipping S3 redirection tests because no S3 configuration was supplied" <del>end <ide><path>activestorage/test/controllers/representations_controller_test.rb <ide> class ActiveStorage::RepresentationsControllerWithPreviewsTest < ActionDispatch: <ide> assert_response :not_found <ide> end <ide> end <del> <del>if SERVICE_CONFIGURATIONS[:s3] && SERVICE_CONFIGURATIONS[:s3][:access_key_id].present? <del> class ActiveStorage::S3RepresentationsControllerWithVariantsTest < ActionDispatch::IntegrationTest <del> setup do <del> @old_service = ActiveStorage::Blob.service <del> ActiveStorage::Blob.service = ActiveStorage::Service.configure(:s3, SERVICE_CONFIGURATIONS) <del> end <del> <del> teardown do <del> ActiveStorage::Blob.service = @old_service <del> end <del> <del> test "allow redirection to the different host" do <del> blob = create_file_blob filename: "racecar.jpg" <del> <del> assert_nothing_raised do <del> get rails_blob_representation_url( <del> filename: blob.filename, <del> signed_blob_id: blob.signed_id, <del> variation_key: ActiveStorage::Variation.encode(resize: "100x100")) <del> end <del> assert_response :redirect <del> assert_no_match @request.host, @response.headers["Location"] <del> ensure <del> blob.purge <del> end <del> end <del>else <del> puts "Skipping S3 redirection tests because no S3 configuration was supplied" <del>end
2
Javascript
Javascript
add support for internal fb primer
503fd82b423bbce20cb366afcf670ae5329f3995
<ide><path>packages/react-dom/src/events/DOMModernPluginEventSystem.js <ide> import { <ide> TOP_PROGRESS, <ide> TOP_PLAYING, <ide> } from './DOMTopLevelEventTypes'; <add>import {DOCUMENT_NODE} from '../shared/HTMLNodeType'; <add> <add>import {enableLegacyFBPrimerSupport} from 'shared/ReactFeatureFlags'; <ide> <ide> const capturePhaseEvents = new Set([ <ide> TOP_FOCUS, <ide> export function listenToEvent( <ide> } <ide> } <ide> <add>const validFBLegacyPrimerRels = new Set([ <add> 'dialog', <add> 'dialog-post', <add> 'async', <add> 'async-post', <add> 'theater', <add> 'toggle', <add>]); <add> <add>function willDeferLaterForFBLegacyPrimer(nativeEvent: any): boolean { <add> let node = nativeEvent.target; <add> const type = nativeEvent.type; <add> if (type !== 'click') { <add> return false; <add> } <add> while (node !== null) { <add> // Primer works by intercepting a click event on an <a> element <add> // that has a "rel" attribute that matches one of the valid ones <add> // in the Set above. If we intercept this before Primer does, we <add> // will need to defer the current event till later and discontinue <add> // execution of the current event. To do this we can add a document <add> // event listener and continue again later after propagation. <add> if (node.tagName === 'A' && validFBLegacyPrimerRels.has(node.rel)) { <add> const legacyFBSupport = true; <add> const isCapture = nativeEvent.eventPhase === 1; <add> trapEventForPluginEventSystem( <add> document, <add> ((type: any): DOMTopLevelEventType), <add> isCapture, <add> legacyFBSupport, <add> ); <add> return true; <add> } <add> node = node.parentNode; <add> } <add> return false; <add>} <add> <ide> export function dispatchEventForPluginEventSystem( <ide> topLevelType: DOMTopLevelEventType, <ide> eventSystemFlags: EventSystemFlags, <ide> export function dispatchEventForPluginEventSystem( <ide> rootContainer: Document | Element, <ide> ): void { <ide> let ancestorInst = targetInst; <add> if (rootContainer.nodeType !== DOCUMENT_NODE) { <add> // If we detect the FB legacy primer system, we <add> // defer the event to the "document" with a one <add> // time event listener so we can defer the event. <add> if ( <add> enableLegacyFBPrimerSupport && <add> willDeferLaterForFBLegacyPrimer(nativeEvent) <add> ) { <add> return; <add> } <add> } <ide> <ide> batchedEventUpdates(() => <ide> dispatchEventsForPlugins( <ide><path>packages/react-dom/src/events/ReactDOMEventListener.js <ide> import {passiveBrowserEventsSupported} from './checkPassiveEvents'; <ide> import { <ide> enableDeprecatedFlareAPI, <ide> enableModernEventSystem, <add> enableLegacyFBPrimerSupport, <ide> } from 'shared/ReactFeatureFlags'; <ide> import { <ide> UserBlockingEvent, <ide> export function trapEventForPluginEventSystem( <ide> container: Document | Element, <ide> topLevelType: DOMTopLevelEventType, <ide> capture: boolean, <add> legacyFBSupport?: boolean, <ide> ): void { <ide> let listener; <ide> let listenerWrapper; <ide> export function trapEventForPluginEventSystem( <ide> ); <ide> <ide> const rawEventName = getRawEventName(topLevelType); <add> let fbListener; <add> <add> // When legacyFBSupport is enabled, it's for when we <add> // want to add a one time event listener to a container. <add> // This should only be used with enableLegacyFBPrimerSupport <add> // due to requirement to provide compatibility with <add> // internal FB www event tooling. This works by removing <add> // the event listener as soon as it is invoked. We could <add> // also attempt to use the {once: true} param on <add> // addEventListener, but that requires support and some <add> // browsers do not support this today, and given this is <add> // to support legacy code patterns, it's likely they'll <add> // need support for such browsers. <add> if (enableLegacyFBPrimerSupport && legacyFBSupport) { <add> const originalListener = listener; <add> listener = function(...p) { <add> try { <add> return originalListener.apply(this, p); <add> } finally { <add> if (fbListener) { <add> fbListener.remove(); <add> } else { <add> container.removeEventListener( <add> ((rawEventName: any): string), <add> (listener: any), <add> ); <add> } <add> } <add> }; <add> } <ide> if (capture) { <del> addEventCaptureListener(container, rawEventName, listener); <add> fbListener = addEventCaptureListener(container, rawEventName, listener); <ide> } else { <del> addEventBubbleListener(container, rawEventName, listener); <add> fbListener = addEventBubbleListener(container, rawEventName, listener); <ide> } <ide> } <ide> <ide><path>packages/react-dom/src/events/__tests__/DOMModernPluginEventSystem-test.internal.js <ide> describe('DOMModernPluginEventSystem', () => { <ide> expect(log[4]).toEqual(['bubble', divElement]); <ide> expect(log[5]).toEqual(['bubble', buttonElement]); <ide> }); <add> <add> it('handle propagation of click events correctly with FB primer', () => { <add> ReactFeatureFlags.enableLegacyFBPrimerSupport = true; <add> const aRef = React.createRef(); <add> <add> const log = []; <add> // Stop propagation throught the React system <add> const onClick = jest.fn(e => e.stopPropagation()); <add> const onDivClick = jest.fn(); <add> <add> function Test() { <add> return ( <add> <div onClick={onDivClick}> <add> <a ref={aRef} href="#" onClick={onClick} rel="dialog"> <add> Click me <add> </a> <add> </div> <add> ); <add> } <add> ReactDOM.render(<Test />, container); <add> <add> // Fake primer <add> document.addEventListener('click', e => { <add> if (e.target.rel === 'dialog') { <add> log.push('primer'); <add> } <add> }); <add> let aElement = aRef.current; <add> dispatchClickEvent(aElement); <add> expect(onClick).toHaveBeenCalledTimes(1); <add> expect(log).toEqual(['primer']); <add> expect(onDivClick).toHaveBeenCalledTimes(0); <add> <add> log.length = 0; <add> // This isn't something that should be picked up by Primer <add> function Test2() { <add> return ( <add> <div onClick={onDivClick}> <add> <a ref={aRef} href="#" onClick={onClick} rel="dialog-foo"> <add> Click me <add> </a> <add> </div> <add> ); <add> } <add> ReactDOM.render(<Test2 />, container); <add> dispatchClickEvent(aElement); <add> expect(onClick).toHaveBeenCalledTimes(1); <add> expect(log).toEqual([]); <add> expect(onDivClick).toHaveBeenCalledTimes(0); <add> }); <ide> }); <ide><path>packages/shared/ReactFeatureFlags.js <ide> export const warnUnstableRenderSubtreeIntoContainer = false; <ide> <ide> // Modern event system where events get registered at roots <ide> export const enableModernEventSystem = false; <add> <add>// Support legacy Primer support on internal FB www <add>export const enableLegacyFBPrimerSupport = false; <ide><path>packages/shared/forks/ReactFeatureFlags.native-fb.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = true; <ide><path>packages/shared/forks/ReactFeatureFlags.native-oss.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.persistent.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.test-renderer.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.test-renderer.www.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.testing.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = false; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.testing.www.js <ide> export const deferPassiveEffectCleanupDuringUnmount = false; <ide> export const runAllPassiveEffectDestroysBeforeCreates = false; <ide> export const enableModernEventSystem = false; <ide> export const warnAboutSpreadingKeyToJSX = false; <add>export const enableLegacyFBPrimerSupport = !__EXPERIMENTAL__; <ide> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide><path>packages/shared/forks/ReactFeatureFlags.www.js <ide> export const warnUnstableRenderSubtreeIntoContainer = false; <ide> <ide> export const enableModernEventSystem = false; <ide> <add>export const enableLegacyFBPrimerSupport = !__EXPERIMENTAL__; <add> <ide> // Internal-only attempt to debug a React Native issue. See D20130868. <ide> export const throwEarlyForMysteriousError = false; <ide>
12
Javascript
Javascript
fix scroll-to-top in marketplace
ae2f556c71ff1e83690ca082604c30cac574f340
<ide><path>Libraries/ReactIOS/YellowBox.js <ide> class YellowBox extends React.Component { <ide> ]; <ide> return ( <ide> <View style={inspector ? styles.fullScreen : listStyle}> <del> <ScrollView style={listStyle}> <add> <ScrollView style={listStyle} scrollsToTop={false}> <ide> {rows} <ide> </ScrollView> <ide> {inspector}
1
PHP
PHP
fix param type in docblock
ecaa0bd8ee7cb4fda09b5e76634be5ed6e806658
<ide><path>src/Shell/PluginAssetsShell.php <ide> class PluginAssetsShell extends Shell { <ide> * fallbacks to copying the assets. For vendor namespaced plugin, parent folder <ide> * for vendor name are created if required. <ide> * <del> * @param string|string $name Name of plugin for which to symlink assets. <add> * @param string|null $name Name of plugin for which to symlink assets. <ide> * If null all plugins will be processed. <ide> * @return void <ide> */ <ide> public function symlink($name = null) { <ide> * Copying plugin assets to app's webroot. For vendor namespaced plugin, <ide> * parent folder for vendor name are created if required. <ide> * <del> * @param string|string $name Name of plugin for which to symlink assets. <add> * @param string|null $name Name of plugin for which to symlink assets. <ide> * If null all plugins will be processed. <ide> * @return void <ide> */
1
Ruby
Ruby
add test for update_attributes and identity map
6b0b95f1bd92e2ef35573cb59e8a14bd3ffb3777
<ide><path>activerecord/test/cases/identity_map_test.rb <ide> def test_reload_object_if_forced_save_failed <ide> assert_not_equal developer.salary, same_developer.salary <ide> end <ide> <add> def test_reload_object_if_update_attributes_fails <add> developer = Developer.first <add> developer.salary = 0 <add> <add> assert !developer.update_attributes(:salary => 0) <add> <add> same_developer = Developer.first <add> <add> assert_not_same developer, same_developer <add> assert_not_equal 0, same_developer.salary <add> assert_not_equal developer.salary, same_developer.salary <add> end <add> <ide> end
1
Python
Python
add python3 support
312120272f6ce403cd7fa3a88fed636786b202eb
<ide><path>keras/layers/core.py <ide> class Lambda(Layer): <ide> def __init__(self, function, output_shape, ndim=2): <ide> super(Lambda, self).__init__() <ide> self.input = ndim_tensor(ndim) <del> self.function = marshal.dumps(function.func_code) <add> py3 = sys.version_info[0] == 3 <add> if py3: <add> self.function = marshal.dumps(function.__code__) <add> else: <add> self.function = marshal.dumps(function.func_code) <ide> if type(output_shape) in {tuple, list}: <ide> self._output_shape = tuple(output_shape) <ide> else: <del> self._output_shape = marshal.dumps(output_shape.func_code) <del> <add> if py3: <add> self._output_shape = marshal.dumps(output_shape.__code__) <add> else: <add> self._output_shape = marshal.dumps(output_shape.func_code) <ide> @property <ide> def output_shape(self): <ide> if type(self._output_shape) == tuple:
1
Text
Text
replace the outdated flag
7e2d7f0c9858484f57e53d06101e6a22a1294f9f
<ide><path>docs/SignedAPKAndroid.md <ide> The generated APK can be found under `android/app/build/outputs/apk/app-release. <ide> Before uploading the release build to the Play Store, make sure you test it thoroughly. Install it on the device using: <ide> <ide> ```sh <del>$ react-native run-android --configuration=release <add>$ react-native run-android --variant=release <ide> ``` <ide> <del>Note that `--configuration=release` is only available if you've set up signing as described above. <add>Note that `--variant=release` is only available if you've set up signing as described above. <ide> <ide> You can kill any running packager instances, all your and framework JavaScript code is bundled in the APK's assets. <ide>
1
Ruby
Ruby
add documentation for arel and build_arel
c0e186c1555f43f53df70c1736de7047d5f4e678
<ide><path>activerecord/lib/active_record/relation/query_methods.rb <ide> def reverse_order! <ide> self <ide> end <ide> <add> # Returns the Arel object associated with the relation. <ide> def arel <ide> @arel ||= with_default_scope.build_arel <ide> end <ide> <add> # Like #arel, but ignores the default scope of the model. <ide> def build_arel <ide> arel = Arel::SelectManager.new(table.engine, table) <ide>
1
Text
Text
update outdated formula references for node
83f62d1fad34f98f7d360f2a84932040fdeb06b1
<ide><path>docs/Node-for-Formula-Authors.md <ide> Node modules which are compatible with the latest Node version should declare a <ide> depends_on "node" <ide> ``` <ide> <del>If your formula requires being executed with an older Node version you should use one of the versioned node formulae (e.g. `node@6`). <add>If your formula requires being executed with an older Node version you should use one of the versioned node formulae (e.g. `node@12`). <ide> <ide> ### Special requirements for native addons <ide> <del>If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `"python"` (because GYP depends on Python 2.7). <add>If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `"python"` (because GYP depends on Python). <ide> <ide> ```ruby <ide> depends_on "python" => :build <ide> This will install your Node module in npm's global module style with a custom pr <ide> bin.install_symlink Dir["#{libexec}/bin/*"] <ide> ``` <ide> <del>**Note:** Because of a required workaround for `npm@5` calling `npm pack` we currently don't support installing modules (from non-npm registry tarballs), which require a prepublish step (e.g. for transpiling sources). See [Homebrew/brew#2820](https://github.com/Homebrew/brew/pull/2820) for more information. <del> <ide> ### Installing module dependencies locally with `local_npm_install_args` <ide> <ide> In your formula's `install` method, do any installation steps which need to be done before the `npm install` step and then `cd` to the top level of the included Node module. Then, use `system` with `Language::Node.local_npm_install_args` to invoke `npm install` like:
1
Javascript
Javascript
check callback not invoked on lookup error
c20c57028211797b5ff5b3bc05d6eb05ab81ef9f
<ide><path>test/parallel/test-dns-lookup.js <ide> assert.throws(() => { <ide> hints: 100, <ide> family: 0, <ide> all: false <del> }, common.noop); <add> }, common.mustNotCall()); <ide> }, /^TypeError: Invalid argument: hints must use valid flags$/); <ide> <ide> assert.throws(() => { <ide> dns.lookup(false, { <ide> hints: 0, <ide> family: 20, <ide> all: false <del> }, common.noop); <add> }, common.mustNotCall()); <ide> }, /^TypeError: Invalid argument: family must be 4 or 6$/); <ide> <ide> assert.doesNotThrow(() => {
1
Go
Go
pass terminal setting to display utils
8b0cd60019b33488f8819da5c7bdd28d1d3fc737
<ide><path>commands.go <ide> func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer, h <ide> } <ide> <ide> if matchesContentType(resp.Header.Get("Content-Type"), "application/json") { <del> return utils.DisplayJSONMessagesStream(resp.Body, out) <add> return utils.DisplayJSONMessagesStream(resp.Body, out, cli.isTerminal) <ide> } <ide> if _, err := io.Copy(out, resp.Body); err != nil { <ide> return err <ide><path>utils/utils.go <ide> func NewHTTPRequestError(msg string, res *http.Response) error { <ide> } <ide> } <ide> <del>func (jm *JSONMessage) Display(out io.Writer) error { <add>func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error { <ide> if jm.Error != nil { <ide> if jm.Error.Code == 401 { <ide> return fmt.Errorf("Authentication is required.") <ide> } <ide> return jm.Error <ide> } <del> fmt.Fprintf(out, "%c[2K\r", 27) <add> endl := "" <add> if isTerminal { <add> // <ESC>[2K = erase entire current line <add> fmt.Fprintf(out, "%c[2K\r", 27) <add> endl = "\r" <add> } <ide> if jm.Time != 0 { <ide> fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0)) <ide> } <ide> func (jm *JSONMessage) Display(out io.Writer) error { <ide> fmt.Fprintf(out, "(from %s) ", jm.From) <ide> } <ide> if jm.Progress != "" { <del> fmt.Fprintf(out, "%s %s\r", jm.Status, jm.Progress) <add> fmt.Fprintf(out, "%s %s%s", jm.Status, jm.Progress, endl) <ide> } else { <del> fmt.Fprintf(out, "%s\r\n", jm.Status) <add> fmt.Fprintf(out, "%s%s\n", jm.Status, endl) <ide> } <ide> return nil <ide> } <ide> <del>func DisplayJSONMessagesStream(in io.Reader, out io.Writer) error { <add>func DisplayJSONMessagesStream(in io.Reader, out io.Writer, isTerminal bool) error { <ide> dec := json.NewDecoder(in) <ide> ids := make(map[string]int) <ide> diff := 0 <ide> func DisplayJSONMessagesStream(in io.Reader, out io.Writer) error { <ide> } else { <ide> diff = len(ids) - line <ide> } <del> fmt.Fprintf(out, "%c[%dA", 27, diff) <add> if isTerminal { <add> // <ESC>[{diff}A = move cursor up diff rows <add> fmt.Fprintf(out, "%c[%dA", 27, diff) <add> } <ide> } <del> err := jm.Display(out) <add> err := jm.Display(out, isTerminal) <ide> if jm.ID != "" { <del> fmt.Fprintf(out, "%c[%dB", 27, diff) <add> if isTerminal { <add> // <ESC>[{diff}B = move cursor down diff rows <add> fmt.Fprintf(out, "%c[%dB", 27, diff) <add> } <ide> } <ide> if err != nil { <ide> return err
2
PHP
PHP
allow easy viewfactory override
f336c75b2c3c8e49e13154c9029d4816fd341639
<ide><path>src/Illuminate/View/ViewServiceProvider.php <ide> public function registerFactory() <ide> <ide> $finder = $app['view.finder']; <ide> <del> $env = new Factory($resolver, $finder, $app['events']); <add> $env = $this->newFactory($resolver, $finder, $app['events']); <ide> <ide> // We will also set the container instance on this view environment since the <ide> // view composers may be classes registered in the container, which allows <ide> public function registerBladeEngine($resolver) <ide> return new CompilerEngine($this->app['blade.compiler']); <ide> }); <ide> } <add> <add> /** <add> * Create a new Factory Instance. <add> * <add> * @param EngineResolver $resolver <add> * @param FileViewFinder $finder <add> * @param $events <add> * @return Factory <add> */ <add> protected function newFactory($resolver, $finder, $events) <add> { <add> return new Factory($resolver, $finder, $events); <add> } <ide> }
1
Text
Text
fix readme with google analytics
312572d02028fe980b4a81cdef5833c168bb4278
<ide><path>examples/with-google-analytics/README.md <ide> # Example app with analytics <ide> <del>This example shows how to use [Next.js](https://github.com/vercel/next.js) along with [Google Analytics](https://developers.google.com/analytics/devguides/collection/gtagjs/). A custom [\_document](https://nextjs.org/docs/advanced-features/custom-document) is used to inject [tracking snippet](https://developers.google.com/analytics/devguides/collection/gtagjs/) and track [pageviews](https://developers.google.com/analytics/devguides/collection/gtagjs/pages) and [event](https://developers.google.com/analytics/devguides/collection/gtagjs/events). <add>This example shows how to use [Next.js](https://github.com/vercel/next.js) along with [Google Analytics](https://developers.google.com/analytics/devguides/collection/gtagjs/). A custom [\_app](https://nextjs.org/docs/advanced-features/custom-app) is used to inject [tracking snippet](https://developers.google.com/analytics/devguides/collection/gtagjs/) and track [pageviews](https://developers.google.com/analytics/devguides/collection/gtagjs/pages) and [event](https://developers.google.com/analytics/devguides/collection/gtagjs/events). <ide> <ide> ## Deploy your own <ide> <ide> Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu <ide> <ide> ## How to use <ide> <del>Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <add>Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-google-analytics with-google-analytics-app
1
Ruby
Ruby
remove redundant test
533472dfe9d9252a2df3a4ce76d867d8df54d375
<ide><path>actionpack/test/dispatch/request_test.rb <ide> class RequestMethod < BaseRequestTest <ide> end <ide> end <ide> <del> test "restrict method hacking" do <del> [:get, :patch, :put, :delete].each do |method| <del> request = stub_request( <del> 'action_dispatch.request.request_parameters' => { :_method => 'put' }, <del> 'REQUEST_METHOD' => method.to_s.upcase <del> ) <del> <del> assert_equal method.to_s.upcase, request.method <del> end <del> end <del> <ide> test "post masquerading as patch" do <ide> request = stub_request( <ide> 'REQUEST_METHOD' => 'PATCH',
1
Javascript
Javascript
apply linux workaround to linux only
ad36ea56fc41d77ee3a35e14f96667293402296f
<ide><path>test/common.js <ide> var opensslCli = null; <ide> var inFreeBSDJail = null; <ide> var localhostIPv4 = null; <ide> <del>exports.localIPv6Hosts = [ <del> // Debian/Ubuntu <del> 'ip6-localhost', <del> 'ip6-loopback', <del> <del> // SUSE <del> 'ipv6-localhost', <del> 'ipv6-loopback', <del> <del> // Typically universal <del> 'localhost', <del>]; <add>exports.localIPv6Hosts = ['localhost']; <add>if (process.platform === 'linux') { <add> exports.localIPv6Hosts = [ <add> // Debian/Ubuntu <add> 'ip6-localhost', <add> 'ip6-loopback', <add> <add> // SUSE <add> 'ipv6-localhost', <add> 'ipv6-loopback', <add> <add> // Typically universal <add> 'localhost', <add> ]; <add>} <ide> <ide> Object.defineProperty(exports, 'inFreeBSDJail', { <ide> get: function() {
1
Javascript
Javascript
log the updatequeue in dumptree
27d1210c1d00e9b34839fd5596a74d8af52ffa7f
<ide><path>src/renderers/noop/ReactNoop.js <ide> 'use strict'; <ide> <ide> import type { Fiber } from 'ReactFiber'; <add>import type { UpdateQueue } from 'ReactFiberUpdateQueue'; <ide> import type { HostChildren } from 'ReactFiberReconciler'; <ide> <ide> var ReactFiberReconciler = require('ReactFiberReconciler'); <ide> var ReactNoop = { <ide> return; <ide> } <ide> <add> var bufferedLog = []; <add> function log(...args) { <add> bufferedLog.push(...args, '\n'); <add> } <add> <ide> function logHostInstances(children: Array<Instance>, depth) { <ide> for (var i = 0; i < children.length; i++) { <ide> var child = children[i]; <del> console.log(' '.repeat(depth) + '- ' + child.type + '#' + child.id); <add> log(' '.repeat(depth) + '- ' + child.type + '#' + child.id); <ide> logHostInstances(child.children, depth + 1); <ide> } <ide> } <ide> function logContainer(container : Container, depth) { <del> console.log(' '.repeat(depth) + '- [root#' + container.rootID + ']'); <add> log(' '.repeat(depth) + '- [root#' + container.rootID + ']'); <ide> logHostInstances(container.children, depth + 1); <ide> } <ide> <add> function logUpdateQueue(updateQueue : UpdateQueue, depth) { <add> log( <add> ' '.repeat(depth + 1) + 'QUEUED UPDATES', <add> updateQueue.isReplace ? 'is replace' : '', <add> updateQueue.isForced ? 'is forced' : '' <add> ); <add> log( <add> ' '.repeat(depth + 1) + '~', <add> updateQueue.partialState, <add> updateQueue.callback ? 'with callback' : '' <add> ); <add> var next; <add> while (next = updateQueue.next) { <add> log( <add> ' '.repeat(depth + 1) + '~', <add> next.partialState, <add> next.callback ? 'with callback' : '' <add> ); <add> } <add> } <add> <ide> function logFiber(fiber : Fiber, depth) { <del> console.log( <add> log( <ide> ' '.repeat(depth) + '- ' + (fiber.type ? fiber.type.name || fiber.type : '[root]'), <ide> '[' + fiber.pendingWorkPriority + (fiber.pendingProps ? '*' : '') + ']' <ide> ); <add> if (fiber.updateQueue) { <add> logUpdateQueue(fiber.updateQueue, depth); <add> } <ide> const childInProgress = fiber.progressedChild; <ide> if (childInProgress && childInProgress !== fiber.child) { <del> console.log(' '.repeat(depth + 1) + 'IN PROGRESS: ' + fiber.progressedPriority); <add> log(' '.repeat(depth + 1) + 'IN PROGRESS: ' + fiber.progressedPriority); <ide> logFiber(childInProgress, depth + 1); <ide> if (fiber.child) { <del> console.log(' '.repeat(depth + 1) + 'CURRENT'); <add> log(' '.repeat(depth + 1) + 'CURRENT'); <ide> } <add> } else if (fiber.child && fiber.updateQueue) { <add> log(' '.repeat(depth + 1) + 'CHILDREN'); <ide> } <ide> if (fiber.child) { <ide> logFiber(fiber.child, depth + 1); <ide> var ReactNoop = { <ide> } <ide> } <ide> <del> console.log('HOST INSTANCES:'); <add> log('HOST INSTANCES:'); <ide> logContainer(rootContainer, 0); <del> console.log('FIBERS:'); <add> log('FIBERS:'); <ide> logFiber((root.stateNode : any).current, 0); <add> <add> console.log(...bufferedLog); <ide> }, <ide> <ide> };
1
Ruby
Ruby
generalize has_tag? to has_ref?
612745352d960a17b4dbaaf08987959ff8370898
<ide><path>Library/Homebrew/download_strategy.rb <ide> def git_dir <ide> @clone.join(".git") <ide> end <ide> <del> def has_tag?(tag) <del> quiet_system @@git, '--git-dir', git_dir, 'rev-parse', '-q', '--verify', tag <add> def has_ref? <add> quiet_system @@git, '--git-dir', git_dir, 'rev-parse', '-q', '--verify', @ref <ide> end <ide> <ide> def support_depth? <ide> def config_repo <ide> end <ide> <ide> def update_repo <del> unless @spec == :tag && has_tag?(@ref) <add> unless @spec == :tag && has_ref? <ide> quiet_safe_system @@git, 'fetch', 'origin' <ide> end <ide> end
1
Javascript
Javascript
allow tab+alt on mac in focus responder
63fe08eef56f92956c2d785701cad7f743501e35
<ide><path>packages/react-events/src/Focus.js <ide> type FocusEvent = {| <ide> timeStamp: number, <ide> |}; <ide> <add>const isMac = <add> typeof window !== 'undefined' && window.navigator != null <add> ? /^Mac/.test(window.navigator.platform) <add> : false; <add> <ide> const targetEventTypes = [ <ide> {name: 'focus', passive: true}, <ide> {name: 'blur', passive: true}, <ide> const FocusResponder = { <ide> const nativeEvent = event.nativeEvent; <ide> if ( <ide> nativeEvent.key === 'Tab' && <del> !(nativeEvent.metaKey || nativeEvent.altKey || nativeEvent.ctrlKey) <add> !( <add> nativeEvent.metaKey || <add> (!isMac && nativeEvent.altKey) || <add> nativeEvent.ctrlKey <add> ) <ide> ) { <ide> state.pointerType = 'keyboard'; <ide> isGlobalFocusVisible = true; <ide><path>packages/react-events/src/__tests__/Focus-test.internal.js <ide> const createPointerEvent = (type, data) => { <ide> return event; <ide> }; <ide> <add>const modulesInit = () => { <add> ReactFeatureFlags = require('shared/ReactFeatureFlags'); <add> ReactFeatureFlags.enableEventAPI = true; <add> React = require('react'); <add> ReactDOM = require('react-dom'); <add> Focus = require('react-events/focus'); <add>}; <add> <ide> describe('Focus event responder', () => { <ide> let container; <ide> <ide> beforeEach(() => { <ide> jest.resetModules(); <del> ReactFeatureFlags = require('shared/ReactFeatureFlags'); <del> ReactFeatureFlags.enableEventAPI = true; <del> React = require('react'); <del> ReactDOM = require('react-dom'); <del> Focus = require('react-events/focus'); <add> modulesInit(); <ide> <ide> container = document.createElement('div'); <ide> document.body.appendChild(container); <ide> describe('Focus event responder', () => { <ide> describe('onFocus', () => { <ide> let onFocus, ref, innerRef; <ide> <del> beforeEach(() => { <add> const componentInit = () => { <ide> onFocus = jest.fn(); <ide> ref = React.createRef(); <ide> innerRef = React.createRef(); <ide> describe('Focus event responder', () => { <ide> </Focus> <ide> ); <ide> ReactDOM.render(element, container); <del> }); <add> }; <add> <add> beforeEach(componentInit); <ide> <ide> it('is called after "focus" event', () => { <ide> ref.current.dispatchEvent(createFocusEvent('focus')); <ide> describe('Focus event responder', () => { <ide> expect.objectContaining({pointerType: 'keyboard'}), <ide> ); <ide> }); <add> <add> it('is called with the correct pointerType using Tab+altKey on Mac', () => { <add> jest.resetModules(); <add> const platformGetter = jest.spyOn(global.navigator, 'platform', 'get'); <add> platformGetter.mockReturnValue('MacIntel'); <add> modulesInit(); <add> componentInit(); <add> <add> ref.current.dispatchEvent( <add> createPointerEvent('keypress', { <add> key: 'Tab', <add> altKey: true, <add> }), <add> ); <add> ref.current.dispatchEvent(createFocusEvent('focus')); <add> expect(onFocus).toHaveBeenCalledTimes(1); <add> expect(onFocus).toHaveBeenCalledWith( <add> expect.objectContaining({ <add> pointerType: 'keyboard', <add> }), <add> ); <add> <add> platformGetter.mockClear(); <add> }); <ide> }); <ide> <ide> describe('onFocusChange', () => {
2
Javascript
Javascript
add missing `getmoduleid` function
750f5f1dd43fd80cb9db025c224d0de312b15e7b
<ide><path>broccoli/to-named-amd.js <ide> const Babel = require('broccoli-babel-transpiler'); <del>const { resolveRelativeModulePath } = require('ember-cli-babel/lib/relative-module-paths'); <add>const { <add> resolveRelativeModulePath, <add> getRelativeModulePath, <add>} = require('ember-cli-babel/lib/relative-module-paths'); <ide> const enifed = require('./transforms/transform-define'); <ide> const injectNodeGlobals = require('./transforms/inject-node-globals'); <ide> <ide> module.exports = function processModulesOnly(tree, strict = false) { <ide> enifed, <ide> ], <ide> moduleIds: true, <add> getModuleId: getRelativeModulePath, <ide> }; <ide> <ide> return new Babel(tree, options);
1
Javascript
Javascript
upgrade useid to alpha channel
5cccacd131242bdea2c2fe4b33fac50d2e3132b4
<ide><path>packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js <ide> describe('ReactHooksInspectionIntegration', () => { <ide> <ide> it('should support useId hook', () => { <ide> function Foo(props) { <del> const id = React.unstable_useId(); <add> const id = React.useId(); <ide> const [state] = React.useState('hello'); <ide> return <div id={id}>{state}</div>; <ide> } <ide><path>packages/react-dom/src/__tests__/ReactDOMUseId-test.js <ide> describe('useId', () => { <ide> ReactDOMFizzServer = require('react-dom/server'); <ide> Stream = require('stream'); <ide> Suspense = React.Suspense; <del> useId = React.unstable_useId; <add> useId = React.useId; <ide> <ide> // Test Environment <ide> const jsdom = new JSDOM( <ide><path>packages/react/index.classic.fb.js <ide> export { <ide> unstable_getCacheSignal, <ide> unstable_getCacheForType, <ide> unstable_useCacheRefresh, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue, <ide><path>packages/react/index.experimental.js <ide> export { <ide> unstable_getCacheSignal, <ide> unstable_getCacheForType, <ide> unstable_useCacheRefresh, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue, <ide><path>packages/react/index.js <ide> export { <ide> unstable_getCacheSignal, <ide> unstable_getCacheForType, <ide> unstable_useCacheRefresh, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue, <ide><path>packages/react/index.modern.fb.js <ide> export { <ide> unstable_getCacheSignal, <ide> unstable_getCacheForType, <ide> unstable_useCacheRefresh, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue, <ide><path>packages/react/index.stable.js <ide> export { <ide> lazy, <ide> memo, <ide> startTransition, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue, <ide><path>packages/react/src/React.js <ide> export { <ide> REACT_CACHE_TYPE as unstable_Cache, <ide> // enableScopeAPI <ide> REACT_SCOPE_TYPE as unstable_Scope, <del> useId as unstable_useId, <add> useId, <ide> act, <ide> }; <ide><path>packages/react/unstable-shared-subset.experimental.js <ide> export { <ide> unstable_DebugTracingMode, <ide> unstable_getCacheSignal, <ide> unstable_getCacheForType, <del> unstable_useId, <add> useId, <ide> useCallback, <ide> useContext, <ide> useDebugValue,
9
Javascript
Javascript
fix native modules linking in 0.29.1
3c8a2eed92587ef3a79352b71073e4cfccb2a7df
<ide><path>local-cli/rnpm/link/src/android/patches/0.20/makeImportPatch.js <ide> module.exports = function makeImportPatch(packageImportPath) { <ide> return { <del> pattern: 'import com.facebook.react.ReactActivity;', <add> pattern: 'import com.facebook.react.ReactApplication;', <ide> patch: '\n' + packageImportPath, <ide> }; <ide> }; <ide><path>local-cli/rnpm/link/src/android/registerNativeModule.js <ide> module.exports = function registerNativeAndroidModule( <ide> applyPatch(projectConfig.stringsPath, makeStringsPatch(params, name)); <ide> <ide> applyPatch( <del> projectConfig.mainActivityPath, <add> projectConfig.mainFilePath, <ide> makePackagePatch(androidConfig.packageInstance, params, name) <ide> ); <ide> <ide> applyPatch( <del> projectConfig.mainActivityPath, <add> projectConfig.mainFilePath, <ide> makeImportPatch(androidConfig.packageImportPath) <ide> ); <ide> }; <ide><path>local-cli/rnpm/link/src/android/unregisterNativeModule.js <ide> module.exports = function unregisterNativeAndroidModule( <ide> revokePatch(projectConfig.stringsPath, makeStringsPatch(params, name)); <ide> <ide> revokePatch( <del> projectConfig.mainActivityPath, <add> projectConfig.mainFilePath, <ide> makePackagePatch(androidConfig.packageInstance, params, name) <ide> ); <ide> <ide> revokePatch( <del> projectConfig.mainActivityPath, <add> projectConfig.mainFilePath, <ide> makeImportPatch(androidConfig.packageImportPath) <ide> ); <ide> }; <ide><path>local-cli/rnpm/link/test/android/patches/0.17/makeImportPatch.js <ide> const makeImportPatch = require('../../../../src/android/patches/0.17/makeImport <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageImportPath = 'import some.example.project'; <ide><path>local-cli/rnpm/link/test/android/patches/0.17/makePackagePatch.js <ide> const makePackagePatch = require('../../../../src/android/patches/0.17/makePacka <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')'; <ide><path>local-cli/rnpm/link/test/android/patches/0.18/makeImportPatch.js <ide> const makeImportPatch = require('../../../../src/android/patches/0.18/makeImport <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageImportPath = 'import some.example.project'; <ide><path>local-cli/rnpm/link/test/android/patches/0.18/makePackagePatch.js <ide> const makePackagePatch = require('../../../../src/android/patches/0.18/makePacka <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')'; <ide><path>local-cli/rnpm/link/test/android/patches/0.20/makeImportPatch.js <ide> const makeImportPatch = require('../../../../src/android/patches/0.20/makeImport <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageImportPath = 'import some.example.project'; <ide><path>local-cli/rnpm/link/test/android/patches/0.20/makePackagePatch.js <ide> const makePackagePatch = require('../../../../src/android/patches/0.20/makePacka <ide> const applyPatch = require('../../../../src/android/patches/applyPatch'); <ide> <ide> const projectConfig = { <del> mainActivityPath: 'MainActivity.java', <add> mainFilePath: 'MainActivity.java', <ide> }; <ide> <ide> const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')';
9
Text
Text
remove dup distinct from ar query list [ci skip]
7d0e73bc019536970c480d0810347ee2f40b9838
<ide><path>guides/source/active_record_querying.md <ide> The methods are: <ide> * `reorder` <ide> * `reverse_order` <ide> * `select` <del>* `distinct` <ide> * `where` <ide> <ide> Finder methods that return a collection, such as `where` and `group`, return an instance of `ActiveRecord::Relation`. Methods that find a single entity, such as `find` and `first`, return a single instance of the model.
1
Java
Java
preserve registration order in @activeprofiles
acbbf61be878f7924e29d71fe95fe001a8d29183
<ide><path>spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <p>The default value is {@code true}, which means that a test <ide> * class will <em>inherit</em> bean definition profiles defined by a <ide> * test superclass. Specifically, the bean definition profiles for a test <del> * class will be added to the list of bean definition profiles <add> * class will be appended to the list of bean definition profiles <ide> * defined by a test superclass. Thus, subclasses have the option of <ide> * <em>extending</em> the list of bean definition profiles. <ide> * <p>If {@code inheritProfiles} is set to {@code false}, the bean <ide><path>spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2017 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import java.io.Serializable; <ide> import java.util.Arrays; <ide> import java.util.Collections; <add>import java.util.LinkedHashSet; <ide> import java.util.Set; <del>import java.util.TreeSet; <ide> <ide> import org.springframework.context.ApplicationContext; <ide> import org.springframework.context.ApplicationContextInitializer; <ide> private static String[] processActiveProfiles(@Nullable String[] activeProfiles) <ide> return EMPTY_STRING_ARRAY; <ide> } <ide> <del> // Active profiles must be unique and sorted <del> Set<String> profilesSet = new TreeSet<>(Arrays.asList(activeProfiles)); <add> // Active profiles must be unique <add> Set<String> profilesSet = new LinkedHashSet<>(Arrays.asList(activeProfiles)); <ide> return StringUtils.toStringArray(profilesSet); <ide> } <ide> <ide><path>spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java <ide> <ide> package org.springframework.test.context.support; <ide> <add>import java.util.ArrayList; <add>import java.util.Collections; <add>import java.util.LinkedHashSet; <add>import java.util.List; <ide> import java.util.Set; <del>import java.util.TreeSet; <ide> <ide> import org.apache.commons.logging.Log; <ide> import org.apache.commons.logging.LogFactory; <ide> abstract class ActiveProfilesUtils { <ide> static String[] resolveActiveProfiles(Class<?> testClass) { <ide> Assert.notNull(testClass, "Class must not be null"); <ide> <del> Set<String> activeProfiles = new TreeSet<>(); <ide> AnnotationDescriptor<ActiveProfiles> descriptor = findAnnotationDescriptor(testClass, ActiveProfiles.class); <add> List<String[]> profileArrays = new ArrayList<>(); <ide> <ide> if (descriptor == null && logger.isDebugEnabled()) { <ide> logger.debug(String.format( <ide> static String[] resolveActiveProfiles(Class<?> testClass) { <ide> <ide> String[] profiles = resolver.resolve(rootDeclaringClass); <ide> if (!ObjectUtils.isEmpty(profiles)) { <del> for (String profile : profiles) { <del> if (StringUtils.hasText(profile)) { <del> activeProfiles.add(profile.trim()); <del> } <del> } <add> profileArrays.add(profiles); <ide> } <ide> <ide> descriptor = (annotation.inheritProfiles() ? descriptor.next() : null); <ide> } <ide> <add> // Reverse the list so that we can traverse "down" the hierarchy. <add> Collections.reverse(profileArrays); <add> <add> Set<String> activeProfiles = new LinkedHashSet<>(); <add> for (String[] profiles : profileArrays) { <add> for (String profile : profiles) { <add> if (StringUtils.hasText(profile)) { <add> activeProfiles.add(profile.trim()); <add> } <add> } <add> } <add> <ide> return StringUtils.toStringArray(activeProfiles); <ide> } <ide> <ide><path>spring-test/src/test/java/org/springframework/test/context/MergedContextConfigurationTests.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> void hashCodeWithSameProfilesReversed() { <ide> EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader); <ide> MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), <ide> EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles2, loader); <del> assertThat(mergedConfig2).hasSameHashCodeAs(mergedConfig1); <add> assertThat(mergedConfig2.hashCode()).isNotEqualTo(mergedConfig1.hashCode()); <ide> } <ide> <ide> @Test <ide> void equalsWithSameProfilesReversed() { <ide> EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader); <ide> MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), <ide> EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles2, loader); <del> assertThat(mergedConfig2).isEqualTo(mergedConfig1); <add> assertThat(mergedConfig2).isNotEqualTo(mergedConfig1); <ide> } <ide> <ide> @Test <ide> void equalsWithSameDuplicateProfiles() { <ide> String[] activeProfiles1 = new String[] { "catbert", "dogbert" }; <del> String[] activeProfiles2 = new String[] { "dogbert", "catbert", "dogbert", "catbert" }; <add> String[] activeProfiles2 = new String[] { "catbert", "dogbert", "catbert", "dogbert", "catbert" }; <ide> MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), <ide> EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, activeProfiles1, loader); <ide> MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), <ide><path>spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTests.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> void verifyCacheKeyIsBasedOnActiveProfiles() { <ide> int size = 0, hit = 0, miss = 0; <ide> loadCtxAndAssertStats(FooBarProfilesTestCase.class, ++size, hit, ++miss); <ide> loadCtxAndAssertStats(FooBarProfilesTestCase.class, size, ++hit, miss); <del> // Profiles {foo, bar} MUST hash to the same as {bar, foo} <del> loadCtxAndAssertStats(BarFooProfilesTestCase.class, size, ++hit, miss); <add> // Profiles {foo, bar} should not hash to the same as {bar,foo} <add> loadCtxAndAssertStats(BarFooProfilesTestCase.class, ++size, hit, ++miss); <ide> loadCtxAndAssertStats(FooBarProfilesTestCase.class, size, ++hit, miss); <ide> loadCtxAndAssertStats(FooBarProfilesTestCase.class, size, ++hit, miss); <ide> loadCtxAndAssertStats(BarFooProfilesTestCase.class, size, ++hit, miss); <ide><path>spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java <ide> void resolveActiveProfilesWithEmptyProfiles() { <ide> <ide> @Test <ide> void resolveActiveProfilesWithDuplicatedProfiles() { <del> assertResolvedProfiles(DuplicatedProfiles.class, "bar", "baz", "foo"); <add> assertResolvedProfiles(DuplicatedProfiles.class, "foo", "bar", "baz"); <ide> } <ide> <ide> @Test <ide> void resolveActiveProfilesWithLocalAndInheritedDuplicatedProfiles() { <del> assertResolvedProfiles(ExtendedDuplicatedProfiles.class, "bar", "baz", "cat", "dog", "foo"); <add> assertResolvedProfiles(ExtendedDuplicatedProfiles.class, "foo", "bar", "baz", "cat", "dog"); <ide> } <ide> <ide> @Test <ide> void resolveActiveProfilesWithInheritedAnnotationAndClasses() { <ide> <ide> @Test <ide> void resolveActiveProfilesWithLocalAndInheritedAnnotations() { <del> assertResolvedProfiles(LocationsBar.class, "bar", "foo"); <add> assertResolvedProfiles(LocationsBar.class, "foo", "bar"); <ide> } <ide> <ide> @Test <ide> void resolveActiveProfilesWithOverriddenAnnotation() { <del> assertResolvedProfiles(Animals.class, "cat", "dog"); <add> assertResolvedProfiles(Animals.class, "dog", "cat"); <ide> } <ide> <ide> /** <ide> void resolveActiveProfilesWithMetaAnnotationAndOverriddenAttributes() { <ide> */ <ide> @Test <ide> void resolveActiveProfilesWithLocalAndInheritedMetaAnnotations() { <del> assertResolvedProfiles(MetaLocationsBar.class, "bar", "foo"); <add> assertResolvedProfiles(MetaLocationsBar.class, "foo", "bar"); <ide> } <ide> <ide> /** <ide> * @since 4.0 <ide> */ <ide> @Test <ide> void resolveActiveProfilesWithOverriddenMetaAnnotation() { <del> assertResolvedProfiles(MetaAnimals.class, "cat", "dog"); <add> assertResolvedProfiles(MetaAnimals.class, "dog", "cat"); <ide> } <ide> <ide> /** <ide> void resolveActiveProfilesWithInheritedResolver() { <ide> */ <ide> @Test <ide> void resolveActiveProfilesWithMergedInheritedResolver() { <del> assertResolvedProfiles(MergedInheritedFooActiveProfilesResolverTestCase.class, "bar", "foo"); <add> assertResolvedProfiles(MergedInheritedFooActiveProfilesResolverTestCase.class, "foo", "bar"); <ide> } <ide> <ide> /** <ide><path>spring-test/src/test/java/org/springframework/test/context/support/BootstrapTestUtilsMergedConfigTests.java <ide> void buildMergedConfigWithDuplicateConfigurationOnSuperclassAndSubclass() { <ide> void buildMergedConfigWithDuplicateConfigurationOnEnclosingClassAndNestedClass() { <ide> compareApplesToApples(AppleConfigTestCase.class, AppleConfigTestCase.Nested.class); <ide> compareApplesToApples(AppleConfigTestCase.Nested.class, AppleConfigTestCase.Nested.DoubleNested.class); <add> compareApplesToOranges(ApplesAndOrangesConfigTestCase.class, ApplesAndOrangesConfigTestCase.Nested.class); <add> compareApplesToOranges(ApplesAndOrangesConfigTestCase.Nested.class, ApplesAndOrangesConfigTestCase.Nested.DoubleNested.class); <ide> } <ide> <ide> private void compareApplesToApples(Class<?> parent, Class<?> child) { <ide> private void compareApplesToOranges(Class<?> parent, Class<?> child) { <ide> DelegatingSmartContextLoader.class); <ide> <ide> assertThat(parentMergedConfig.getActiveProfiles()).as("active profiles") <del> .containsExactly("apples", "oranges") <add> .containsExactly("oranges", "apples") <ide> .isEqualTo(childMergedConfig.getActiveProfiles()); <ide> assertThat(parentMergedConfig).isEqualTo(childMergedConfig); <ide> } <ide> static class SubDuplicateConfigAppleConfigTestCase extends DuplicateConfigAppleC <ide> } <ide> <ide> @ContextConfiguration(classes = AppleConfig.class) <del> @ActiveProfiles({"apples", "oranges"}) <add> @ActiveProfiles({"oranges", "apples"}) <ide> static class ApplesAndOrangesConfigTestCase { <ide> <ide> @ContextConfiguration(classes = AppleConfig.class) <ide> @ActiveProfiles(profiles = {"oranges", "apples"}, inheritProfiles = false) <ide> class Nested { <ide> <ide> @ContextConfiguration(classes = AppleConfig.class) <del> @ActiveProfiles(profiles = {"apples", "oranges", "apples"}, inheritProfiles = false) <add> @ActiveProfiles(profiles = {"oranges", "apples", "oranges"}, inheritProfiles = false) <ide> class DoubleNested { <ide> } <ide> } <ide> } <ide> <ide> @ContextConfiguration(classes = AppleConfig.class) <del> @ActiveProfiles(profiles = {"oranges", "apples"}, inheritProfiles = false) <add> @ActiveProfiles(profiles = {"oranges", "apples", "oranges"}, inheritProfiles = false) <ide> static class DuplicateConfigApplesAndOrangesConfigTestCase extends ApplesAndOrangesConfigTestCase { <ide> } <ide> <ide> @ContextConfiguration(classes = AppleConfig.class) <del> @ActiveProfiles(profiles = {"apples", "oranges", "apples"}, inheritProfiles = false) <add> @ActiveProfiles(profiles = {"oranges", "apples", "oranges"}, inheritProfiles = false) <ide> static class SubDuplicateConfigApplesAndOrangesConfigTestCase extends DuplicateConfigApplesAndOrangesConfigTestCase { <ide> } <ide>
7
Java
Java
update javadoc for sqlscriptstestexecutionlistener
3013558e3d3166695907f7a9293b0726b68f6109
<ide><path>spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java <ide> * {@linkplain java.lang.reflect.Method test method}, depending on the configured <ide> * value of the {@link Sql#executionPhase executionPhase} flag. <ide> * <del> * <p>Scripts will be executed either within an existing Spring-managed transaction <del> * or within an isolated transaction, depending on the configured value of <del> * {@link SqlConfig#transactionMode}. <add> * <p>Scripts will be executed without a transaction, within an existing <add> * Spring-managed transaction, or within an isolated transaction, depending <add> * on the configured value of {@link SqlConfig#transactionMode} and the <add> * presence of a transaction manager. <ide> * <ide> * <h3>Script Resources</h3> <ide> * <p>For details on default script detection and how explicit script locations <ide> * are interpreted, see {@link Sql#scripts}. <ide> * <ide> * <h3>Required Spring Beans</h3> <del> * <p>A {@link DataSource} and {@link PlatformTransactionManager} must be defined <del> * as beans in the Spring {@link ApplicationContext} for the corresponding test. <del> * Consult the javadocs for {@link TestContextTransactionUtils#retrieveDataSource} <del> * and {@link TestContextTransactionUtils#retrieveTransactionManager} for details <del> * on the algorithms used to locate these beans. <add> * <p>A {@link PlatformTransactionManager} <em>and</em> a {@link DataSource}, <add> * just a {@link PlatformTransactionManager}, or just a {@link DataSource} <add> * must be defined as beans in the Spring {@link ApplicationContext} for the <add> * corresponding test. Consult the javadocs for {@link SqlConfig#transactionMode}, <add> * {@link SqlConfig#transactionManager}, {@link SqlConfig#dataSource}, <add> * {@link TestContextTransactionUtils#retrieveDataSource}, and <add> * {@link TestContextTransactionUtils#retrieveTransactionManager} for details <add> * on permissible configuration constellations and on the algorithms used to <add> * locate these beans. <ide> * <ide> * @author Sam Brannen <ide> * @since 4.1
1
Text
Text
fix a typo
3df157480a543e626ac90b13d923c439e69724d0
<ide><path>CHANGELOG.md <ide> ### React DOM <ide> <ide> * Add support for the Pointer Events specification. ([@philipp-spiess](https://github.com/philipp-spiess) in [#12507](https://github.com/facebook/react/pull/12507)) <del>* Properly call `getDerivedFromProps()` regardless of the reason for re-rendering. ([@acdlite](https://github.com/acdlite) in [#12600](https://github.com/facebook/react/pull/12600) and [#12802](https://github.com/facebook/react/pull/12802)) <add>* Properly call `getDerivedStateFromProps()` regardless of the reason for re-rendering. ([@acdlite](https://github.com/acdlite) in [#12600](https://github.com/facebook/react/pull/12600) and [#12802](https://github.com/facebook/react/pull/12802)) <ide> * Fix a bug that prevented context propagation in some cases. ([@gaearon](https://github.com/gaearon) in [#12708](https://github.com/facebook/react/pull/12708)) <ide> * Fix re-rendering of components using `forwardRef()` on a deeper `setState()`. ([@gaearon](https://github.com/gaearon) in [#12690](https://github.com/facebook/react/pull/12690)) <ide> * Fix some attributes incorrectly getting removed from custom element nodes. ([@airamrguez](https://github.com/airamrguez) in [#12702](https://github.com/facebook/react/pull/12702))
1
Python
Python
add toggle support to subdag clearing in the cli
115fe1c6b264c10319470a388c747caaf44a6dc4
<ide><path>airflow/bin/cli.py <ide> def clear(args): <ide> end_date=args.end_date, <ide> only_failed=args.only_failed, <ide> only_running=args.only_running, <del> confirm_prompt=not args.no_confirm) <add> confirm_prompt=not args.no_confirm, <add> include_subdags=not args.exclude_subdags) <ide> <ide> <ide> def webserver(args): <ide> class CLIFactory(object): <ide> 'no_confirm': Arg( <ide> ("-c", "--no_confirm"), <ide> "Do not request confirmation", "store_true"), <add> 'exclude_subdags': Arg( <add> ("-x", "--exclude_subdags"), <add> "Exclude subdags", "store_true"), <ide> # trigger_dag <ide> 'run_id': Arg(("-r", "--run_id"), "Helps to identify this run"), <ide> 'conf': Arg( <ide> class CLIFactory(object): <ide> 'args': ( <ide> 'dag_id', 'task_regex', 'start_date', 'end_date', 'subdir', <ide> 'upstream', 'downstream', 'no_confirm', 'only_failed', <del> 'only_running'), <add> 'only_running', 'exclude_subdags'), <ide> }, { <ide> 'func': pause, <ide> 'help': "Pause a DAG", <ide><path>tests/core.py <ide> def test_pause(self): <ide> cli.unpause(args) <ide> assert self.dagbag.dags['example_bash_operator'].is_paused in [False, 0] <ide> <add> def test_subdag_clear(self): <add> args = self.parser.parse_args([ <add> 'clear', 'example_subdag_operator', '--no_confirm']) <add> cli.clear(args) <add> args = self.parser.parse_args([ <add> 'clear', 'example_subdag_operator', '--no_confirm', '--exclude_subdags']) <add> cli.clear(args) <add> <ide> def test_backfill(self): <ide> cli.backfill(self.parser.parse_args([ <ide> 'backfill', 'example_bash_operator',
2
Text
Text
release notes for 1.0.1 thorium-shielding
3f14a45aa5894e5a30e946a1418e7c9f18f00691
<ide><path>CHANGELOG.md <add><a name="1.0.1"></a> <add># 1.0.1 thorium-shielding (2012-06-25) <add> <add> <add>## Bug Fixes <add> <add>- **$location:** don't throw exception while url rewriting if element was removed <add> ([3da4194f](https://github.com/angular/angular.js/commit/3da4194f98fa0c1ad1e5ab159719e4b25799e6d4), <add> [#1058](https://github.com/angular/angular.js/issues/1058)) <add>- **$location:** prevent ie from getting into redirect loop <add> ([ffb27013](https://github.com/angular/angular.js/commit/ffb270130a4aaf3ddc2eb9d6211b46e1da136184), <add> [#1075](https://github.com/angular/angular.js/issues/1075), <add> [#1079](https://github.com/angular/angular.js/issues/1079), <add> [#1085](https://github.com/angular/angular.js/issues/1085)) <add> <add> <add> <ide> <a name="1.0.0"></a> <ide> # 1.0.0 temporal-domination (2012-06-13) <ide>
1
Javascript
Javascript
use custom components for guide articles
6a93b44acada261b0a5523ba309c0ecd307efe66
<ide><path>client/gatsby-node.js <ide> exports.onCreateNode = function onCreateNode({ node, actions, getNode }) { <ide> } <ide> <ide> if (node.internal.type === 'MarkdownRemark') { <del> let slug = createFilePath({ node, getNode }); <add> const slug = createFilePath({ node, getNode }); <ide> if (!slug.includes('LICENSE')) { <add> const { <add> frontmatter: { component = '' } <add> } = node; <ide> createNodeField({ node, name: 'slug', value: slug }); <add> createNodeField({ node, name: 'component', value: component }); <ide> } <ide> } <del> <ide> }; <ide> <ide> exports.createPages = function createPages({ graphql, actions }) { <ide> exports.createPages = function createPages({ graphql, actions }) { <ide> fields { <ide> slug <ide> nodeIdentity <add> component <ide> } <ide> frontmatter { <ide> block <ide><path>client/src/templates/Guide/GuideArticle.js <del>import React, { Fragment } from 'react'; <add>import React from 'react'; <ide> import PropTypes from 'prop-types'; <ide> import { graphql } from 'gatsby'; <del>import Helmet from 'react-helmet'; <ide> <del>import Breadcrumbs from './components/Breadcrumbs'; <add>import ArticleLayout from './components/ArticleLayout'; <ide> <ide> const propTypes = { <del> data: PropTypes.object, <del> location: PropTypes.object, <del> pageContext: PropTypes.shape({ <del> meta: PropTypes.objectOf(PropTypes.string) <del> }) <add> data: PropTypes.object <ide> }; <ide> <ide> const GuideArticle = props => { <ide> const { <del> location: { pathname }, <ide> data: { <del> markdownRemark: { <del> html, <del> fields: { slug }, <del> frontmatter: { title } <del> } <del> }, <del> pageContext: { meta } <add> markdownRemark: { html } <add> } <ide> } = props; <ide> return ( <del> <Fragment> <del> <Helmet> <del> <title>{`${title} | freeCodeCamp Guide`}</title> <del> <link href={`https://www.freecodecamp.org${slug}`} rel='canonical' /> <del> <meta <del> content={`https://www.freecodecamp.org${slug}`} <del> property='og:url' <del> /> <del> <meta content={title} property='og:title' /> <del> <meta <del> content={meta.description ? meta.description : ''} <del> property='og:description' <del> /> <del> <meta <del> content={meta.description ? meta.description : ''} <del> name='description' <del> /> <del> <meta content={meta.featureImage} property='og:image' /> <del> </Helmet> <del> <Breadcrumbs path={pathname} /> <add> <ArticleLayout {...props}> <ide> <article <ide> className='article' <ide> dangerouslySetInnerHTML={{ __html: html }} <ide> id='article' <ide> tabIndex='-1' <ide> /> <del> </Fragment> <add> </ArticleLayout> <ide> ); <ide> }; <ide> <ide> export const pageQuery = graphql` <ide> query ArticleById($id: String!) { <ide> markdownRemark(id: { eq: $id }) { <ide> html <del> fields { <del> slug <del> } <del> frontmatter { <del> title <del> } <add> ...ArticleLayout <ide> } <ide> } <ide> `; <ide><path>client/src/templates/Guide/components/ArticleLayout.js <add>import React, { Fragment } from 'react'; <add>import PropTypes from 'prop-types'; <add>import { graphql } from 'gatsby'; <add>import Helmet from 'react-helmet'; <add> <add>import Breadcrumbs from './Breadcrumbs'; <add> <add>const propTypes = { <add> children: PropTypes.any, <add> data: PropTypes.object, <add> location: PropTypes.object, <add> pageContext: PropTypes.shape({ <add> meta: PropTypes.objectOf(PropTypes.string) <add> }) <add>}; <add> <add>const ArticleLayout = props => { <add> const { <add> children, <add> location: { pathname }, <add> data: { <add> markdownRemark: { <add> fields: { slug }, <add> frontmatter: { title } <add> } <add> }, <add> pageContext: { meta } <add> } = props; <add> return ( <add> <Fragment> <add> <Helmet> <add> <title>{`${title} | freeCodeCamp Guide`}</title> <add> <link href={`https://www.freecodecamp.org${slug}`} rel='canonical' /> <add> <meta <add> content={`https://www.freecodecamp.org${slug}`} <add> property='og:url' <add> /> <add> <meta content={title} property='og:title' /> <add> <meta <add> content={meta.description ? meta.description : ''} <add> property='og:description' <add> /> <add> <meta <add> content={meta.description ? meta.description : ''} <add> name='description' <add> /> <add> <meta content={meta.featureImage} property='og:image' /> <add> </Helmet> <add> <Breadcrumbs path={pathname} /> <add> {children} <add> </Fragment> <add> ); <add>}; <add> <add>ArticleLayout.displayName = 'ArticleLayout'; <add>ArticleLayout.propTypes = propTypes; <add> <add>export default ArticleLayout; <add> <add>export const fragmentQuery = graphql` <add> fragment ArticleLayout on MarkdownRemark { <add> fields { <add> slug <add> } <add> frontmatter { <add> title <add> } <add> } <add>`; <ide><path>client/utils/gatsby/guidePageCreator.js <ide> exports.createGuideArticlePages = createPage => ({ <ide> node: { <ide> htmlAst, <ide> excerpt, <del> fields: { slug }, <add> fields: { slug, component }, <ide> id <ide> } <ide> }) => { <ide> exports.createGuideArticlePages = createPage => ({ <ide> <ide> return createPage({ <ide> path: `/guide${slug}`, <del> component: guideArticle, <add> component: !component <add> ? guideArticle <add> : path.resolve( <add> __dirname, <add> '../../src/templates/Guide/components/', <add> component <add> ), <ide> context: { <ide> id, <ide> meta
4
Python
Python
update np.void docs based on matti's comments
7404cb68f20d8299a0935cb4242f37c41ab58aeb
<ide><path>numpy/core/_add_newdocs_scalars.py <ide> def add_newdoc_for_scalar_type(obj, fixed_aliases, doc): <ide> be returned. <ide> dtype : dtype, optional <ide> If provided the dtype of the new scalar. This dtype must <del> be "void" dtype (i.e. a structured or unstructured <del> void). <add> be "void" dtype (i.e. a structured or unstructured void, <add> see also :ref:`defining-structured-types`). <ide> <ide> ..versionadded:: 1.24 <ide> <ide> def add_newdoc_for_scalar_type(obj, fixed_aliases, doc): <ide> arbitrary byte data and structured dtypes, the void constructor <ide> has three calling conventions: <ide> <del> 1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with <add> 1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with five <ide> ``\0`` bytes. The 5 can be a Python or NumPy integer. <del> 2. ``np.void(b"bytes-like")`` creates a void scalar from <del> the byte string. The dtype is chosen based on its length. <add> 2. ``np.void(b"bytes-like")`` creates a void scalar from the byte string. <add> The dtype itemsize will match the byte string length, here ``"V10"``. <ide> 3. When a ``dtype=`` is passed the call is rougly the same as an <del> array creation. However a void scalar is returned when possible. <add> array creation. However, a void scalar rather than array is returned. <ide> <ide> Please see the examples which show all three different conventions. <ide>
1
PHP
PHP
allow chaining of `->newline()`
5c77dac3ec8d397f73bb6dcd2d4b1bae010e9592
<ide><path>src/Illuminate/Console/Concerns/InteractsWithIO.php <ide> public function alert($string) <ide> * Write a blank line. <ide> * <ide> * @param int $count <del> * @return void <add> * @return $this <ide> */ <ide> public function newLine($count = 1) <ide> { <ide> $this->output->newLine($count); <add> <add> return $this; <ide> } <ide> <ide> /**
1
Python
Python
run mapped tasks via the normal scheduler
ba627f35debb88a68dae2b38694d15b7bfe34d1c
<ide><path>airflow/models/dagrun.py <ide> # KIND, either express or implied. See the License for the <ide> # specific language governing permissions and limitations <ide> # under the License. <add>import itertools <ide> import os <ide> import warnings <ide> from collections import defaultdict <ide> from airflow.configuration import conf as airflow_conf <ide> from airflow.exceptions import AirflowException, TaskNotFound <ide> from airflow.models.base import COLLATION_ARGS, ID_LEN, Base <add>from airflow.models.mappedoperator import MappedOperator <ide> from airflow.models.taskinstance import TaskInstance as TI <ide> from airflow.models.tasklog import LogTemplate <ide> from airflow.stats import Stats <ide> def task_instance_scheduling_decisions(self, session: Session = NEW_SESSION) -> <ide> <ide> def _get_ready_tis( <ide> self, <del> scheduleable_tasks: List[TI], <add> schedulable_tis: List[TI], <ide> finished_tis: List[TI], <ide> session: Session, <ide> ) -> Tuple[List[TI], bool]: <ide> old_states = {} <ide> ready_tis: List[TI] = [] <ide> changed_tis = False <ide> <del> if not scheduleable_tasks: <add> if not schedulable_tis: <ide> return ready_tis, changed_tis <ide> <add> # If we expand TIs, we need a new list so that we iterate over them too. (We can't alter <add> # `schedulable_tis` in place and have the `for` loop pick them up <add> expanded_tis: List[TI] = [] <add> <ide> # Check dependencies <del> for st in scheduleable_tasks: <del> old_state = st.state <del> if st.are_dependencies_met( <add> for schedulable in itertools.chain(schedulable_tis, expanded_tis): <add> <add> # Expansion of last resort! This is ideally handled in the mini-scheduler in LocalTaskJob, but if <add> # for any reason it wasn't, we need to expand it now <add> if schedulable.map_index < 0 and schedulable.task.is_mapped: <add> # HACK. This needs a better way, one that copes with multiple upstreams! <add> for ti in finished_tis: <add> if schedulable.task_id in ti.task.downstream_task_ids: <add> upstream = ti <add> <add> assert isinstance(schedulable.task, MappedOperator) <add> new_tis = schedulable.task.expand_mapped_task(upstream, session=session) <add> if schedulable.state == TaskInstanceState.SKIPPED: <add> # Task is now skipped (likely cos upstream returned 0 tasks <add> continue <add> assert new_tis[0] is schedulable <add> expanded_tis.extend(new_tis[1:]) <add> break <add> <add> old_state = schedulable.state <add> if schedulable.are_dependencies_met( <ide> dep_context=DepContext(flag_upstream_failed=True, finished_tis=finished_tis), <ide> session=session, <ide> ): <del> ready_tis.append(st) <add> ready_tis.append(schedulable) <ide> else: <del> old_states[st.key] = old_state <add> old_states[schedulable.key] = old_state <ide> <ide> # Check if any ti changed state <ide> tis_filter = TI.filter_for_tis(old_states.keys()) <ide><path>airflow/models/mappedoperator.py <ide> def expand_mapped_task( <ide> ti = TaskInstance(self, run_id=upstream_ti.run_id, map_index=index, state=state) # type: ignore <ide> self.log.debug("Expanding TIs upserted %s", ti) <ide> task_instance_mutation_hook(ti) <del> ret.append(session.merge(ti)) <add> ti = session.merge(ti) <add> ti.task = self <add> ret.append(ti) <ide> <ide> # Set to "REMOVED" any (old) TaskInstances with map indices greater <ide> # than the current map value <ide><path>tests/jobs/test_scheduler_job.py <ide> # under the License. <ide> # <ide> <add>import collections <ide> import datetime <ide> import logging <ide> import os <ide> import shutil <ide> from datetime import timedelta <ide> from tempfile import mkdtemp <del>from typing import Generator, Optional <add>from typing import Deque, Generator, Optional <ide> from unittest import mock <ide> from unittest.mock import MagicMock, patch <ide> <ide> from airflow.utils.session import create_session, provide_session <ide> from airflow.utils.state import DagRunState, State, TaskInstanceState <ide> from airflow.utils.types import DagRunType <add>from tests.models import TEST_DAGS_FOLDER <ide> from tests.test_utils.asserts import assert_queries_count <ide> from tests.test_utils.config import conf_vars, env_vars <ide> from tests.test_utils.db import ( <ide> def per_test(self) -> Generator: <ide> <ide> @pytest.fixture(autouse=True) <ide> def set_instance_attrs(self, dagbag) -> Generator: <del> self.dagbag = dagbag <add> self.dagbag: DagBag = dagbag <ide> # Speed up some tests by not running the tasks, just look at what we <ide> # enqueue! <ide> self.null_exec: Optional[MockExecutor] = MockExecutor() <ide> def set_instance_attrs(self, dagbag) -> Generator: <ide> yield <ide> <ide> self.null_exec = None <del> self.dagbag = None <add> del self.dagbag <ide> <ide> def test_is_alive(self): <ide> self.scheduler_job = SchedulerJob(None, heartrate=10, state=State.RUNNING) <ide> def evaluate_dagrun( <ide> <ide> try: <ide> dag = DagBag().get_dag(dag.dag_id) <del> assert not isinstance(dag, SerializedDAG) <ide> # This needs a _REAL_ dag, not the serialized version <add> assert not isinstance(dag, SerializedDAG) <add> # TODO: Can this be replaced with `self.run_scheduler_until_dagrun_terminal. `dag.run` isn't <add> # great to use here as it uses BackfillJob! <ide> dag.run(start_date=ex_date, end_date=ex_date, executor=self.null_exec, **run_kwargs) <ide> except AirflowException: <ide> pass <ide> def test_find_zombies_handle_failure_callbacks_are_correctly_passed_to_dag_proce <ide> result.simple_task_instance.key for result in callback_requests <ide> } <ide> <add> @mock.patch.object(settings, 'USE_JOB_SCHEDULE', False) <add> def run_scheduler_until_dagrun_terminal(self, job: SchedulerJob): <add> """ <add> Run a scheduler until any dag run reaches a terminal state, or the scheduler becomes "idle". <add> <add> This needs a DagRun to be pre-created (it can be in running or queued state) as no more will be <add> created as we turn off creating new DagRuns via setting USE_JOB_SCHEDULE to false <add> <add> Note: This doesn't currently account for tasks that go into retry -- the scheduler would be detected <add> as idle in that circumstance <add> """ <add> # Spy on _do_scheduling and _process_executor_events so we can notice <add> # if nothing happened, and abort early! Given we are using <add> # SequentialExecutor this shouldn't be possible -- if there is nothing <add> # to schedule and no events, it means we have stalled. <add> def spy_on_return(orig, result): <add> def spy(*args, **kwargs): <add> ret = orig(*args, **kwargs) <add> result.append(ret) <add> return ret <add> <add> return spy <add> <add> num_queued_tis: Deque[int] = collections.deque([], 3) <add> num_finished_events: Deque[int] = collections.deque([], 3) <add> <add> do_scheduling_spy = mock.patch.object( <add> job, <add> '_do_scheduling', <add> side_effect=spy_on_return(job._do_scheduling, num_queued_tis), <add> ) <add> executor_events_spy = mock.patch.object( <add> job, <add> '_process_executor_events', <add> side_effect=spy_on_return(job._process_executor_events, num_finished_events), <add> ) <add> <add> orig_set_state = DagRun.set_state <add> <add> def watch_set_state(self: DagRun, state, **kwargs): <add> if state in (DagRunState.SUCCESS, DagRunState.FAILED): <add> # Stop the scheduler <add> job.num_runs = 1 <add> orig_set_state(self, state, **kwargs) # type: ignore[call-arg] <add> <add> def watch_heartbeat(*args, **kwargs): <add> if len(num_queued_tis) < 3 or len(num_finished_events) < 3: <add> return <add> queued_any_tis = any(val > 0 for val in num_queued_tis) <add> finished_any_events = any(val > 0 for val in num_finished_events) <add> assert ( <add> queued_any_tis or finished_any_events <add> ), "Scheduler has stalled without setting the DagRun state!" <add> <add> set_state_spy = mock.patch.object(DagRun, 'set_state', new=watch_set_state) <add> heartbeat_spy = mock.patch.object(job, 'heartbeat', new=watch_heartbeat) <add> <add> with heartbeat_spy, set_state_spy, do_scheduling_spy, executor_events_spy: <add> job.run() <add> <add> @pytest.mark.long_running <add> @pytest.mark.parametrize("dag_id", ["test_mapped_classic", "test_mapped_taskflow"]) <add> def test_mapped_dag(self, dag_id, session): <add> """End-to-end test of a simple mapped dag""" <add> # Use SequentialExecutor for more predictable test behaviour <add> from airflow.executors.sequential_executor import SequentialExecutor <add> from airflow.utils.dates import days_ago <add> <add> self.dagbag.process_file(str(TEST_DAGS_FOLDER / f'{dag_id}.py')) <add> dag = self.dagbag.get_dag(dag_id) <add> assert dag <add> dr = dag.create_dagrun( <add> run_type=DagRunType.MANUAL, <add> start_date=timezone.utcnow(), <add> state=State.RUNNING, <add> execution_date=days_ago(2), <add> session=session, <add> ) <add> <add> executor = SequentialExecutor() <add> <add> job = SchedulerJob(subdir=dag.fileloc, executor=executor) <add> <add> self.run_scheduler_until_dagrun_terminal(job) <add> <add> dr.refresh_from_db(session) <add> assert dr.state == DagRunState.SUCCESS <add> <ide> <ide> @pytest.mark.xfail(reason="Work out where this goes") <ide> def test_task_with_upstream_skip_process_task_instances(): <ide><path>tests/models/test_dagrun.py <ide> <ide> from airflow import settings <ide> from airflow.models import DAG, DagBag, DagModel, DagRun, TaskInstance as TI, clear_task_instances <add>from airflow.models.baseoperator import BaseOperator <add>from airflow.models.taskmap import TaskMap <add>from airflow.models.xcom_arg import XComArg <ide> from airflow.operators.dummy import DummyOperator <ide> from airflow.operators.python import ShortCircuitOperator <ide> from airflow.serialization.serialized_objects import SerializedDAG <ide> def test_expand_mapped_task_instance(dag_maker, session): <ide> indices = ( <ide> session.query(TI.map_index) <ide> .filter_by(task_id=mapped.task_id, dag_id=mapped.dag_id, run_id=dr.run_id) <del> .order_by(TI.insert_mapping) <add> .order_by(TI.map_index) <ide> .all() <ide> ) <ide> <ide> assert indices == [0, 1, 2] <add> <add> <add>def test_ti_scheduling_mapped_zero_length(dag_maker, session): <add> with dag_maker(session=session): <add> task = BaseOperator(task_id='task_1') <add> mapped = MockOperator.partial(task_id='task_2').map(arg2=XComArg(task)) <add> <add> dr: DagRun = dag_maker.create_dagrun() <add> ti1, _ = sorted(dr.task_instances, key=lambda ti: ti.task_id) <add> ti1.state = TaskInstanceState.SUCCESS <add> session.add( <add> TaskMap(dag_id=dr.dag_id, task_id=ti1.task_id, run_id=dr.run_id, map_index=-1, length=0, keys=None) <add> ) <add> session.flush() <add> <add> dr.task_instance_scheduling_decisions(session=session) <add> <add> indices = ( <add> session.query(TI.map_index, TI.state) <add> .filter_by(task_id=mapped.task_id, dag_id=mapped.dag_id, run_id=dr.run_id) <add> .order_by(TI.map_index) <add> .all() <add> ) <add> <add> assert indices == [(-1, TaskInstanceState.SKIPPED)]
4
Python
Python
fix suggestions in utils
1f579e0ef730c632256b24a987b8a257dd8d4476
<ide><path>research/object_detection/dataset_tools/seq_example_util.py <ide> def make_sequence_example(dataset_name, <ide> detection_scores: (Optional) A list (with num_frames_elements) of <ide> [num_boxes_i] numpy float32 arrays holding predicted object scores for <ide> each frame. <add> use_strs_for_source_id: (Optional) Whether to write the source IDs as strings <add> rather than byte lists of characters. <ide> <ide> Returns: <ide> A tf.train.SequenceExample. <ide><path>research/object_detection/dataset_tools/seq_example_util_test.py <ide> def test_make_unlabeled_example(self): <ide> source_ids) <ide> <ide> def test_make_labeled_example(self): <del> num_frames = 2 <add> num_frames = 3 <ide> image_height = 100 <ide> image_width = 200 <ide> dataset_name = b'unlabeled_dataset' <ide> video_id = b'video_000' <del> labels = [b'dog', b'cat'] <add> labels = [b'dog', b'cat', b'wolf'] <ide> images = tf.cast(tf.random.uniform( <ide> [num_frames, image_height, image_width, 3], <ide> maxval=256, <ide> dtype=tf.int32), dtype=tf.uint8) <ide> images_list = tf.unstack(images, axis=0) <ide> encoded_images_list = [tf.io.encode_jpeg(image) for image in images_list] <ide> encoded_images = self.materialize_tensors(encoded_images_list) <del> timestamps = [100000, 110000] <del> is_annotated = [1, 0] <add> timestamps = [100000, 110000, 120000] <add> is_annotated = [1, 0, 1] <ide> bboxes = [ <ide> np.array([[0., 0., 0., 0.], <ide> [0., 0., 1., 1.]], dtype=np.float32), <ide> def test_make_labeled_example(self): <ide> ] <ide> label_strings = [ <ide> np.array(labels), <add> np.array([]), <ide> np.array([]) <ide> ] <ide>
2
Javascript
Javascript
add keys to hash as you need them
449a81264b3eea830ef57f6a1e7770840c0bb4b5
<ide><path>Libraries/Components/ScrollView/ScrollView.js <ide> var ScrollView = React.createClass({ <ide> automaticallyAdjustContentInsets: PropTypes.bool, <ide> /** <ide> * The amount by which the scroll view content is inset from the edges <del> * of the scroll view. Defaults to `{0, 0, 0, 0}`. <add> * of the scroll view. Defaults to `{top: 0, left: 0, bottom: 0, right: 0}`. <ide> * @platform ios <ide> */ <ide> contentInset: EdgeInsetsPropType,
1
Text
Text
remove redunant `await` calls from stream docs
119519e1da2be1f180e8d66bd0bb79403624ea73
<ide><path>doc/api/stream.md <ide> for await (const item of Readable.from([1, 2, 3, 4]).map((x) => x * 2)) { <ide> } <ide> // With an asynchronous mapper, making at most 2 queries at a time. <ide> const resolver = new Resolver(); <del>const dnsResults = await Readable.from([ <add>const dnsResults = Readable.from([ <ide> 'nodejs.org', <ide> 'openjsf.org', <ide> 'www.linuxfoundation.org', <ide> for await (const item of Readable.from([1, 2, 3, 4]).filter((x) => x > 2)) { <ide> } <ide> // With an asynchronous predicate, making at most 2 queries at a time. <ide> const resolver = new Resolver(); <del>const dnsResults = await Readable.from([ <add>const dnsResults = Readable.from([ <ide> 'nodejs.org', <ide> 'openjsf.org', <ide> 'www.linuxfoundation.org', <ide> for await (const item of Readable.from([1, 2, 3, 4]).filter((x) => x > 2)) { <ide> } <ide> // With an asynchronous predicate, making at most 2 queries at a time. <ide> const resolver = new Resolver(); <del>const dnsResults = await Readable.from([ <add>const dnsResults = Readable.from([ <ide> 'nodejs.org', <ide> 'openjsf.org', <ide> 'www.linuxfoundation.org',
1
Ruby
Ruby
fix audit errors in dev-cmd/bump-revision.rb
b52e23c3ff0c5eae96410e7642afab187a56e788
<ide><path>Library/Homebrew/dev-cmd/bump-revision.rb <ide> def bump_revision_args <ide> present, "revision 1" will be added. <ide> EOS <ide> switch "-n", "--dry-run", <del> description: "Print what would be done rather than doing it." <add> description: "Print what would be done rather than doing it." <ide> flag "--message=", <del> description: "Append the provided <message> to the default commit message." <add> description: "Append the provided <message> to the default commit message." <ide> <ide> switch :force <ide> switch :quiet <ide> def bump_revision <ide> else <ide> formula.path.parent.cd do <ide> safe_system "git", "commit", "--no-edit", "--verbose", <del> "--message=#{message}", "--", formula.path <add> "--message=#{message}", "--", formula.path <ide> end <ide> end <ide> end
1
Go
Go
fix race in testservicelogsfollow test case
0c3be531076617be52b641b6dbb60649f587b5f5
<ide><path>integration-cli/docker_cli_service_logs_test.go <ide> func (s *DockerSwarmSuite) TestServiceLogsFollow(c *testing.T) { <ide> args := []string{"service", "logs", "-f", name} <ide> cmd := exec.Command(dockerBinary, d.PrependHostArg(args)...) <ide> r, w := io.Pipe() <add> defer r.Close() <add> defer w.Close() <ide> cmd.Stdout = w <ide> cmd.Stderr = w <ide> assert.NilError(c, cmd.Start())
1
Python
Python
fix flake8 errors
4b06fde0f10ce178b3c336c5d901e3b089f2863d
<ide><path>airflow/api/common/experimental/mark_tasks.py <ide> def set_state( <ide> # Flake and pylint disagree about correct indents here <ide> def all_subdag_tasks_query(sub_dag_run_ids, session, state, confirmed_dates): # noqa: E123 <ide> """Get *all* tasks of the sub dags""" <del> qry_sub_dag = session.query(TaskInstance).\ <add> qry_sub_dag = session.query(TaskInstance). \ <ide> filter( <del> TaskInstance.dag_id.in_(sub_dag_run_ids), <del> TaskInstance.execution_date.in_(confirmed_dates) # noqa: E123 <del> ).\ <add> TaskInstance.dag_id.in_(sub_dag_run_ids), <add> TaskInstance.execution_date.in_(confirmed_dates) <add> ). \ <ide> filter( <del> or_( <del> TaskInstance.state.is_(None), <del> TaskInstance.state != state <del> ) <del> ) # noqa: E123 <add> or_( <add> TaskInstance.state.is_(None), <add> TaskInstance.state != state <add> ) <add> ) # noqa: E123 <ide> return qry_sub_dag <ide> <ide> <del>def get_all_dag_task_query(dag, session, state, task_ids, confirmed_dates): # noqa: E123 <add>def get_all_dag_task_query(dag, session, state, task_ids, confirmed_dates): <ide> """Get all tasks of the main dag that will be affected by a state change""" <del> qry_dag = session.query(TaskInstance).\ <add> qry_dag = session.query(TaskInstance). \ <ide> filter( <del> TaskInstance.dag_id == dag.dag_id, <del> TaskInstance.execution_date.in_(confirmed_dates), <del> TaskInstance.task_id.in_(task_ids) # noqa: E123 <del> ).\ <add> TaskInstance.dag_id == dag.dag_id, <add> TaskInstance.execution_date.in_(confirmed_dates), <add> TaskInstance.task_id.in_(task_ids) # noqa: E123 <add> ). \ <ide> filter( <del> or_( <del> TaskInstance.state.is_(None), <del> TaskInstance.state != state <del> ) <add> or_( <add> TaskInstance.state.is_(None), <add> TaskInstance.state != state <ide> ) <add> ) <ide> return qry_dag <ide> <ide> <ide><path>airflow/jobs/scheduler_job.py <ide> def create_dag_run(self, dag, dag_runs=None, session=None): <ide> # this query should be replaced by find dagrun <ide> qry = ( <ide> session.query(func.max(DagRun.execution_date)) <del> .filter_by(dag_id=dag.dag_id) <del> .filter(or_( <del> DagRun.external_trigger == False, # noqa: E712 pylint: disable=singleton-comparison <del> # add % as a wildcard for the like query <del> DagRun.run_id.like(f"{DagRunType.SCHEDULED.value}__%") <del> ) <add> .filter_by(dag_id=dag.dag_id) <add> .filter(or_( <add> DagRun.external_trigger == False, # noqa: E712 pylint: disable=singleton-comparison <add> # add % as a wildcard for the like query <add> DagRun.run_id.like(f"{DagRunType.SCHEDULED.value}__%")) <ide> ) <ide> ) <ide> last_scheduled_run = qry.scalar() <ide><path>airflow/providers/google/cloud/example_dags/example_bigquery_to_gcs.py <ide> ) <ide> <ide> create_table = BigQueryCreateEmptyTableOperator( <del> task_id=f"create_table", <add> task_id="create_table", <ide> dataset_id=DATASET_NAME, <ide> table_id=TABLE, <ide> schema_fields=[ <ide><path>airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py <ide> def safe_name(s: str) -> str: <ide> default_args = {"start_date": days_ago(1)} <ide> <ide> with models.DAG( <del> dag_id=f"example_presto_to_gcs", <add> dag_id="example_presto_to_gcs", <ide> default_args=default_args, <ide> schedule_interval=None, # Override to match your needs <ide> tags=["example"], <ide><path>airflow/providers/google/cloud/hooks/functions.py <ide> def upload_function_zip(self, location: str, zip_path: str, project_id: str) -> <ide> """ <ide> response = \ <ide> self.get_conn().projects().locations().functions().generateUploadUrl( # pylint: disable=no-member # noqa <del> parent=self._full_location(project_id, location) <add> parent=self._full_location(project_id, location) <ide> ).execute(num_retries=self.num_retries) <ide> <ide> upload_url = response.get('uploadUrl') <ide><path>airflow/providers/qubole/operators/qubole_check.py <ide> def handle_airflow_exception(airflow_exception, hook): <ide> if cmd.is_success(cmd.status): <ide> qubole_command_results = hook.get_query_results() <ide> qubole_command_id = cmd.id <del> exception_message = '\nQubole Command Id: {qubole_command_id}' \ <del> '\nQubole Command Results:' \ <del> '\n{qubole_command_results}'.format( <del> qubole_command_id=qubole_command_id, # noqa: E122 <del> qubole_command_results=qubole_command_results) <add> exception_message = \ <add> '\nQubole Command Id: {qubole_command_id}' \ <add> '\nQubole Command Results:' \ <add> '\n{qubole_command_results}'.format( <add> qubole_command_id=qubole_command_id, <add> qubole_command_results=qubole_command_results) <ide> raise AirflowException(str(airflow_exception) + exception_message) <ide> raise AirflowException(str(airflow_exception)) <ide><path>airflow/secrets/local_filesystem.py <ide> def _parse_secret_file(file_path: str) -> Dict[str, Any]: <ide> <ide> if parse_errors: <ide> raise AirflowFileParseException( <del> f"Failed to load the secret file.", file_path=file_path, parse_errors=parse_errors <add> "Failed to load the secret file.", file_path=file_path, parse_errors=parse_errors <ide> ) <ide> <ide> return secrets <ide><path>airflow/www/views.py <ide> def duration(self, session=None): <ide> TF = TaskFail <ide> ti_fails = ( <ide> session.query(TF) <del> .filter(TF.dag_id == dag.dag_id, <del> TF.execution_date >= min_date, <del> TF.execution_date <= base_date, <del> TF.task_id.in_([t.task_id for t in dag.tasks])) <del> .all() # noqa <add> .filter(TF.dag_id == dag.dag_id, <add> TF.execution_date >= min_date, <add> TF.execution_date <= base_date, <add> TF.task_id.in_([t.task_id for t in dag.tasks])) <add> .all() <ide> ) <ide> <ide> fails_totals = defaultdict(int) <ide><path>backport_packages/setup_backport_packages.py <ide> def usage(): <ide> for package in packages: <ide> out += f"{package} " <ide> out_array = textwrap.wrap(out, 80) <del> print(f"Available packages: ") <add> print("Available packages: ") <ide> print() <ide> for text in out_array: <ide> print(text) <ide><path>dev/send_email.py <ide> SMTP_PORT = 587 <ide> SMTP_SERVER = "mail-relay.apache.org" <ide> MAILING_LIST = { <del> "dev": f"[email protected]", <del> "users": f"[email protected]" <add> "dev": "[email protected]", <add> "users": "[email protected]" <ide> } <ide> <ide> <ide><path>scripts/ci/pre_commit_yaml_to_cfg.py <ide> def write_config(yaml_config_file_path: str, default_cfg_file_path: str): <ide> configfile.write("\n") <ide> for single_line_desc in section_description: <ide> if single_line_desc == "": <del> configfile.write(f"#\n") <add> configfile.write("#\n") <ide> else: <ide> configfile.write(f"# {single_line_desc}\n") <ide> <ide> def write_config(yaml_config_file_path: str, default_cfg_file_path: str): <ide> configfile.write("\n") <ide> for single_line_desc in option_description: <ide> if single_line_desc == "": <del> configfile.write(f"#\n") <add> configfile.write("#\n") <ide> else: <ide> configfile.write(f"# {single_line_desc}\n") <ide> <ide><path>scripts/list-integrations.py <ide> def _find_clazzes(directory, base_class): <ide> <ide> prog = "./" + os.path.basename(sys.argv[0]) <ide> <del>HELP = f"""\ <add>HELP = """\ <ide> List operators, hooks, sensors, secrets backend in the installed Airflow. <ide> <ide> You can combine this script with other tools e.g. awk, grep, cut, uniq, sort. <ide><path>tests/executors/test_executor_loader.py <ide> def test_should_support_plugins(self): <ide> <ide> def test_should_support_custom_path(self): <ide> with conf_vars({ <del> ("core", "executor"): f"tests.executors.test_executor_loader.FakeExecutor" <add> ("core", "executor"): "tests.executors.test_executor_loader.FakeExecutor" <ide> }): <ide> executor = ExecutorLoader.get_default_executor() <ide> self.assertIsNotNone(executor) <ide><path>tests/models/test_serialized_dag.py <ide> def test_remove_stale_dags(self): <ide> @mock.patch('airflow.models.serialized_dag.STORE_SERIALIZED_DAGS', True) <ide> def test_bulk_sync_to_db(self): <ide> dags = [ <del> DAG(f"dag_1"), DAG(f"dag_2"), DAG(f"dag_3"), <add> DAG("dag_1"), DAG("dag_2"), DAG("dag_3"), <ide> ] <ide> with assert_queries_count(7): <ide> SDM.bulk_sync_to_db(dags)
14
Text
Text
update cdn in readme to 2.1.1
9cfda5a8198cee1d7d77a7732a1fd2c0beb0c93d
<ide><path>README.md <ide> To install via npm / bower: <ide> npm install chart.js --save <ide> bower install Chart.js --save <ide> ``` <del>CDN: https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.0/Chart.min.js <add>CDN: https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.1/Chart.min.js <ide> <ide> ## Documentation <ide>
1
Ruby
Ruby
remove misleading comment
4532b39f5faa15af957e3b41b671f07ed201488d
<ide><path>activemodel/lib/active_model/attribute_methods.rb <ide> def define_attr_method(name, value=nil, &block) <ide> if block_given? <ide> sing.send :define_method, name, &block <ide> else <del> # use eval instead of a block to work around a memory leak in dev <del> # mode in fcgi <ide> value = value.nil? ? 'nil' : value.to_s <ide> sing.send(:define_method, name) { value.dup } <ide> end
1
PHP
PHP
apply fixes from styleci
5cd131b48b5e8ba4ce36106ce9feaaf57889b1d1
<ide><path>src/Illuminate/Database/ConfigurationUrlParser.php <ide> protected function getDriver($url) <ide> $alias = $url['scheme'] ?? null; <ide> <ide> if (! $alias) { <del> return null; <add> return; <ide> } <ide> <ide> return static::$driverAliases[$alias] ?? $alias;
1
Javascript
Javascript
change variable assignment
4d0c759b7fbfc651fbd8c155cecf73d503bb643f
<ide><path>src/core/fonts.js <ide> var Font = (function FontClosure() { <ide> } <ide> // The first glyph is duplicated. <ide> var numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; <del> var locaData = loca.data; <ide> var locaDataSize = itemSize * (1 + numGlyphsOut); <ide> // Resize loca table to account for duplicated glyph. <del> locaData = new Uint8Array(locaDataSize); <add> var locaData = new Uint8Array(locaDataSize); <ide> locaData.set(loca.data.subarray(0, locaDataSize)); <ide> loca.data = locaData; <ide> // removing the invalid glyphs
1
Python
Python
add english norm exceptions to lex_attrs
746653880ce2fd24a511ae03f7d5f0eaa4d861ca
<ide><path>spacy/lang/en/__init__.py <ide> from __future__ import unicode_literals <ide> <ide> from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS <add>from .norm_exceptions import NORM_EXCEPTIONS <ide> from .tag_map import TAG_MAP <ide> from .stop_words import STOP_WORDS <ide> from .lex_attrs import LEX_ATTRS <ide> from .syntax_iterators import SYNTAX_ITERATORS <ide> <ide> from ..tokenizer_exceptions import BASE_EXCEPTIONS <add>from ..norm_exceptions import BASE_NORMS <ide> from ...language import Language <del>from ...attrs import LANG <del>from ...util import update_exc <add>from ...attrs import LANG, NORM <add>from ...util import update_exc, add_lookups <ide> <ide> <ide> class EnglishDefaults(Language.Defaults): <ide> lex_attr_getters = dict(Language.Defaults.lex_attr_getters) <ide> lex_attr_getters[LANG] = lambda text: 'en' <add> lex_attr_getters[NORM] = add_lookups(Language.Defaults.lex_attr_getters[NORM], <add> BASE_NORMS, NORM_EXCEPTIONS) <ide> lex_attr_getters.update(LEX_ATTRS) <ide> <ide> tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS) <ide><path>spacy/lang/en/norm_exceptions.py <add># coding: utf8 <add>from __future__ import unicode_literals <add> <add> <add>_exc = { <add> # Slang and abbreviations <add> "cos": "because", <add> "cuz": "because", <add> "fav": "favorite", <add> "fave": "favorite", <add> "misc": "miscellaneous", <add> "plz": "please", <add> "pls": "please", <add> "thx": "thanks", <add> <add> # US vs. UK spelling <add> "accessorise": "accessorize", <add> "accessorised": "accessorized", <add> "accessorises": "accessorizes", <add> "accessorising": "accessorizing", <add> "acclimatisation": "acclimatization", <add> "acclimatise": "acclimatize", <add> "acclimatised": "acclimatized", <add> "acclimatises": "acclimatizes", <add> "acclimatising": "acclimatizing", <add> "accoutrements": "accouterments", <add> "aeon": "eon", <add> "aeons": "eons", <add> "aerogramme": "aerogram", <add> "aerogrammes": "aerograms", <add> "aeroplane": "airplane", <add> "aeroplanes ": "airplanes ", <add> "aesthete": "esthete", <add> "aesthetes": "esthetes", <add> "aesthetic": "esthetic", <add> "aesthetically": "esthetically", <add> "aesthetics": "esthetics", <add> "aetiology": "etiology", <add> "ageing": "aging", <add> "aggrandisement": "aggrandizement", <add> "agonise": "agonize", <add> "agonised": "agonized", <add> "agonises": "agonizes", <add> "agonising": "agonizing", <add> "agonisingly": "agonizingly", <add> "almanack": "almanac", <add> "almanacks": "almanacs", <add> "aluminium": "aluminum", <add> "amortisable": "amortizable", <add> "amortisation": "amortization", <add> "amortisations": "amortizations", <add> "amortise": "amortize", <add> "amortised": "amortized", <add> "amortises": "amortizes", <add> "amortising": "amortizing", <add> "amphitheatre": "amphitheater", <add> "amphitheatres": "amphitheaters", <add> "anaemia": "anemia", <add> "anaemic": "anemic", <add> "anaesthesia": "anesthesia", <add> "anaesthetic": "anesthetic", <add> "anaesthetics": "anesthetics", <add> "anaesthetise": "anesthetize", <add> "anaesthetised": "anesthetized", <add> "anaesthetises": "anesthetizes", <add> "anaesthetising": "anesthetizing", <add> "anaesthetist": "anesthetist", <add> "anaesthetists": "anesthetists", <add> "anaesthetize": "anesthetize", <add> "anaesthetized": "anesthetized", <add> "anaesthetizes": "anesthetizes", <add> "anaesthetizing": "anesthetizing", <add> "analogue": "analog", <add> "analogues": "analogs", <add> "analyse": "analyze", <add> "analysed": "analyzed", <add> "analyses": "analyzes", <add> "analysing": "analyzing", <add> "anglicise": "anglicize", <add> "anglicised": "anglicized", <add> "anglicises": "anglicizes", <add> "anglicising": "anglicizing", <add> "annualised": "annualized", <add> "antagonise": "antagonize", <add> "antagonised": "antagonized", <add> "antagonises": "antagonizes", <add> "antagonising": "antagonizing", <add> "apologise": "apologize", <add> "apologised": "apologized", <add> "apologises": "apologizes", <add> "apologising": "apologizing", <add> "appal": "appall", <add> "appals": "appalls", <add> "appetiser": "appetizer", <add> "appetisers": "appetizers", <add> "appetising": "appetizing", <add> "appetisingly": "appetizingly", <add> "arbour": "arbor", <add> "arbours": "arbors", <add> "archaeological": "archeological", <add> "archaeologically": "archeologically", <add> "archaeologist": "archeologist", <add> "archaeologists": "archeologists", <add> "archaeology": "archeology", <add> "ardour": "ardor", <add> "armour": "armor", <add> "armoured": "armored", <add> "armourer": "armorer", <add> "armourers": "armorers", <add> "armouries": "armories", <add> "armoury": "armory", <add> "artefact": "artifact", <add> "artefacts": "artifacts", <add> "authorise": "authorize", <add> "authorised": "authorized", <add> "authorises": "authorizes", <add> "authorising": "authorizing", <add> "axe": "ax", <add> "backpedalled": "backpedaled", <add> "backpedalling": "backpedaling", <add> "bannister": "banister", <add> "bannisters": "banisters", <add> "baptise": "baptize", <add> "baptised": "baptized", <add> "baptises": "baptizes", <add> "baptising": "baptizing", <add> "bastardise": "bastardize", <add> "bastardised": "bastardized", <add> "bastardises": "bastardizes", <add> "bastardising": "bastardizing", <add> "battleaxe": "battleax", <add> "baulk": "balk", <add> "baulked": "balked", <add> "baulking": "balking", <add> "baulks": "balks", <add> "bedevilled": "bedeviled", <add> "bedevilling": "bedeviling", <add> "behaviour": "behavior", <add> "behavioural": "behavioral", <add> "behaviourism": "behaviorism", <add> "behaviourist": "behaviorist", <add> "behaviourists": "behaviorists", <add> "behaviours": "behaviors", <add> "behove": "behoove", <add> "behoved": "behooved", <add> "behoves": "behooves", <add> "bejewelled": "bejeweled", <add> "belabour": "belabor", <add> "belaboured": "belabored", <add> "belabouring": "belaboring", <add> "belabours": "belabors", <add> "bevelled": "beveled", <add> "bevvies": "bevies", <add> "bevvy": "bevy", <add> "biassed": "biased", <add> "biassing": "biasing", <add> "bingeing": "binging", <add> "bougainvillaea": "bougainvillea", <add> "bougainvillaeas": "bougainvilleas", <add> "bowdlerise": "bowdlerize", <add> "bowdlerised": "bowdlerized", <add> "bowdlerises": "bowdlerizes", <add> "bowdlerising": "bowdlerizing", <add> "breathalyse": "breathalyze", <add> "breathalysed": "breathalyzed", <add> "breathalyser": "breathalyzer", <add> "breathalysers": "breathalyzers", <add> "breathalyses": "breathalyzes", <add> "breathalysing": "breathalyzing", <add> "brutalise": "brutalize", <add> "brutalised": "brutalized", <add> "brutalises": "brutalizes", <add> "brutalising": "brutalizing", <add> "buses": "busses", <add> "busing": "bussing", <add> "caesarean": "cesarean", <add> "caesareans": "cesareans", <add> "calibre": "caliber", <add> "calibres": "calibers", <add> "calliper": "caliper", <add> "callipers": "calipers", <add> "callisthenics": "calisthenics", <add> "canalise": "canalize", <add> "canalised": "canalized", <add> "canalises": "canalizes", <add> "canalising": "canalizing", <add> "cancellation": "cancelation", <add> "cancellations": "cancelations", <add> "cancelled": "canceled", <add> "cancelling": "canceling", <add> "candour": "candor", <add> "cannibalise": "cannibalize", <add> "cannibalised": "cannibalized", <add> "cannibalises": "cannibalizes", <add> "cannibalising": "cannibalizing", <add> "canonise": "canonize", <add> "canonised": "canonized", <add> "canonises": "canonizes", <add> "canonising": "canonizing", <add> "capitalise": "capitalize", <add> "capitalised": "capitalized", <add> "capitalises": "capitalizes", <add> "capitalising": "capitalizing", <add> "caramelise": "caramelize", <add> "caramelised": "caramelized", <add> "caramelises": "caramelizes", <add> "caramelising": "caramelizing", <add> "carbonise": "carbonize", <add> "carbonised": "carbonized", <add> "carbonises": "carbonizes", <add> "carbonising": "carbonizing", <add> "carolled": "caroled", <add> "carolling": "caroling", <add> "catalogue": "catalog", <add> "catalogued": "cataloged", <add> "catalogues": "catalogs", <add> "cataloguing": "cataloging", <add> "catalyse": "catalyze", <add> "catalysed": "catalyzed", <add> "catalyses": "catalyzes", <add> "catalysing": "catalyzing", <add> "categorise": "categorize", <add> "categorised": "categorized", <add> "categorises": "categorizes", <add> "categorising": "categorizing", <add> "cauterise": "cauterize", <add> "cauterised": "cauterized", <add> "cauterises": "cauterizes", <add> "cauterising": "cauterizing", <add> "cavilled": "caviled", <add> "cavilling": "caviling", <add> "centigramme": "centigram", <add> "centigrammes": "centigrams", <add> "centilitre": "centiliter", <add> "centilitres": "centiliters", <add> "centimetre": "centimeter", <add> "centimetres": "centimeters", <add> "centralise": "centralize", <add> "centralised": "centralized", <add> "centralises": "centralizes", <add> "centralising": "centralizing", <add> "centre": "center", <add> "centred": "centered", <add> "centrefold": "centerfold", <add> "centrefolds": "centerfolds", <add> "centrepiece": "centerpiece", <add> "centrepieces": "centerpieces", <add> "centres": "centers", <add> "channelled": "channeled", <add> "channelling": "channeling", <add> "characterise": "characterize", <add> "characterised": "characterized", <add> "characterises": "characterizes", <add> "characterising": "characterizing", <add> "cheque": "check", <add> "chequebook": "checkbook", <add> "chequebooks": "checkbooks", <add> "chequered": "checkered", <add> "cheques": "checks", <add> "chilli": "chili", <add> "chimaera": "chimera", <add> "chimaeras": "chimeras", <add> "chiselled": "chiseled", <add> "chiselling": "chiseling", <add> "circularise": "circularize", <add> "circularised": "circularized", <add> "circularises": "circularizes", <add> "circularising": "circularizing", <add> "civilise": "civilize", <add> "civilised": "civilized", <add> "civilises": "civilizes", <add> "civilising": "civilizing", <add> "clamour": "clamor", <add> "clamoured": "clamored", <add> "clamouring": "clamoring", <add> "clamours": "clamors", <add> "clangour": "clangor", <add> "clarinettist": "clarinetist", <add> "clarinettists": "clarinetists", <add> "collectivise": "collectivize", <add> "collectivised": "collectivized", <add> "collectivises": "collectivizes", <add> "collectivising": "collectivizing", <add> "colonisation": "colonization", <add> "colonise": "colonize", <add> "colonised": "colonized", <add> "coloniser": "colonizer", <add> "colonisers": "colonizers", <add> "colonises": "colonizes", <add> "colonising": "colonizing", <add> "colour": "color", <add> "colourant": "colorant", <add> "colourants": "colorants", <add> "coloured": "colored", <add> "coloureds": "coloreds", <add> "colourful": "colorful", <add> "colourfully": "colorfully", <add> "colouring": "coloring", <add> "colourize": "colorize", <add> "colourized": "colorized", <add> "colourizes": "colorizes", <add> "colourizing": "colorizing", <add> "colourless": "colorless", <add> "colours": "colors", <add> "commercialise": "commercialize", <add> "commercialised": "commercialized", <add> "commercialises": "commercializes", <add> "commercialising": "commercializing", <add> "compartmentalise": "compartmentalize", <add> "compartmentalised": "compartmentalized", <add> "compartmentalises": "compartmentalizes", <add> "compartmentalising": "compartmentalizing", <add> "computerise": "computerize", <add> "computerised": "computerized", <add> "computerises": "computerizes", <add> "computerising": "computerizing", <add> "conceptualise": "conceptualize", <add> "conceptualised": "conceptualized", <add> "conceptualises": "conceptualizes", <add> "conceptualising": "conceptualizing", <add> "connexion": "connection", <add> "connexions": "connections", <add> "contextualise": "contextualize", <add> "contextualised": "contextualized", <add> "contextualises": "contextualizes", <add> "contextualising": "contextualizing", <add> "cosier": "cozier", <add> "cosies": "cozies", <add> "cosiest": "coziest", <add> "cosily": "cozily", <add> "cosiness": "coziness", <add> "cosy": "cozy", <add> "councillor": "councilor", <add> "councillors": "councilors", <add> "counselled": "counseled", <add> "counselling": "counseling", <add> "counsellor": "counselor", <add> "counsellors": "counselors", <add> "crenellated": "crenelated", <add> "criminalise": "criminalize", <add> "criminalised": "criminalized", <add> "criminalises": "criminalizes", <add> "criminalising": "criminalizing", <add> "criticise": "criticize", <add> "criticised": "criticized", <add> "criticises": "criticizes", <add> "criticising": "criticizing", <add> "crueller": "crueler", <add> "cruellest": "cruelest", <add> "crystallisation": "crystallization", <add> "crystallise": "crystallize", <add> "crystallised": "crystallized", <add> "crystallises": "crystallizes", <add> "crystallising": "crystallizing", <add> "cudgelled": "cudgeled", <add> "cudgelling": "cudgeling", <add> "customise": "customize", <add> "customised": "customized", <add> "customises": "customizes", <add> "customising": "customizing", <add> "cypher": "cipher", <add> "cyphers": "ciphers", <add> "decentralisation": "decentralization", <add> "decentralise": "decentralize", <add> "decentralised": "decentralized", <add> "decentralises": "decentralizes", <add> "decentralising": "decentralizing", <add> "decriminalisation": "decriminalization", <add> "decriminalise": "decriminalize", <add> "decriminalised": "decriminalized", <add> "decriminalises": "decriminalizes", <add> "decriminalising": "decriminalizing", <add> "defence": "defense", <add> "defenceless": "defenseless", <add> "defences": "defenses", <add> "dehumanisation": "dehumanization", <add> "dehumanise": "dehumanize", <add> "dehumanised": "dehumanized", <add> "dehumanises": "dehumanizes", <add> "dehumanising": "dehumanizing", <add> "demeanour": "demeanor", <add> "demilitarisation": "demilitarization", <add> "demilitarise": "demilitarize", <add> "demilitarised": "demilitarized", <add> "demilitarises": "demilitarizes", <add> "demilitarising": "demilitarizing", <add> "demobilisation": "demobilization", <add> "demobilise": "demobilize", <add> "demobilised": "demobilized", <add> "demobilises": "demobilizes", <add> "demobilising": "demobilizing", <add> "democratisation": "democratization", <add> "democratise": "democratize", <add> "democratised": "democratized", <add> "democratises": "democratizes", <add> "democratising": "democratizing", <add> "demonise": "demonize", <add> "demonised": "demonized", <add> "demonises": "demonizes", <add> "demonising": "demonizing", <add> "demoralisation": "demoralization", <add> "demoralise": "demoralize", <add> "demoralised": "demoralized", <add> "demoralises": "demoralizes", <add> "demoralising": "demoralizing", <add> "denationalisation": "denationalization", <add> "denationalise": "denationalize", <add> "denationalised": "denationalized", <add> "denationalises": "denationalizes", <add> "denationalising": "denationalizing", <add> "deodorise": "deodorize", <add> "deodorised": "deodorized", <add> "deodorises": "deodorizes", <add> "deodorising": "deodorizing", <add> "depersonalise": "depersonalize", <add> "depersonalised": "depersonalized", <add> "depersonalises": "depersonalizes", <add> "depersonalising": "depersonalizing", <add> "deputise": "deputize", <add> "deputised": "deputized", <add> "deputises": "deputizes", <add> "deputising": "deputizing", <add> "desensitisation": "desensitization", <add> "desensitise": "desensitize", <add> "desensitised": "desensitized", <add> "desensitises": "desensitizes", <add> "desensitising": "desensitizing", <add> "destabilisation": "destabilization", <add> "destabilise": "destabilize", <add> "destabilised": "destabilized", <add> "destabilises": "destabilizes", <add> "destabilising": "destabilizing", <add> "dialled": "dialed", <add> "dialling": "dialing", <add> "dialogue": "dialog", <add> "dialogues": "dialogs", <add> "diarrhoea": "diarrhea", <add> "digitise": "digitize", <add> "digitised": "digitized", <add> "digitises": "digitizes", <add> "digitising": "digitizing", <add> "disc": "disk", <add> "discolour": "discolor", <add> "discoloured": "discolored", <add> "discolouring": "discoloring", <add> "discolours": "discolors", <add> "discs": "disks", <add> "disembowelled": "disemboweled", <add> "disembowelling": "disemboweling", <add> "disfavour": "disfavor", <add> "dishevelled": "disheveled", <add> "dishonour": "dishonor", <add> "dishonourable": "dishonorable", <add> "dishonourably": "dishonorably", <add> "dishonoured": "dishonored", <add> "dishonouring": "dishonoring", <add> "dishonours": "dishonors", <add> "disorganisation": "disorganization", <add> "disorganised": "disorganized", <add> "distil": "distill", <add> "distils": "distills", <add> "dramatisation": "dramatization", <add> "dramatisations": "dramatizations", <add> "dramatise": "dramatize", <add> "dramatised": "dramatized", <add> "dramatises": "dramatizes", <add> "dramatising": "dramatizing", <add> "draught": "draft", <add> "draughtboard": "draftboard", <add> "draughtboards": "draftboards", <add> "draughtier": "draftier", <add> "draughtiest": "draftiest", <add> "draughts": "drafts", <add> "draughtsman": "draftsman", <add> "draughtsmanship": "draftsmanship", <add> "draughtsmen": "draftsmen", <add> "draughtswoman": "draftswoman", <add> "draughtswomen": "draftswomen", <add> "draughty": "drafty", <add> "drivelled": "driveled", <add> "drivelling": "driveling", <add> "duelled": "dueled", <add> "duelling": "dueling", <add> "economise": "economize", <add> "economised": "economized", <add> "economises": "economizes", <add> "economising": "economizing", <add> "edoema": "edema ", <add> "editorialise": "editorialize", <add> "editorialised": "editorialized", <add> "editorialises": "editorializes", <add> "editorialising": "editorializing", <add> "empathise": "empathize", <add> "empathised": "empathized", <add> "empathises": "empathizes", <add> "empathising": "empathizing", <add> "emphasise": "emphasize", <add> "emphasised": "emphasized", <add> "emphasises": "emphasizes", <add> "emphasising": "emphasizing", <add> "enamelled": "enameled", <add> "enamelling": "enameling", <add> "enamoured": "enamored", <add> "encyclopaedia": "encyclopedia", <add> "encyclopaedias": "encyclopedias", <add> "encyclopaedic": "encyclopedic", <add> "endeavour": "endeavor", <add> "endeavoured": "endeavored", <add> "endeavouring": "endeavoring", <add> "endeavours": "endeavors", <add> "energise": "energize", <add> "energised": "energized", <add> "energises": "energizes", <add> "energising": "energizing", <add> "enrol": "enroll", <add> "enrols": "enrolls", <add> "enthral": "enthrall", <add> "enthrals": "enthralls", <add> "epaulette": "epaulet", <add> "epaulettes": "epaulets", <add> "epicentre": "epicenter", <add> "epicentres": "epicenters", <add> "epilogue": "epilog", <add> "epilogues": "epilogs", <add> "epitomise": "epitomize", <add> "epitomised": "epitomized", <add> "epitomises": "epitomizes", <add> "epitomising": "epitomizing", <add> "equalisation": "equalization", <add> "equalise": "equalize", <add> "equalised": "equalized", <add> "equaliser": "equalizer", <add> "equalisers": "equalizers", <add> "equalises": "equalizes", <add> "equalising": "equalizing", <add> "eulogise": "eulogize", <add> "eulogised": "eulogized", <add> "eulogises": "eulogizes", <add> "eulogising": "eulogizing", <add> "evangelise": "evangelize", <add> "evangelised": "evangelized", <add> "evangelises": "evangelizes", <add> "evangelising": "evangelizing", <add> "exorcise": "exorcize", <add> "exorcised": "exorcized", <add> "exorcises": "exorcizes", <add> "exorcising": "exorcizing", <add> "extemporisation": "extemporization", <add> "extemporise": "extemporize", <add> "extemporised": "extemporized", <add> "extemporises": "extemporizes", <add> "extemporising": "extemporizing", <add> "externalisation": "externalization", <add> "externalisations": "externalizations", <add> "externalise": "externalize", <add> "externalised": "externalized", <add> "externalises": "externalizes", <add> "externalising": "externalizing", <add> "factorise": "factorize", <add> "factorised": "factorized", <add> "factorises": "factorizes", <add> "factorising": "factorizing", <add> "faecal": "fecal", <add> "faeces": "feces", <add> "familiarisation": "familiarization", <add> "familiarise": "familiarize", <add> "familiarised": "familiarized", <add> "familiarises": "familiarizes", <add> "familiarising": "familiarizing", <add> "fantasise": "fantasize", <add> "fantasised": "fantasized", <add> "fantasises": "fantasizes", <add> "fantasising": "fantasizing", <add> "favour": "favor", <add> "favourable": "favorable", <add> "favourably": "favorably", <add> "favoured": "favored", <add> "favouring": "favoring", <add> "favourite": "favorite", <add> "favourites": "favorites", <add> "favouritism": "favoritism", <add> "favours": "favors", <add> "feminise": "feminize", <add> "feminised": "feminized", <add> "feminises": "feminizes", <add> "feminising": "feminizing", <add> "fertilisation": "fertilization", <add> "fertilise": "fertilize", <add> "fertilised": "fertilized", <add> "fertiliser": "fertilizer", <add> "fertilisers": "fertilizers", <add> "fertilises": "fertilizes", <add> "fertilising": "fertilizing", <add> "fervour": "fervor", <add> "fibre": "fiber", <add> "fibreglass": "fiberglass", <add> "fibres": "fibers", <add> "fictionalisation": "fictionalization", <add> "fictionalisations": "fictionalizations", <add> "fictionalise": "fictionalize", <add> "fictionalised": "fictionalized", <add> "fictionalises": "fictionalizes", <add> "fictionalising": "fictionalizing", <add> "fillet": "filet", <add> "filleted ": "fileted ", <add> "filleting": "fileting", <add> "fillets ": "filets ", <add> "finalisation": "finalization", <add> "finalise": "finalize", <add> "finalised": "finalized", <add> "finalises": "finalizes", <add> "finalising": "finalizing", <add> "flautist": "flutist", <add> "flautists": "flutists", <add> "flavour": "flavor", <add> "flavoured": "flavored", <add> "flavouring": "flavoring", <add> "flavourings": "flavorings", <add> "flavourless": "flavorless", <add> "flavours": "flavors", <add> "flavoursome": "flavorsome", <add> "flyer / flier ": "flier / flyer ", <add> "foetal": "fetal", <add> "foetid": "fetid", <add> "foetus": "fetus", <add> "foetuses": "fetuses", <add> "formalisation": "formalization", <add> "formalise": "formalize", <add> "formalised": "formalized", <add> "formalises": "formalizes", <add> "formalising": "formalizing", <add> "fossilisation": "fossilization", <add> "fossilise": "fossilize", <add> "fossilised": "fossilized", <add> "fossilises": "fossilizes", <add> "fossilising": "fossilizing", <add> "fraternisation": "fraternization", <add> "fraternise": "fraternize", <add> "fraternised": "fraternized", <add> "fraternises": "fraternizes", <add> "fraternising": "fraternizing", <add> "fulfil": "fulfill", <add> "fulfilment": "fulfillment", <add> "fulfils": "fulfills", <add> "funnelled": "funneled", <add> "funnelling": "funneling", <add> "galvanise": "galvanize", <add> "galvanised": "galvanized", <add> "galvanises": "galvanizes", <add> "galvanising": "galvanizing", <add> "gambolled": "gamboled", <add> "gambolling": "gamboling", <add> "gaol": "jail", <add> "gaolbird": "jailbird", <add> "gaolbirds": "jailbirds", <add> "gaolbreak": "jailbreak", <add> "gaolbreaks": "jailbreaks", <add> "gaoled": "jailed", <add> "gaoler": "jailer", <add> "gaolers": "jailers", <add> "gaoling": "jailing", <add> "gaols": "jails", <add> "gases": "gasses", <add> "gauge": "gage", <add> "gauged": "gaged", <add> "gauges": "gages", <add> "gauging": "gaging", <add> "generalisation": "generalization", <add> "generalisations": "generalizations", <add> "generalise": "generalize", <add> "generalised": "generalized", <add> "generalises": "generalizes", <add> "generalising": "generalizing", <add> "ghettoise": "ghettoize", <add> "ghettoised": "ghettoized", <add> "ghettoises": "ghettoizes", <add> "ghettoising": "ghettoizing", <add> "gipsies": "gypsies", <add> "glamorise": "glamorize", <add> "glamorised": "glamorized", <add> "glamorises": "glamorizes", <add> "glamorising": "glamorizing", <add> "glamour": "glamor", <add> "globalisation": "globalization", <add> "globalise": "globalize", <add> "globalised": "globalized", <add> "globalises": "globalizes", <add> "globalising": "globalizing", <add> "glueing ": "gluing ", <add> "goitre": "goiter", <add> "goitres": "goiters", <add> "gonorrhoea": "gonorrhea", <add> "gramme": "gram", <add> "grammes": "grams", <add> "gravelled": "graveled", <add> "grey": "gray", <add> "greyed": "grayed", <add> "greying": "graying", <add> "greyish": "grayish", <add> "greyness": "grayness", <add> "greys": "grays", <add> "grovelled": "groveled", <add> "grovelling": "groveling", <add> "groyne": "groin", <add> "groynes ": "groins", <add> "gruelling": "grueling", <add> "gruellingly": "gruelingly", <add> "gryphon": "griffin", <add> "gryphons": "griffins", <add> "gynaecological": "gynecological", <add> "gynaecologist": "gynecologist", <add> "gynaecologists": "gynecologists", <add> "gynaecology": "gynecology", <add> "haematological": "hematological", <add> "haematologist": "hematologist", <add> "haematologists": "hematologists", <add> "haematology": "hematology", <add> "haemoglobin": "hemoglobin", <add> "haemophilia": "hemophilia", <add> "haemophiliac": "hemophiliac", <add> "haemophiliacs": "hemophiliacs", <add> "haemorrhage": "hemorrhage", <add> "haemorrhaged": "hemorrhaged", <add> "haemorrhages": "hemorrhages", <add> "haemorrhaging": "hemorrhaging", <add> "haemorrhoids": "hemorrhoids", <add> "harbour": "harbor", <add> "harboured": "harbored", <add> "harbouring": "harboring", <add> "harbours": "harbors", <add> "harmonisation": "harmonization", <add> "harmonise": "harmonize", <add> "harmonised": "harmonized", <add> "harmonises": "harmonizes", <add> "harmonising": "harmonizing", <add> "homoeopath": "homeopath", <add> "homoeopathic": "homeopathic", <add> "homoeopaths": "homeopaths", <add> "homoeopathy": "homeopathy", <add> "homogenise": "homogenize", <add> "homogenised": "homogenized", <add> "homogenises": "homogenizes", <add> "homogenising": "homogenizing", <add> "honour": "honor", <add> "honourable": "honorable", <add> "honourably": "honorably", <add> "honoured": "honored", <add> "honouring": "honoring", <add> "honours": "honors", <add> "hospitalisation": "hospitalization", <add> "hospitalise": "hospitalize", <add> "hospitalised": "hospitalized", <add> "hospitalises": "hospitalizes", <add> "hospitalising": "hospitalizing", <add> "humanise": "humanize", <add> "humanised": "humanized", <add> "humanises": "humanizes", <add> "humanising": "humanizing", <add> "humour": "humor", <add> "humoured": "humored", <add> "humouring": "humoring", <add> "humourless": "humorless", <add> "humours": "humors", <add> "hybridise": "hybridize", <add> "hybridised": "hybridized", <add> "hybridises": "hybridizes", <add> "hybridising": "hybridizing", <add> "hypnotise": "hypnotize", <add> "hypnotised": "hypnotized", <add> "hypnotises": "hypnotizes", <add> "hypnotising": "hypnotizing", <add> "hypothesise": "hypothesize", <add> "hypothesised": "hypothesized", <add> "hypothesises": "hypothesizes", <add> "hypothesising": "hypothesizing", <add> "idealisation": "idealization", <add> "idealise": "idealize", <add> "idealised": "idealized", <add> "idealises": "idealizes", <add> "idealising": "idealizing", <add> "idolise": "idolize", <add> "idolised": "idolized", <add> "idolises": "idolizes", <add> "idolising": "idolizing", <add> "immobilisation": "immobilization", <add> "immobilise": "immobilize", <add> "immobilised": "immobilized", <add> "immobiliser": "immobilizer", <add> "immobilisers": "immobilizers", <add> "immobilises": "immobilizes", <add> "immobilising": "immobilizing", <add> "immortalise": "immortalize", <add> "immortalised": "immortalized", <add> "immortalises": "immortalizes", <add> "immortalising": "immortalizing", <add> "immunisation": "immunization", <add> "immunise": "immunize", <add> "immunised": "immunized", <add> "immunises": "immunizes", <add> "immunising": "immunizing", <add> "impanelled": "impaneled", <add> "impanelling": "impaneling", <add> "imperilled": "imperiled", <add> "imperilling": "imperiling", <add> "individualise": "individualize", <add> "individualised": "individualized", <add> "individualises": "individualizes", <add> "individualising": "individualizing", <add> "industrialise": "industrialize", <add> "industrialised": "industrialized", <add> "industrialises": "industrializes", <add> "industrialising": "industrializing", <add> "inflexion": "inflection", <add> "inflexions": "inflections", <add> "initialise": "initialize", <add> "initialised": "initialized", <add> "initialises": "initializes", <add> "initialising": "initializing", <add> "initialled": "initialed", <add> "initialling": "initialing", <add> "instal": "install", <add> "instalment": "installment", <add> "instalments": "installments", <add> "instals": "installs", <add> "instil": "instill", <add> "instils": "instills", <add> "institutionalisation": "institutionalization", <add> "institutionalise": "institutionalize", <add> "institutionalised": "institutionalized", <add> "institutionalises": "institutionalizes", <add> "institutionalising": "institutionalizing", <add> "intellectualise": "intellectualize", <add> "intellectualised": "intellectualized", <add> "intellectualises": "intellectualizes", <add> "intellectualising": "intellectualizing", <add> "internalisation": "internalization", <add> "internalise": "internalize", <add> "internalised": "internalized", <add> "internalises": "internalizes", <add> "internalising": "internalizing", <add> "internationalisation": "internationalization", <add> "internationalise": "internationalize", <add> "internationalised": "internationalized", <add> "internationalises": "internationalizes", <add> "internationalising": "internationalizing", <add> "ionisation": "ionization", <add> "ionise": "ionize", <add> "ionised": "ionized", <add> "ioniser": "ionizer", <add> "ionisers": "ionizers", <add> "ionises": "ionizes", <add> "ionising": "ionizing", <add> "italicise": "italicize", <add> "italicised": "italicized", <add> "italicises": "italicizes", <add> "italicising": "italicizing", <add> "itemise": "itemize", <add> "itemised": "itemized", <add> "itemises": "itemizes", <add> "itemising": "itemizing", <add> "jeopardise": "jeopardize", <add> "jeopardised": "jeopardized", <add> "jeopardises": "jeopardizes", <add> "jeopardising": "jeopardizing", <add> "jewelled": "jeweled", <add> "jeweller": "jeweler", <add> "jewellers": "jewelers", <add> "jewellery": "jewelry", <add> "judgement ": "judgment", <add> "kilogramme": "kilogram", <add> "kilogrammes": "kilograms", <add> "kilometre": "kilometer", <add> "kilometres": "kilometers", <add> "labelled": "labeled", <add> "labelling": "labeling", <add> "labour": "labor", <add> "laboured": "labored", <add> "labourer": "laborer", <add> "labourers": "laborers", <add> "labouring": "laboring", <add> "labours": "labors", <add> "lacklustre": "lackluster", <add> "legalisation": "legalization", <add> "legalise": "legalize", <add> "legalised": "legalized", <add> "legalises": "legalizes", <add> "legalising": "legalizing", <add> "legitimise": "legitimize", <add> "legitimised": "legitimized", <add> "legitimises": "legitimizes", <add> "legitimising": "legitimizing", <add> "leukaemia": "leukemia", <add> "levelled": "leveled", <add> "leveller": "leveler", <add> "levellers": "levelers", <add> "levelling": "leveling", <add> "libelled": "libeled", <add> "libelling": "libeling", <add> "libellous": "libelous", <add> "liberalisation": "liberalization", <add> "liberalise": "liberalize", <add> "liberalised": "liberalized", <add> "liberalises": "liberalizes", <add> "liberalising": "liberalizing", <add> "licence": "license", <add> "licenced": "licensed", <add> "licences": "licenses", <add> "licencing": "licensing", <add> "likeable": "likable ", <add> "lionisation": "lionization", <add> "lionise": "lionize", <add> "lionised": "lionized", <add> "lionises": "lionizes", <add> "lionising": "lionizing", <add> "liquidise": "liquidize", <add> "liquidised": "liquidized", <add> "liquidiser": "liquidizer", <add> "liquidisers": "liquidizers", <add> "liquidises": "liquidizes", <add> "liquidising": "liquidizing", <add> "litre": "liter", <add> "litres": "liters", <add> "localise": "localize", <add> "localised": "localized", <add> "localises": "localizes", <add> "localising": "localizing", <add> "louvre": "louver", <add> "louvred": "louvered", <add> "louvres": "louvers ", <add> "lustre": "luster", <add> "magnetise": "magnetize", <add> "magnetised": "magnetized", <add> "magnetises": "magnetizes", <add> "magnetising": "magnetizing", <add> "manoeuvrability": "maneuverability", <add> "manoeuvrable": "maneuverable", <add> "manoeuvre": "maneuver", <add> "manoeuvred": "maneuvered", <add> "manoeuvres": "maneuvers", <add> "manoeuvring": "maneuvering", <add> "manoeuvrings": "maneuverings", <add> "marginalisation": "marginalization", <add> "marginalise": "marginalize", <add> "marginalised": "marginalized", <add> "marginalises": "marginalizes", <add> "marginalising": "marginalizing", <add> "marshalled": "marshaled", <add> "marshalling": "marshaling", <add> "marvelled": "marveled", <add> "marvelling": "marveling", <add> "marvellous": "marvelous", <add> "marvellously": "marvelously", <add> "materialisation": "materialization", <add> "materialise": "materialize", <add> "materialised": "materialized", <add> "materialises": "materializes", <add> "materialising": "materializing", <add> "maximisation": "maximization", <add> "maximise": "maximize", <add> "maximised": "maximized", <add> "maximises": "maximizes", <add> "maximising": "maximizing", <add> "meagre": "meager", <add> "mechanisation": "mechanization", <add> "mechanise": "mechanize", <add> "mechanised": "mechanized", <add> "mechanises": "mechanizes", <add> "mechanising": "mechanizing", <add> "mediaeval": "medieval", <add> "memorialise": "memorialize", <add> "memorialised": "memorialized", <add> "memorialises": "memorializes", <add> "memorialising": "memorializing", <add> "memorise": "memorize", <add> "memorised": "memorized", <add> "memorises": "memorizes", <add> "memorising": "memorizing", <add> "mesmerise": "mesmerize", <add> "mesmerised": "mesmerized", <add> "mesmerises": "mesmerizes", <add> "mesmerising": "mesmerizing", <add> "metabolise": "metabolize", <add> "metabolised": "metabolized", <add> "metabolises": "metabolizes", <add> "metabolising": "metabolizing", <add> "metre": "meter", <add> "metres": "meters", <add> "micrometre": "micrometer", <add> "micrometres": "micrometers", <add> "militarise": "militarize", <add> "militarised": "militarized", <add> "militarises": "militarizes", <add> "militarising": "militarizing", <add> "milligramme": "milligram", <add> "milligrammes": "milligrams", <add> "millilitre": "milliliter", <add> "millilitres": "milliliters", <add> "millimetre": "millimeter", <add> "millimetres": "millimeters", <add> "miniaturisation": "miniaturization", <add> "miniaturise": "miniaturize", <add> "miniaturised": "miniaturized", <add> "miniaturises": "miniaturizes", <add> "miniaturising": "miniaturizing", <add> "minibuses": "minibusses ", <add> "minimise": "minimize", <add> "minimised": "minimized", <add> "minimises": "minimizes", <add> "minimising": "minimizing", <add> "misbehaviour": "misbehavior", <add> "misdemeanour": "misdemeanor", <add> "misdemeanours": "misdemeanors", <add> "misspelt": "misspelled ", <add> "mitre": "miter", <add> "mitres": "miters", <add> "mobilisation": "mobilization", <add> "mobilise": "mobilize", <add> "mobilised": "mobilized", <add> "mobilises": "mobilizes", <add> "mobilising": "mobilizing", <add> "modelled": "modeled", <add> "modeller": "modeler", <add> "modellers": "modelers", <add> "modelling": "modeling", <add> "modernise": "modernize", <add> "modernised": "modernized", <add> "modernises": "modernizes", <add> "modernising": "modernizing", <add> "moisturise": "moisturize", <add> "moisturised": "moisturized", <add> "moisturiser": "moisturizer", <add> "moisturisers": "moisturizers", <add> "moisturises": "moisturizes", <add> "moisturising": "moisturizing", <add> "monologue": "monolog", <add> "monologues": "monologs", <add> "monopolisation": "monopolization", <add> "monopolise": "monopolize", <add> "monopolised": "monopolized", <add> "monopolises": "monopolizes", <add> "monopolising": "monopolizing", <add> "moralise": "moralize", <add> "moralised": "moralized", <add> "moralises": "moralizes", <add> "moralising": "moralizing", <add> "motorised": "motorized", <add> "mould": "mold", <add> "moulded": "molded", <add> "moulder": "molder", <add> "mouldered": "moldered", <add> "mouldering": "moldering", <add> "moulders": "molders", <add> "mouldier": "moldier", <add> "mouldiest": "moldiest", <add> "moulding": "molding", <add> "mouldings": "moldings", <add> "moulds": "molds", <add> "mouldy": "moldy", <add> "moult": "molt", <add> "moulted": "molted", <add> "moulting": "molting", <add> "moults": "molts", <add> "moustache": "mustache", <add> "moustached": "mustached", <add> "moustaches": "mustaches", <add> "moustachioed": "mustachioed", <add> "multicoloured": "multicolored", <add> "nationalisation": "nationalization", <add> "nationalisations": "nationalizations", <add> "nationalise": "nationalize", <add> "nationalised": "nationalized", <add> "nationalises": "nationalizes", <add> "nationalising": "nationalizing", <add> "naturalisation": "naturalization", <add> "naturalise": "naturalize", <add> "naturalised": "naturalized", <add> "naturalises": "naturalizes", <add> "naturalising": "naturalizing", <add> "neighbour": "neighbor", <add> "neighbourhood": "neighborhood", <add> "neighbourhoods": "neighborhoods", <add> "neighbouring": "neighboring", <add> "neighbourliness": "neighborliness", <add> "neighbourly": "neighborly", <add> "neighbours": "neighbors", <add> "neutralisation": "neutralization", <add> "neutralise": "neutralize", <add> "neutralised": "neutralized", <add> "neutralises": "neutralizes", <add> "neutralising": "neutralizing", <add> "normalisation": "normalization", <add> "normalise": "normalize", <add> "normalised": "normalized", <add> "normalises": "normalizes", <add> "normalising": "normalizing", <add> "odour": "odor", <add> "odourless": "odorless", <add> "odours": "odors", <add> "oesophagus": "esophagus", <add> "oesophaguses": "esophaguses", <add> "oestrogen": "estrogen", <add> "offence": "offense", <add> "offences": "offenses", <add> "omelette": "omelet", <add> "omelettes": "omelets", <add> "optimise": "optimize", <add> "optimised": "optimized", <add> "optimises": "optimizes", <add> "optimising": "optimizing", <add> "organisation": "organization", <add> "organisational": "organizational", <add> "organisations": "organizations", <add> "organise": "organize", <add> "organised": "organized", <add> "organiser": "organizer", <add> "organisers": "organizers", <add> "organises": "organizes", <add> "organising": "organizing", <add> "orthopaedic": "orthopedic", <add> "orthopaedics": "orthopedics", <add> "ostracise": "ostracize", <add> "ostracised": "ostracized", <add> "ostracises": "ostracizes", <add> "ostracising": "ostracizing", <add> "outmanoeuvre": "outmaneuver", <add> "outmanoeuvred": "outmaneuvered", <add> "outmanoeuvres": "outmaneuvers", <add> "outmanoeuvring": "outmaneuvering", <add> "overemphasise": "overemphasize", <add> "overemphasised": "overemphasized", <add> "overemphasises": "overemphasizes", <add> "overemphasising": "overemphasizing", <add> "oxidisation": "oxidization", <add> "oxidise": "oxidize", <add> "oxidised": "oxidized", <add> "oxidises": "oxidizes", <add> "oxidising": "oxidizing", <add> "paederast": "pederast", <add> "paederasts": "pederasts", <add> "paediatric": "pediatric", <add> "paediatrician": "pediatrician", <add> "paediatricians": "pediatricians", <add> "paediatrics": "pediatrics", <add> "paedophile": "pedophile", <add> "paedophiles": "pedophiles", <add> "paedophilia": "pedophilia", <add> "palaeolithic": "paleolithic", <add> "palaeontologist": "paleontologist", <add> "palaeontologists": "paleontologists", <add> "palaeontology": "paleontology", <add> "panelled": "paneled", <add> "panelling": "paneling", <add> "panellist": "panelist", <add> "panellists": "panelists", <add> "paralyse": "paralyze", <add> "paralysed": "paralyzed", <add> "paralyses": "paralyzes", <add> "paralysing": "paralyzing", <add> "parcelled": "parceled", <add> "parcelling": "parceling", <add> "parlour": "parlor", <add> "parlours": "parlors", <add> "particularise": "particularize", <add> "particularised": "particularized", <add> "particularises": "particularizes", <add> "particularising": "particularizing", <add> "passivisation": "passivization", <add> "passivise": "passivize", <add> "passivised": "passivized", <add> "passivises": "passivizes", <add> "passivising": "passivizing", <add> "pasteurisation": "pasteurization", <add> "pasteurise": "pasteurize", <add> "pasteurised": "pasteurized", <add> "pasteurises": "pasteurizes", <add> "pasteurising": "pasteurizing", <add> "patronise": "patronize", <add> "patronised": "patronized", <add> "patronises": "patronizes", <add> "patronising": "patronizing", <add> "patronisingly": "patronizingly", <add> "pedalled": "pedaled", <add> "pedalling": "pedaling", <add> "pedestrianisation": "pedestrianization", <add> "pedestrianise": "pedestrianize", <add> "pedestrianised": "pedestrianized", <add> "pedestrianises": "pedestrianizes", <add> "pedestrianising": "pedestrianizing", <add> "penalise": "penalize", <add> "penalised": "penalized", <add> "penalises": "penalizes", <add> "penalising": "penalizing", <add> "pencilled": "penciled", <add> "pencilling": "penciling", <add> "personalise": "personalize", <add> "personalised": "personalized", <add> "personalises": "personalizes", <add> "personalising": "personalizing", <add> "pharmacopoeia": "pharmacopeia", <add> "pharmacopoeias": "pharmacopeias", <add> "philosophise": "philosophize", <add> "philosophised": "philosophized", <add> "philosophises": "philosophizes", <add> "philosophising": "philosophizing", <add> "philtre": "filter", <add> "philtres": "filters", <add> "phoney ": "phony ", <add> "plagiarise": "plagiarize", <add> "plagiarised": "plagiarized", <add> "plagiarises": "plagiarizes", <add> "plagiarising": "plagiarizing", <add> "plough": "plow", <add> "ploughed": "plowed", <add> "ploughing": "plowing", <add> "ploughman": "plowman", <add> "ploughmen": "plowmen", <add> "ploughs": "plows", <add> "ploughshare": "plowshare", <add> "ploughshares": "plowshares", <add> "polarisation": "polarization", <add> "polarise": "polarize", <add> "polarised": "polarized", <add> "polarises": "polarizes", <add> "polarising": "polarizing", <add> "politicisation": "politicization", <add> "politicise": "politicize", <add> "politicised": "politicized", <add> "politicises": "politicizes", <add> "politicising": "politicizing", <add> "popularisation": "popularization", <add> "popularise": "popularize", <add> "popularised": "popularized", <add> "popularises": "popularizes", <add> "popularising": "popularizing", <add> "pouffe": "pouf", <add> "pouffes": "poufs", <add> "practise": "practice", <add> "practised": "practiced", <add> "practises": "practices", <add> "practising ": "practicing ", <add> "praesidium": "presidium", <add> "praesidiums ": "presidiums ", <add> "pressurisation": "pressurization", <add> "pressurise": "pressurize", <add> "pressurised": "pressurized", <add> "pressurises": "pressurizes", <add> "pressurising": "pressurizing", <add> "pretence": "pretense", <add> "pretences": "pretenses", <add> "primaeval": "primeval", <add> "prioritisation": "prioritization", <add> "prioritise": "prioritize", <add> "prioritised": "prioritized", <add> "prioritises": "prioritizes", <add> "prioritising": "prioritizing", <add> "privatisation": "privatization", <add> "privatisations": "privatizations", <add> "privatise": "privatize", <add> "privatised": "privatized", <add> "privatises": "privatizes", <add> "privatising": "privatizing", <add> "professionalisation": "professionalization", <add> "professionalise": "professionalize", <add> "professionalised": "professionalized", <add> "professionalises": "professionalizes", <add> "professionalising": "professionalizing", <add> "programme": "program", <add> "programmes": "programs", <add> "prologue": "prolog", <add> "prologues": "prologs", <add> "propagandise": "propagandize", <add> "propagandised": "propagandized", <add> "propagandises": "propagandizes", <add> "propagandising": "propagandizing", <add> "proselytise": "proselytize", <add> "proselytised": "proselytized", <add> "proselytiser": "proselytizer", <add> "proselytisers": "proselytizers", <add> "proselytises": "proselytizes", <add> "proselytising": "proselytizing", <add> "psychoanalyse": "psychoanalyze", <add> "psychoanalysed": "psychoanalyzed", <add> "psychoanalyses": "psychoanalyzes", <add> "psychoanalysing": "psychoanalyzing", <add> "publicise": "publicize", <add> "publicised": "publicized", <add> "publicises": "publicizes", <add> "publicising": "publicizing", <add> "pulverisation": "pulverization", <add> "pulverise": "pulverize", <add> "pulverised": "pulverized", <add> "pulverises": "pulverizes", <add> "pulverising": "pulverizing", <add> "pummelled": "pummel", <add> "pummelling": "pummeled", <add> "pyjama": "pajama", <add> "pyjamas": "pajamas", <add> "pzazz": "pizzazz", <add> "quarrelled": "quarreled", <add> "quarrelling": "quarreling", <add> "radicalise": "radicalize", <add> "radicalised": "radicalized", <add> "radicalises": "radicalizes", <add> "radicalising": "radicalizing", <add> "rancour": "rancor", <add> "randomise": "randomize", <add> "randomised": "randomized", <add> "randomises": "randomizes", <add> "randomising": "randomizing", <add> "rationalisation": "rationalization", <add> "rationalisations": "rationalizations", <add> "rationalise": "rationalize", <add> "rationalised": "rationalized", <add> "rationalises": "rationalizes", <add> "rationalising": "rationalizing", <add> "ravelled": "raveled", <add> "ravelling": "raveling", <add> "realisable": "realizable", <add> "realisation": "realization", <add> "realisations": "realizations", <add> "realise": "realize", <add> "realised": "realized", <add> "realises": "realizes", <add> "realising": "realizing", <add> "recognisable": "recognizable", <add> "recognisably": "recognizably", <add> "recognisance": "recognizance", <add> "recognise": "recognize", <add> "recognised": "recognized", <add> "recognises": "recognizes", <add> "recognising": "recognizing", <add> "reconnoitre": "reconnoiter", <add> "reconnoitred": "reconnoitered", <add> "reconnoitres": "reconnoiters", <add> "reconnoitring": "reconnoitering", <add> "refuelled": "refueled", <add> "refuelling": "refueling", <add> "regularisation": "regularization", <add> "regularise": "regularize", <add> "regularised": "regularized", <add> "regularises": "regularizes", <add> "regularising": "regularizing", <add> "remodelled": "remodeled", <add> "remodelling": "remodeling", <add> "remould": "remold", <add> "remoulded": "remolded", <add> "remoulding": "remolding", <add> "remoulds": "remolds", <add> "reorganisation": "reorganization", <add> "reorganisations": "reorganizations", <add> "reorganise": "reorganize", <add> "reorganised": "reorganized", <add> "reorganises": "reorganizes", <add> "reorganising": "reorganizing", <add> "revelled": "reveled", <add> "reveller": "reveler", <add> "revellers": "revelers", <add> "revelling": "reveling", <add> "revitalise": "revitalize", <add> "revitalised": "revitalized", <add> "revitalises": "revitalizes", <add> "revitalising": "revitalizing", <add> "revolutionise": "revolutionize", <add> "revolutionised": "revolutionized", <add> "revolutionises": "revolutionizes", <add> "revolutionising": "revolutionizing", <add> "rhapsodise": "rhapsodize", <add> "rhapsodised": "rhapsodized", <add> "rhapsodises": "rhapsodizes", <add> "rhapsodising": "rhapsodizing", <add> "rigour": "rigor", <add> "rigours": "rigors", <add> "ritualised": "ritualized", <add> "rivalled": "rivaled", <add> "rivalling": "rivaling", <add> "romanticise": "romanticize", <add> "romanticised": "romanticized", <add> "romanticises": "romanticizes", <add> "romanticising": "romanticizing", <add> "rumour": "rumor", <add> "rumoured": "rumored", <add> "rumours": "rumors", <add> "sabre": "saber", <add> "sabres": "sabers", <add> "saltpetre": "saltpeter", <add> "sanitise": "sanitize", <add> "sanitised": "sanitized", <add> "sanitises": "sanitizes", <add> "sanitising": "sanitizing", <add> "satirise": "satirize", <add> "satirised": "satirized", <add> "satirises": "satirizes", <add> "satirising": "satirizing", <add> "saviour": "savior", <add> "saviours": "saviors", <add> "savour": "savor", <add> "savoured": "savored", <add> "savouries": "savories", <add> "savouring": "savoring", <add> "savours": "savors", <add> "savoury": "savory", <add> "scandalise": "scandalize", <add> "scandalised": "scandalized", <add> "scandalises": "scandalizes", <add> "scandalising": "scandalizing", <add> "sceptic": "skeptic", <add> "sceptical": "skeptical", <add> "sceptically": "skeptically", <add> "scepticism": "skepticism", <add> "sceptics": "skeptics", <add> "sceptre": "scepter", <add> "sceptres": "scepters", <add> "scrutinise": "scrutinize", <add> "scrutinised": "scrutinized", <add> "scrutinises": "scrutinizes", <add> "scrutinising": "scrutinizing", <add> "secularisation": "secularization", <add> "secularise": "secularize", <add> "secularised": "secularized", <add> "secularises": "secularizes", <add> "secularising": "secularizing", <add> "sensationalise": "sensationalize", <add> "sensationalised": "sensationalized", <add> "sensationalises": "sensationalizes", <add> "sensationalising": "sensationalizing", <add> "sensitise": "sensitize", <add> "sensitised": "sensitized", <add> "sensitises": "sensitizes", <add> "sensitising": "sensitizing", <add> "sentimentalise": "sentimentalize", <add> "sentimentalised": "sentimentalized", <add> "sentimentalises": "sentimentalizes", <add> "sentimentalising": "sentimentalizing", <add> "sepulchre": "sepulcher", <add> "sepulchres": "sepulchers ", <add> "serialisation": "serialization", <add> "serialisations": "serializations", <add> "serialise": "serialize", <add> "serialised": "serialized", <add> "serialises": "serializes", <add> "serialising": "serializing", <add> "sermonise": "sermonize", <add> "sermonised": "sermonized", <add> "sermonises": "sermonizes", <add> "sermonising": "sermonizing", <add> "sheikh ": "sheik ", <add> "shovelled": "shoveled", <add> "shovelling": "shoveling", <add> "shrivelled": "shriveled", <add> "shrivelling": "shriveling", <add> "signalise": "signalize", <add> "signalised": "signalized", <add> "signalises": "signalizes", <add> "signalising": "signalizing", <add> "signalled": "signaled", <add> "signalling": "signaling", <add> "smoulder": "smolder", <add> "smouldered": "smoldered", <add> "smouldering": "smoldering", <add> "smoulders": "smolders", <add> "snivelled": "sniveled", <add> "snivelling": "sniveling", <add> "snorkelled": "snorkeled", <add> "snorkelling": "snorkeling", <add> "snowplough": "snowplow", <add> "snowploughs": "snowplow", <add> "socialisation": "socialization", <add> "socialise": "socialize", <add> "socialised": "socialized", <add> "socialises": "socializes", <add> "socialising": "socializing", <add> "sodomise": "sodomize", <add> "sodomised": "sodomized", <add> "sodomises": "sodomizes", <add> "sodomising": "sodomizing", <add> "solemnise": "solemnize", <add> "solemnised": "solemnized", <add> "solemnises": "solemnizes", <add> "solemnising": "solemnizing", <add> "sombre": "somber", <add> "specialisation": "specialization", <add> "specialisations": "specializations", <add> "specialise": "specialize", <add> "specialised": "specialized", <add> "specialises": "specializes", <add> "specialising": "specializing", <add> "spectre": "specter", <add> "spectres": "specters", <add> "spiralled": "spiraled", <add> "spiralling": "spiraling", <add> "splendour": "splendor", <add> "splendours": "splendors", <add> "squirrelled": "squirreled", <add> "squirrelling": "squirreling", <add> "stabilisation": "stabilization", <add> "stabilise": "stabilize", <add> "stabilised": "stabilized", <add> "stabiliser": "stabilizer", <add> "stabilisers": "stabilizers", <add> "stabilises": "stabilizes", <add> "stabilising": "stabilizing", <add> "standardisation": "standardization", <add> "standardise": "standardize", <add> "standardised": "standardized", <add> "standardises": "standardizes", <add> "standardising": "standardizing", <add> "stencilled": "stenciled", <add> "stencilling": "stenciling", <add> "sterilisation": "sterilization", <add> "sterilisations": "sterilizations", <add> "sterilise": "sterilize", <add> "sterilised": "sterilized", <add> "steriliser": "sterilizer", <add> "sterilisers": "sterilizers", <add> "sterilises": "sterilizes", <add> "sterilising": "sterilizing", <add> "stigmatisation": "stigmatization", <add> "stigmatise": "stigmatize", <add> "stigmatised": "stigmatized", <add> "stigmatises": "stigmatizes", <add> "stigmatising": "stigmatizing", <add> "storey": "story", <add> "storeys": "stories", <add> "subsidisation": "subsidization", <add> "subsidise": "subsidize", <add> "subsidised": "subsidized", <add> "subsidiser": "subsidizer", <add> "subsidisers": "subsidizers", <add> "subsidises": "subsidizes", <add> "subsidising": "subsidizing", <add> "succour": "succor", <add> "succoured": "succored", <add> "succouring": "succoring", <add> "succours": "succors", <add> "sulphate": "sulfate", <add> "sulphates": "sulfates", <add> "sulphide": "sulfide", <add> "sulphides": "sulfides", <add> "sulphur": "sulfur", <add> "sulphurous": "sulfurous", <add> "summarise": "summarize", <add> "summarised": "summarized", <add> "summarises": "summarizes", <add> "summarising": "summarizing", <add> "swivelled": "swiveled", <add> "swivelling": "swiveling", <add> "symbolise": "symbolize", <add> "symbolised": "symbolized", <add> "symbolises": "symbolizes", <add> "symbolising": "symbolizing", <add> "sympathise": "sympathize", <add> "sympathised": "sympathized", <add> "sympathiser": "sympathizer", <add> "sympathisers": "sympathizers", <add> "sympathises": "sympathizes", <add> "sympathising": "sympathizing", <add> "synchronisation": "synchronization", <add> "synchronise": "synchronize", <add> "synchronised": "synchronized", <add> "synchronises": "synchronizes", <add> "synchronising": "synchronizing", <add> "synthesise": "synthesize", <add> "synthesised": "synthesized", <add> "synthesiser": "synthesizer", <add> "synthesisers": "synthesizers", <add> "synthesises": "synthesizes", <add> "synthesising": "synthesizing", <add> "syphon": "siphon", <add> "syphoned": "siphoned", <add> "syphoning": "siphoning", <add> "syphons": "siphons", <add> "systematisation": "systematization", <add> "systematise": "systematize", <add> "systematised": "systematized", <add> "systematises": "systematizes", <add> "systematising": "systematizing", <add> "tantalise": "tantalize", <add> "tantalised": "tantalized", <add> "tantalises": "tantalizes", <add> "tantalising": "tantalizing", <add> "tantalisingly": "tantalizingly", <add> "tasselled": "tasseled", <add> "technicolour": "technicolor", <add> "temporise": "temporize", <add> "temporised": "temporized", <add> "temporises": "temporizes", <add> "temporising": "temporizing", <add> "tenderise": "tenderize", <add> "tenderised": "tenderized", <add> "tenderises": "tenderizes", <add> "tenderising": "tenderizing", <add> "terrorise": "terrorize", <add> "terrorised": "terrorized", <add> "terrorises": "terrorizes", <add> "terrorising": "terrorizing", <add> "theatre": "theater", <add> "theatregoer": "theatergoer", <add> "theatregoers": "theatergoers", <add> "theatres": "theaters", <add> "theorise": "theorize", <add> "theorised": "theorized", <add> "theorises": "theorizes", <add> "theorising": "theorizing", <add> "tonne": "ton", <add> "tonnes": "tons", <add> "towelled": "toweled", <add> "towelling": "toweling", <add> "toxaemia": "toxemia", <add> "tranquillise": "tranquilize", <add> "tranquillised": "tranquilized", <add> "tranquilliser": "tranquilizer", <add> "tranquillisers": "tranquilizers", <add> "tranquillises": "tranquilizes", <add> "tranquillising": "tranquilizing", <add> "tranquillity": "tranquility", <add> "tranquillize": "tranquilize", <add> "tranquillized": "tranquilized", <add> "tranquillizer": "tranquilizer", <add> "tranquillizers": "tranquilizers", <add> "tranquillizes": "tranquilizes", <add> "tranquillizing": "tranquilizing", <add> "tranquilly": "tranquility", <add> "transistorised": "transistorized", <add> "traumatise": "traumatize", <add> "traumatised": "traumatized", <add> "traumatises": "traumatizes", <add> "traumatising": "traumatizing", <add> "travelled": "traveled", <add> "traveller": "traveler", <add> "travellers": "travelers", <add> "travelling": "traveling", <add> "travelogue": "travelog", <add> "travelogues ": "travelogs ", <add> "trialled": "trialed", <add> "trialling": "trialing", <add> "tricolour": "tricolor", <add> "tricolours": "tricolors", <add> "trivialise": "trivialize", <add> "trivialised": "trivialized", <add> "trivialises": "trivializes", <add> "trivialising": "trivializing", <add> "tumour": "tumor", <add> "tumours": "tumors", <add> "tunnelled": "tunneled", <add> "tunnelling": "tunneling", <add> "tyrannise": "tyrannize", <add> "tyrannised": "tyrannized", <add> "tyrannises": "tyrannizes", <add> "tyrannising": "tyrannizing", <add> "tyre": "tire", <add> "tyres": "tires", <add> "unauthorised": "unauthorized", <add> "uncivilised": "uncivilized", <add> "underutilised": "underutilized", <add> "unequalled": "unequaled", <add> "unfavourable": "unfavorable", <add> "unfavourably": "unfavorably", <add> "unionisation": "unionization", <add> "unionise": "unionize", <add> "unionised": "unionized", <add> "unionises": "unionizes", <add> "unionising": "unionizing", <add> "unorganised": "unorganized", <add> "unravelled": "unraveled", <add> "unravelling": "unraveling", <add> "unrecognisable": "unrecognizable", <add> "unrecognised": "unrecognized", <add> "unrivalled": "unrivaled", <add> "unsavoury": "unsavory", <add> "untrammelled": "untrammeled", <add> "urbanisation": "urbanization", <add> "urbanise": "urbanize", <add> "urbanised": "urbanized", <add> "urbanises": "urbanizes", <add> "urbanising": "urbanizing", <add> "utilisable": "utilizable", <add> "utilisation": "utilization", <add> "utilise": "utilize", <add> "utilised": "utilized", <add> "utilises": "utilizes", <add> "utilising": "utilizing", <add> "valour": "valor", <add> "vandalise": "vandalize", <add> "vandalised": "vandalized", <add> "vandalises": "vandalizes", <add> "vandalising": "vandalizing", <add> "vaporisation": "vaporization", <add> "vaporise": "vaporize", <add> "vaporised": "vaporized", <add> "vaporises": "vaporizes", <add> "vaporising": "vaporizing", <add> "vapour": "vapor", <add> "vapours": "vapors", <add> "verbalise": "verbalize", <add> "verbalised": "verbalized", <add> "verbalises": "verbalizes", <add> "verbalising": "verbalizing", <add> "victimisation": "victimization", <add> "victimise": "victimize", <add> "victimised": "victimized", <add> "victimises": "victimizes", <add> "victimising": "victimizing", <add> "videodisc": "videodisk", <add> "videodiscs": "videodisks", <add> "vigour": "vigor", <add> "visualisation": "visualization", <add> "visualisations": "visualizations", <add> "visualise": "visualize", <add> "visualised": "visualized", <add> "visualises": "visualizes", <add> "visualising": "visualizing", <add> "vocalisation": "vocalization", <add> "vocalisations": "vocalizations", <add> "vocalise": "vocalize", <add> "vocalised": "vocalized", <add> "vocalises": "vocalizes", <add> "vocalising": "vocalizing", <add> "vulcanised": "vulcanized", <add> "vulgarisation": "vulgarization", <add> "vulgarise": "vulgarize", <add> "vulgarised": "vulgarized", <add> "vulgarises": "vulgarizes", <add> "vulgarising": "vulgarizing", <add> "waggon": "wagon", <add> "waggons": "wagons", <add> "watercolour": "watercolor", <add> "watercolours": "watercolors", <add> "weaselled": "weaseled", <add> "weaselling": "weaseling", <add> "westernisation": "westernization", <add> "westernise": "westernize", <add> "westernised": "westernized", <add> "westernises": "westernizes", <add> "westernising": "westernizing", <add> "womanise": "womanize", <add> "womanised": "womanized", <add> "womaniser": "womanizer", <add> "womanisers": "womanizers", <add> "womanises": "womanizes", <add> "womanising": "womanizing", <add> "woollen": "woolen", <add> "woollens": "woolens", <add> "woollies": "woolies", <add> "woolly": "wooly", <add> "worshipped ": "worshiped", <add> "worshipping ": "worshiping ", <add> "worshipper": "worshiper", <add> "yodelled": "yodeled", <add> "yodelling": "yodeling", <add> "yoghourt": "yogurt", <add> "yoghourts": "yogurts", <add> "yoghurt": "yogurt", <add> "yoghurts": "yogurts" <add>} <add> <add> <add>for string, norm in _exc.items(): <add> _exc[string.title()] = norm <add> <add> <add>NORM_EXCEPTIONS = _exc
2
Javascript
Javascript
remove an unused chalk dependency
bfb6897c558dfdccff7ac5fc377b08e806525be3
<ide><path>build/release.js <ide> module.exports.dependencies = [ <ide> "[email protected]", <ide> "[email protected]", <ide> "[email protected]", <del> "[email protected]", <del> "[email protected]" <add> "[email protected]" <ide> ];
1
Python
Python
remove comment about extension backwards compat
38eb5d3b49d628785a470e2e773fc5ac82e3c8e4
<ide><path>src/flask/app.py <ide> def __init__( <ide> <ide> #: a place where extensions can store application specific state. For <ide> #: example this is where an extension could store database engines and <del> #: similar things. For backwards compatibility extensions should register <del> #: themselves like this:: <del> #: <del> #: if not hasattr(app, 'extensions'): <del> #: app.extensions = {} <del> #: app.extensions['extensionname'] = SomeObject() <add> #: similar things. <ide> #: <ide> #: The key must match the name of the extension module. For example in <ide> #: case of a "Flask-Foo" extension in `flask_foo`, the key would be
1
PHP
PHP
fix more tests using deprecated request features
dbff1b73274c86849ea7b35e107a6a2f42297234
<ide><path>tests/TestCase/View/Form/ArrayContextTest.php <ide> public function testIsCreate() <ide> */ <ide> public function testValPresent() <ide> { <del> $this->request->data = [ <add> $this->request = $this->request->withParsedBody([ <ide> 'Articles' => [ <ide> 'title' => 'New title', <ide> 'body' => 'My copy', <ide> ] <del> ]; <add> ]); <ide> $context = new ArrayContext($this->request, [ <ide> 'defaults' => [ <ide> 'Articles' => [ <ide><path>tests/TestCase/View/Form/EntityContextTest.php <ide> public function testValGetArrayValue() <ide> */ <ide> public function testValReadsRequest() <ide> { <del> $this->request->data = [ <add> $this->request = $this->request->withParsedBody([ <ide> 'title' => 'New title', <ide> 'notInEntity' => 'yes', <del> ]; <add> ]); <ide> $row = new Article([ <ide> 'title' => 'Test entity', <ide> 'body' => 'Something new' <ide><path>tests/TestCase/View/Form/FormContextTest.php <ide> public function testIsCreate() <ide> */ <ide> public function testValPresent() <ide> { <del> $this->request->data = [ <add> $this->request = $this->request->withParsedBody([ <ide> 'Articles' => [ <ide> 'title' => 'New title', <ide> 'body' => 'My copy', <ide> ] <del> ]; <add> ]); <ide> $context = new FormContext($this->request, ['entity' => new Form()]); <ide> $this->assertEquals('New title', $context->val('Articles.title')); <ide> $this->assertEquals('My copy', $context->val('Articles.body')); <ide><path>tests/TestCase/View/Helper/PaginatorHelperTest.php <ide> public function testTemplates() <ide> public function testHasPrevious() <ide> { <ide> $this->assertFalse($this->Paginator->hasPrev()); <del> $this->Paginator->request->params['paging']['Article']['prevPage'] = true; <add> $this->Paginator->request = $this->Paginator->withParam('paging.Article.prevPage', true); <ide> $this->assertTrue($this->Paginator->hasPrev()); <del> $this->Paginator->request->params['paging']['Article']['prevPage'] = false; <ide> } <ide> <ide> /** <ide> public function testHasPrevious() <ide> public function testHasNext() <ide> { <ide> $this->assertTrue($this->Paginator->hasNext()); <del> $this->Paginator->request->params['paging']['Article']['nextPage'] = false; <add> $this->Paginator->request = $this->Paginator->withParam('paging.Article.nextPage', false); <ide> $this->assertFalse($this->Paginator->hasNext()); <del> $this->Paginator->request->params['paging']['Article']['nextPage'] = true; <ide> } <ide> <ide> /** <ide> public function testSortLinks() <ide> Router::setRequestInfo($request); <ide> <ide> $this->Paginator->options(['url' => ['param']]); <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->request->withParam('paging', [ <ide> 'Article' => [ <ide> 'current' => 9, <ide> 'count' => 62, <ide> public function testSortLinks() <ide> 'direction' => 'asc', <ide> 'page' => 1, <ide> ] <del> ]; <add> ]); <ide> <ide> $result = $this->Paginator->sort('title'); <ide> $expected = [ <ide> public function testLastNonDefaultModel() <ide> */ <ide> public function testCounter() <ide> { <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->request->withParam('paging', [ <ide> 'Client' => [ <ide> 'page' => 1, <ide> 'current' => 3, <ide> public function testCounter() <ide> 'sort' => 'Client.name', <ide> 'order' => 'DESC', <ide> ] <del> ]; <add> ]); <ide> $input = 'Page {{page}} of {{pages}}, showing {{current}} records out of {{count}} total, '; <ide> $input .= 'starting on record {{start}}, ending on {{end}}'; <ide> <ide> public function testCounter() <ide> */ <ide> public function testCounterBigNumbers() <ide> { <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->withParam('paging', [ <ide> 'Client' => [ <ide> 'page' => 1523, <ide> 'current' => 1230, <ide> public function testCounterBigNumbers() <ide> 'sort' => 'Client.name', <ide> 'order' => 'DESC', <ide> ] <del> ]; <add> ]); <ide> <ide> $input = 'Page {{page}} of {{pages}}, showing {{current}} records out of {{count}} total, '; <ide> $input .= 'starting on record {{start}}, ending on {{end}}'; <ide> public function testNextLinkUsingDotNotation() <ide> ]); <ide> Router::setRequestInfo($request); <ide> <del> $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; <del> $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; <del> $this->Paginator->request->params['paging']['Article']['page'] = 1; <add> $this->Paginator->request = $this->Paginator->request <add> ->withParam('paging.Article.sort', 'Article.title') <add> ->withParam('paging.Article.direction', 'asc') <add> ->withParam('paging.Article.page', 1); <ide> <ide> $test = ['url' => [ <ide> 'page' => '1', <ide> public function testNextLinkUsingDotNotation() <ide> public function testCurrent() <ide> { <ide> $result = $this->Paginator->current(); <del> $this->assertEquals($this->Paginator->request->params['paging']['Article']['page'], $result); <add> $this->assertEquals($this->Paginator->request->getParam('paging.Article.page'), $result); <ide> <ide> $result = $this->Paginator->current('Incorrect'); <ide> $this->assertEquals(1, $result); <ide> public function testCurrent() <ide> public function testTotal() <ide> { <ide> $result = $this->Paginator->total(); <del> $this->assertSame($this->Paginator->request->params['paging']['Article']['pageCount'], $result); <add> $this->assertSame($this->Paginator->request->getParam('paging.Article.pageCount'), $result); <ide> <ide> $result = $this->Paginator->total('Incorrect'); <ide> $this->assertSame(0, $result); <ide> public function testNoDefaultModel() <ide> */ <ide> public function testWithOnePage() <ide> { <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->request->withParam('paging', [ <ide> 'Article' => [ <ide> 'page' => 1, <ide> 'current' => 2, <ide> public function testWithOnePage() <ide> 'nextPage' => true, <ide> 'pageCount' => 1, <ide> ] <del> ]; <add> ]); <ide> $this->assertFalse($this->Paginator->numbers()); <ide> $this->assertFalse($this->Paginator->first()); <ide> $this->assertFalse($this->Paginator->last()); <ide> public function testWithOnePage() <ide> */ <ide> public function testWithZeroPages() <ide> { <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->request->withParam('paging', [ <ide> 'Article' => [ <ide> 'page' => 0, <ide> 'current' => 0, <ide> public function testWithZeroPages() <ide> 'pageCount' => 0, <ide> 'limit' => 10, <ide> ] <del> ]; <add> ]); <ide> <ide> $result = $this->Paginator->counter(['format' => 'pages']); <ide> $expected = '0 of 1'; <ide> public function dataMetaProvider() <ide> */ <ide> public function testMeta($page, $prevPage, $nextPage, $pageCount, $options, $expected) <ide> { <del> $this->Paginator->request->params['paging'] = [ <add> $this->Paginator->request = $this->Paginator->request->withParam('paging', [ <ide> 'Article' => [ <ide> 'page' => $page, <ide> 'prevPage' => $prevPage, <ide> 'nextPage' => $nextPage, <ide> 'pageCount' => $pageCount, <ide> ] <del> ]; <add> ]); <ide> <ide> $result = $this->Paginator->meta($options); <ide> $this->assertSame($expected, $result);
4
Ruby
Ruby
allow gcc-4.2 in homebrew_cc
9647954a603dcb39cc8bb3f5fd0028670c2db0de
<ide><path>Library/Homebrew/superenv.rb <ide> def determine_cc <ide> when 'clang', 'gcc-4.0' then ENV['HOMEBREW_CC'] <ide> # depending on Xcode version plain 'gcc' could actually be <ide> # gcc-4.0 or llvm-gcc <del> when 'gcc' then 'gcc-4.2' <add> when 'gcc', 'gcc-4.2' then 'gcc-4.2' <ide> when 'llvm', 'llvm-gcc' then 'llvm-gcc' <ide> else <ide> opoo "Invalid value for HOMEBREW_CC: #{ENV['HOMEBREW_CC']}"
1
Javascript
Javascript
use object without protoype for map
c9c387fdac7d8deee6ee1a60026c01fa98d4d1b1
<ide><path>lib/dns.js <ide> function resolver(bindingName) { <ide> } <ide> <ide> <del>var resolveMap = {}; <add>var resolveMap = Object.create(null); <ide> exports.resolve4 = resolveMap.A = resolver('queryA'); <ide> exports.resolve6 = resolveMap.AAAA = resolver('queryAaaa'); <ide> exports.resolveCname = resolveMap.CNAME = resolver('queryCname'); <ide><path>test/parallel/test-c-ares.js <ide> assert.throws(function() { <ide> dns.resolve('www.google.com', 'HI'); <ide> }, /Unknown type/); <ide> <add>// Try calling resolve with an unsupported type that's an object key <add>assert.throws(function() { <add> dns.resolve('www.google.com', 'toString'); <add>}, /Unknown type/); <add> <ide> // Windows doesn't usually have an entry for localhost 127.0.0.1 in <ide> // C:\Windows\System32\drivers\etc\hosts <ide> // so we disable this test on Windows.
2
PHP
PHP
expand coverage for floattype
ec311cf9f6dfb48a3888c7233d0b55fc20797245
<ide><path>tests/TestCase/Database/Type/FloatTypeTest.php <ide> public function testToPHP() <ide> */ <ide> public function testToDatabase() <ide> { <add> $result = $this->type->toDatabase('', $this->driver); <add> $this->assertNull($result); <add> <add> $result = $this->type->toDatabase(null, $this->driver); <add> $this->assertNull($result); <add> <ide> $result = $this->type->toDatabase('some data', $this->driver); <ide> $this->assertSame(0.0, $result); <ide> <ide> public function testMarshalWithLocaleParsing() <ide> $this->assertEquals($expected, $result); <ide> } <ide> <add> /** <add> * Test that exceptions are raised on invalid parsers. <add> * <add> * @expectedException RuntimeException <add> * @return void <add> */ <add> public function testUseLocaleParsingInvalid() <add> { <add> $this->type->useLocaleParser('stdClass'); <add> } <add> <ide> /** <ide> * Test that the PDO binding type is correct. <ide> *
1
Text
Text
update translation to 6a7a4fd
2d847a145c65602dedc0463c447c54b377152df2
<ide><path>docs/docs/08-working-with-the-browser.ko-KR.md <ide> _마운트된_ 합성 컴포넌트들은 다음과 같은 메소드를 지원합 <ide> <ide> 페이스북에서 우리는 IE8을 포함한 구식 브라우저를 지원합니다. 미래지향적인 JS를 작성할 수 있도록 우리는 polyfill을 오랫동안 써왔습니다. 이는 우리의 코드베이스에 구식 브라우저를 위한 코드뭉치를 흩뿌려 놓을 필요가 없으며 그럼에도 우리의 코드가 "잘 작동"할 것이라 예상할 수 있음을 의미합니다. 예를 들어, `+new Date()` 대신에 그냥 `Date.now()`를 사용할 수 있습니다. 오픈소스 React는 우리가 내부에서 사용하는것과 동일하기 때문에, 우리는 이를 통해 미래지향적인 JS를 사용하는 철학을 전달했습니다. <ide> <del>그 철학에 더하여, 우리는 또한 JS 라이브러리의 저자로서 polyfill을 라이브러리에 포함해서 배포하지 않습니다. 만약 모든 라이브러리가 이런 짓을 하면, 같은 polyfill을 여러 번 내리게 되어 쓸모없이 크기만 차지하는 죽은 코드들을 만들 것 입니다. 당신의 제품이 구식 브라우저를 지원해야한다면, [es5-shim](https://github.com/kriskowal/es5-shim) 같은 녀석을 사용할 기회가 있었을 겁니다. <add>그 철학에 더하여, 우리는 또한 JS 라이브러리의 저자로서 polyfill을 라이브러리에 포함해서 배포하지 않습니다. 만약 모든 라이브러리가 이런 짓을 하면, 같은 polyfill을 여러 번 내리게 되어 쓸모없이 크기만 차지하는 죽은 코드들을 만들 것 입니다. 당신의 제품이 구식 브라우저를 지원해야한다면, [es5-shim](https://github.com/es-shims/es5-shim) 같은 녀석을 사용할 기회가 있었을 겁니다. <ide> <ide> <ide> ### Polyfill은 구식 브라우저를 지원하기 위해 필요하다 <ide> <del>[kriskowal's es5-shim](https://github.com/kriskowal/es5-shim)의 `es5-shim.js`는 React에 필요한 다음의 기능을 제공합니다: <add>[kriskowal's es5-shim](https://github.com/es-shims/es5-shim)의 `es5-shim.js`는 React에 필요한 다음의 기능을 제공합니다: <ide> <ide> * `Array.isArray` <ide> * `Array.prototype.every` <ide><path>docs/docs/10.4-test-utils.ko-KR.md <ide> ReactComponent shallowRenderer.getRenderOutput() <ide> result = renderer.getRenderOutput(); <ide> expect(result.type).toBe('div'); <ide> expect(result.props.children).toEqual([ <del> <span className="heading">Title</span> <add> <span className="heading">Title</span>, <ide> <Subcomponent foo="bar" /> <ide> ]); <ide> ``` <ide><path>docs/docs/11-advanced-performance.ko-KR.md <ide> React가 C6에만 DOM 변경을 수행한 것을 확인하세요. 이는 필연 <ide> <ide> ```javascript <ide> React.createClass({ <del> propsTypes: { <add> propTypes: { <ide> value: React.PropTypes.string.isRequired <ide> }, <ide> <ide> shouldComponentUpdate: function(nextProps, nextState) { <ide> <ide> ```javascript <ide> React.createClass({ <del> propsTypes: { <add> propTypes: { <ide> value: React.PropTypes.object.isRequired <ide> }, <ide> <ide><path>docs/docs/tutorial.ko-KR.md <ide> var CommentList = React.createClass({ <ide> <ide> Markdown은 텍스트를 포맷팅하는 간단한 방식입니다. 예를 들어, 별표(`*`)로 텍스트를 둘러싸는 것은 강조의 의미입니다. <ide> <del>먼저 서드파티 라이브러리인 **Showdown**을 애플리케이션에 추가합니다. 이 JavaScript 라이브러리는 Markdown 텍스트를 HTML 문법으로 변환해줍니다. head 태그안에 스크립트 태그를 추가해 주세요. (React playground에는 이미 포함되어 있습니다): <add>먼저 서드파티 라이브러리인 **marked**를 애플리케이션에 추가합니다. 이 JavaScript 라이브러리는 Markdown 텍스트를 HTML 문법으로 변환해줍니다. head 태그안에 스크립트 태그를 추가해 주세요. (React playground에는 이미 포함되어 있습니다): <ide> <ide> ```html{7} <ide> <!-- index.html --> <ide> Markdown은 텍스트를 포맷팅하는 간단한 방식입니다. 예를 들 <ide> <script src="http://fb.me/react-{{site.react_version}}.js"></script> <ide> <script src="http://fb.me/JSXTransformer-{{site.react_version}}.js"></script> <ide> <script src="http://code.jquery.com/jquery-1.10.0.min.js"></script> <del> <script src="http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script> <add> <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script> <ide> </head> <ide> ``` <ide> <ide> 다음은, 댓글 텍스트를 Markdown으로 전환하고 출력해 봅시다. <ide> <del>```javascript{2,10} <add>```javascript{9} <ide> // tutorial6.js <del>var converter = new Showdown.converter(); <ide> var Comment = React.createClass({ <ide> render: function() { <ide> return ( <ide> <div className="comment"> <ide> <h2 className="commentAuthor"> <ide> {this.props.author} <ide> </h2> <del> {converter.makeHtml(this.props.children.toString())} <add> {marked(this.props.children.toString())} <ide> </div> <ide> ); <ide> } <ide> }); <ide> ``` <ide> <del>우리가 한 일이라고는 Showdown 라이브러리를 호출한 것 뿐입니다. Showdown이 `this.props.children`에서 텍스트를 읽어들여 처리할 수 있도록 React 형식의 텍스트(React's wrapped text)를 단순 텍스트(raw string)으로 전환하기 위해 명시적으로 `toString()`을 호출했습니다. <add>우리가 한 일이라고는 marked 라이브러리를 호출한 것 뿐입니다. marked가 `this.props.children`에서 텍스트를 읽어들여 처리할 수 있도록 React 형식의 텍스트(React's wrapped text)를 단순 텍스트(raw string)으로 전환하기 위해 명시적으로 `toString()`을 호출했습니다. <ide> <ide> 하지만 여기엔 문제가 있습니다! 우리는 HTML 태그들이 정상적으로 렌더되길 원하지만 브라우저에 출력된 결과물은 "`<p>``<em>`또 다른`</em>` 댓글입니다`</p>`"처럼 태그가 그대로 보일것입니다. <ide> <ide> React는 이런 식으로 XSS 공격을 예방합니다. 우회할 방법이 있긴 하지만 프레임워크는 사용하지 않도록 경고하고 있습니다: <ide> <del>```javascript{5,11} <add>```javascript{4,10} <ide> // tutorial7.js <del>var converter = new Showdown.converter(); <ide> var Comment = React.createClass({ <ide> render: function() { <del> var rawMarkup = converter.makeHtml(this.props.children.toString()); <add> var rawMarkup = marked(this.props.children.toString(), {sanitize: true}); <ide> return ( <ide> <div className="comment"> <ide> <h2 className="commentAuthor"> <ide> var Comment = React.createClass({ <ide> }); <ide> ``` <ide> <del>이는 의도적으로 생(raw) HTML을 넣기 힘들게 하려고 만든 특별한 API지만 Showdown을 사용하기 위해 이 백도어를 활용합시다. <add>이는 의도적으로 생(raw) HTML을 넣기 힘들게 하려고 만든 특별한 API지만 marked를 사용하기 위해 이 백도어를 활용합시다. <ide> <del>**잊지 마세요:** 이 기능은 Showdown이 안전한 것으로 믿고 사용하는 것입니다. <add>**잊지 마세요:** 이 기능은 marked가 안전한 것으로 믿고 사용하는 것입니다. 이 경우, 소스에 있는 그대로 넘겨 주는 대신, 모든 HTML 마크업을 이스케이프하도록 marked에게 `sanitize: true`를 넘겨 주었습니다. <ide> <ide> ### 데이터 모델 연결하기 <ide>
4
Text
Text
add v3.17.0-beta.3 to changelog
30a6b17646d04174acb55c81e0090ec051cf7ab1
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### v3.17.0-beta.3 (February 3, 2020) <add> <add>- [#18703](https://github.com/emberjs/ember.js/pull/18703) [BUGFIX] Correctly links ArrayProxy tags to `arrangedContent` <add>- [#18707](https://github.com/emberjs/ember.js/pull/18707) [BUGFIX] Fixes tag chaining on Proxy mixins <add>- [#18708](https://github.com/emberjs/ember.js/pull/18708) [BUGFIX] Ensures the arg proxy works with `get` <add>- [#18717](https://github.com/emberjs/ember.js/pull/18717) [BUGFIX] Ensure instantiation cannot happen after destruction. <add>- [#18720](https://github.com/emberjs/ember.js/pull/18720) [BUGFIX] Update minimum @ember/edition-utils to 1.2.0. <add>- [#18714](https://github.com/emberjs/ember.js/pull/18714) Update glimmer packages to 0.47.4. <add> <ide> ### v3.17.0-beta.2 (January 29, 2020) <ide> <ide> - [#18691](https://github.com/emberjs/ember.js/pull/18691) [BUGFIX] Updated blueprints for component and helper tests to output the correct hbs import statement
1
Text
Text
change worker.takeheapsnapshot to getheapsnapshot
28fae8bff1949c5008b518fa24fbc5ff5c468267
<ide><path>doc/api/worker_threads.md <ide> added: v10.5.0 <ide> The `'online'` event is emitted when the worker thread has started executing <ide> JavaScript code. <ide> <add>### `worker.getHeapSnapshot()` <add><!-- YAML <add>added: v13.9.0 <add>--> <add> <add>* Returns: {Promise} A promise for a Readable Stream containing <add> a V8 heap snapshot <add> <add>Returns a readable stream for a V8 snapshot of the current state of the Worker. <add>See [`v8.getHeapSnapshot()`][] for more details. <add> <add>If the Worker thread is no longer running, which may occur before the <add>[`'exit'` event][] is emitted, the returned `Promise` will be rejected <add>immediately with an [`ERR_WORKER_NOT_RUNNING`][] error. <add> <ide> ### `worker.postMessage(value[, transferList])` <ide> <!-- YAML <ide> added: v10.5.0 <ide> inside the worker thread. If `stdout: true` was not passed to the <ide> [`Worker`][] constructor, then data will be piped to the parent thread's <ide> [`process.stdout`][] stream. <ide> <del>### `worker.takeHeapSnapshot()` <del><!-- YAML <del>added: v13.9.0 <del>--> <del> <del>* Returns: {Promise} A promise for a Readable Stream containing <del> a V8 heap snapshot <del> <del>Returns a readable stream for a V8 snapshot of the current state of the Worker. <del>See [`v8.getHeapSnapshot()`][] for more details. <del> <del>If the Worker thread is no longer running, which may occur before the <del>[`'exit'` event][] is emitted, the returned `Promise` will be rejected <del>immediately with an [`ERR_WORKER_NOT_RUNNING`][] error. <del> <ide> ### `worker.terminate()` <ide> <!-- YAML <ide> added: v10.5.0
1
Go
Go
use spf13/cobra for docker rmi
60e48bd6bd24c559ed92c7217cd7798c85cbb644
<ide><path>api/client/commands.go <ide> func (cli *DockerCli) Command(name string) func(...string) error { <ide> "rename": cli.CmdRename, <ide> "restart": cli.CmdRestart, <ide> "rm": cli.CmdRm, <del> "rmi": cli.CmdRmi, <ide> "save": cli.CmdSave, <ide> "start": cli.CmdStart, <ide> "stats": cli.CmdStats, <ide><path>api/client/image/remove.go <add>package image <add> <add>import ( <add> "fmt" <add> "strings" <add> <add> "golang.org/x/net/context" <add> <add> "github.com/docker/docker/api/client" <add> "github.com/docker/docker/cli" <add> "github.com/docker/engine-api/types" <add> "github.com/spf13/cobra" <add>) <add> <add>type removeOptions struct { <add> force bool <add> noPrune bool <add>} <add> <add>// NewRemoveCommand create a new `docker remove` command <add>func NewRemoveCommand(dockerCli *client.DockerCli) *cobra.Command { <add> var opts removeOptions <add> <add> cmd := &cobra.Command{ <add> Use: "rmi [OPTIONS] IMAGE [IMAGE...]", <add> Short: "Remove one or more images", <add> Args: cli.RequiresMinArgs(1), <add> RunE: func(cmd *cobra.Command, args []string) error { <add> return runRemove(dockerCli, opts, args) <add> }, <add> } <add> <add> flags := cmd.Flags() <add> <add> flags.BoolVarP(&opts.force, "force", "f", false, "Force removal of the image") <add> flags.BoolVar(&opts.noPrune, "no-prune", false, "Do not delete untagged parents") <add> <add> return cmd <add>} <add> <add>func runRemove(dockerCli *client.DockerCli, opts removeOptions, images []string) error { <add> client := dockerCli.Client() <add> ctx := context.Background() <add> <add> options := types.ImageRemoveOptions{ <add> Force: opts.force, <add> PruneChildren: !opts.noPrune, <add> } <add> <add> var errs []string <add> for _, image := range images { <add> dels, err := client.ImageRemove(ctx, image, options) <add> if err != nil { <add> errs = append(errs, err.Error()) <add> } else { <add> for _, del := range dels { <add> if del.Deleted != "" { <add> fmt.Fprintf(dockerCli.Out(), "Deleted: %s\n", del.Deleted) <add> } else { <add> fmt.Fprintf(dockerCli.Out(), "Untagged: %s\n", del.Untagged) <add> } <add> } <add> } <add> } <add> <add> if len(errs) > 0 { <add> return fmt.Errorf("%s", strings.Join(errs, "\n")) <add> } <add> return nil <add>} <ide><path>api/client/rmi.go <del>package client <del> <del>import ( <del> "fmt" <del> "net/url" <del> "strings" <del> <del> "golang.org/x/net/context" <del> <del> Cli "github.com/docker/docker/cli" <del> flag "github.com/docker/docker/pkg/mflag" <del> "github.com/docker/engine-api/types" <del>) <del> <del>// CmdRmi removes all images with the specified name(s). <del>// <del>// Usage: docker rmi [OPTIONS] IMAGE [IMAGE...] <del>func (cli *DockerCli) CmdRmi(args ...string) error { <del> cmd := Cli.Subcmd("rmi", []string{"IMAGE [IMAGE...]"}, Cli.DockerCommands["rmi"].Description, true) <del> force := cmd.Bool([]string{"f", "-force"}, false, "Force removal of the image") <del> noprune := cmd.Bool([]string{"-no-prune"}, false, "Do not delete untagged parents") <del> cmd.Require(flag.Min, 1) <del> <del> cmd.ParseFlags(args, true) <del> <del> v := url.Values{} <del> if *force { <del> v.Set("force", "1") <del> } <del> if *noprune { <del> v.Set("noprune", "1") <del> } <del> <del> ctx := context.Background() <del> <del> var errs []string <del> for _, image := range cmd.Args() { <del> options := types.ImageRemoveOptions{ <del> Force: *force, <del> PruneChildren: !*noprune, <del> } <del> <del> dels, err := cli.client.ImageRemove(ctx, image, options) <del> if err != nil { <del> errs = append(errs, err.Error()) <del> } else { <del> for _, del := range dels { <del> if del.Deleted != "" { <del> fmt.Fprintf(cli.out, "Deleted: %s\n", del.Deleted) <del> } else { <del> fmt.Fprintf(cli.out, "Untagged: %s\n", del.Untagged) <del> } <del> } <del> } <del> } <del> if len(errs) > 0 { <del> return fmt.Errorf("%s", strings.Join(errs, "\n")) <del> } <del> return nil <del>} <ide><path>cli/cobraadaptor/adaptor.go <ide> func NewCobraAdaptor(clientFlags *cliflags.ClientFlags) CobraAdaptor { <ide> container.NewExportCommand(dockerCli), <ide> container.NewRunCommand(dockerCli), <ide> container.NewStopCommand(dockerCli), <add> image.NewRemoveCommand(dockerCli), <ide> image.NewSearchCommand(dockerCli), <ide> volume.NewVolumeCommand(dockerCli), <ide> ) <ide><path>cli/usage.go <ide> var DockerCommandUsage = []Command{ <ide> {"rename", "Rename a container"}, <ide> {"restart", "Restart a container"}, <ide> {"rm", "Remove one or more containers"}, <del> {"rmi", "Remove one or more images"}, <ide> {"save", "Save one or more images to a tar archive"}, <ide> {"start", "Start one or more stopped containers"}, <ide> {"stats", "Display a live stream of container(s) resource usage statistics"}, <ide><path>integration-cli/docker_cli_rmi_test.go <ide> func (s *DockerSuite) TestRmiForceWithMultipleRepositories(c *check.C) { <ide> } <ide> <ide> func (s *DockerSuite) TestRmiBlank(c *check.C) { <del> // try to delete a blank image name <del> out, _, err := dockerCmdWithError("rmi", "") <del> // Should have failed to delete '' image <add> out, _, err := dockerCmdWithError("rmi", " ") <add> // Should have failed to delete ' ' image <ide> c.Assert(err, checker.NotNil) <ide> // Wrong error message generated <ide> c.Assert(out, checker.Not(checker.Contains), "no such id", check.Commentf("out: %s", out)) <ide> // Expected error message not generated <ide> c.Assert(out, checker.Contains, "image name cannot be blank", check.Commentf("out: %s", out)) <del> <del> out, _, err = dockerCmdWithError("rmi", " ") <del> // Should have failed to delete ' ' image <del> c.Assert(err, checker.NotNil) <del> // Expected error message not generated <del> c.Assert(out, checker.Contains, "image name cannot be blank", check.Commentf("out: %s", out)) <ide> } <ide> <ide> func (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {
6
PHP
PHP
add blowfishauthenticate adapter
d24bbcb2550aadadb6e7b2d333d559dc0bc84da5
<ide><path>lib/Cake/Controller/Component/Auth/BaseAuthenticate.php <ide> public function __construct(ComponentCollection $collection, $settings) { <ide> /** <ide> * Find a user record using the standard options. <ide> * <del> * @param string $username The username/identifier. <del> * @param string $password The unhashed password. <add> * The $conditions parameter can be a (string)username or an array containing conditions for Model::find('first'). If <add> * the password field is not included in the conditions the password will be returned. <add> * <add> * @param Mixed $conditions The username/identifier, or an array of find conditions. <add> * @param Mixed $password The password, only use if passing as $conditions = 'username'. <ide> * @return Mixed Either false on failure, or an array of user data. <ide> */ <del> protected function _findUser($username, $password) { <add> protected function _findUser($conditions, $password = null) { <ide> $userModel = $this->settings['userModel']; <ide> list($plugin, $model) = pluginSplit($userModel); <ide> $fields = $this->settings['fields']; <ide> <del> $conditions = array( <del> $model . '.' . $fields['username'] => $username, <del> $model . '.' . $fields['password'] => $this->_password($password), <del> ); <add> if (!is_array($conditions)) { <add> if (!$password) { <add> return false; <add> } <add> $username = $conditions; <add> $conditions = array( <add> $model . '.' . $fields['username'] => $username, <add> $model . '.' . $fields['password'] => $this->_password($password), <add> ); <add> } <ide> if (!empty($this->settings['scope'])) { <ide> $conditions = array_merge($conditions, $this->settings['scope']); <ide> } <ide> protected function _findUser($username, $password) { <ide> return false; <ide> } <ide> $user = $result[$model]; <del> unset($user[$fields['password']]); <add> if ( <add> isset($conditions[$model . '.' . $fields['password']]) || <add> isset($conditions[$fields['password']]) <add> ) { <add> unset($user[$fields['password']]); <add> } <ide> unset($result[$model]); <ide> return array_merge($user, $result); <ide> } <ide><path>lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php <add><?php <add>/** <add> * PHP 5 <add> * <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of the files must retain the above copyright notice. <add> * <add> * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) <add> */ <add> <add>App::uses('FormAuthenticate', 'Controller/Component/Auth'); <add> <add>/** <add> * An authentication adapter for AuthComponent. Provides the ability to authenticate using POST data using Blowfish <add> * hashing. Can be used by configuring AuthComponent to use it via the AuthComponent::$authenticate setting. <add> * <add> * {{{ <add> * $this->Auth->authenticate = array( <add> * 'Blowfish' => array( <add> * 'scope' => array('User.active' => 1) <add> * ) <add> * ) <add> * }}} <add> * <add> * When configuring BlowfishAuthenticate you can pass in settings to which fields, model and additional conditions <add> * are used. See BlowfishAuthenticate::$settings for more information. <add> * <add> * @package Cake.Controller.Component.Auth <add> * @since CakePHP(tm) v 2.3 <add> * @see AuthComponent::$authenticate <add> */ <add>class BlowfishAuthenticate extends FormAuthenticate { <add> <add>/** <add> * Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields` <add> * to find POST data that is used to find a matching record in the`settings.userModel`. Will return false if <add> * there is no post data, either username or password is missing, or if the scope conditions have not been met. <add> * <add> * @param CakeRequest $request The request that contains login information. <add> * @param CakeResponse $response Unused response object. <add> * @return mixed False on login failure. An array of User data on success. <add> */ <add> public function authenticate(CakeRequest $request, CakeResponse $response) { <add> $userModel = $this->settings['userModel']; <add> list($plugin, $model) = pluginSplit($userModel); <add> <add> $fields = $this->settings['fields']; <add> if (!$this->_checkFields($request, $model, $fields)) { <add> return false; <add> } <add> $user = $this->_findUser( <add> array( <add> $model . '.' . $fields['username'] => $request->data[$model][$fields['username']], <add> ) <add> ); <add> if (!$user) { <add> return false; <add> } <add> $password = Security::hash( <add> $request->data[$model][$fields['password']], <add> 'blowfish', <add> $user[$fields['password']] <add> ); <add> if ($password === $user[$fields['password']]) { <add> unset($user[$fields['password']]); <add> return $user; <add> } <add> return false; <add> } <add>} <ide><path>lib/Cake/Controller/Component/Auth/FormAuthenticate.php <ide> */ <ide> class FormAuthenticate extends BaseAuthenticate { <ide> <add>/** <add> * Checks the fields to ensure they are supplied. <add> * <add> * @param CakeRequest $request The request that contains login information. <add> * @param string $model The model used for login verification. <add> * @param array $fields The fields to be checked. <add> * @return boolean False if the fields have not been supplied. True if they exist. <add> */ <add> protected function _checkFields(CakeRequest $request, $model, $fields) { <add> if (empty($request->data[$model])) { <add> return false; <add> } <add> if ( <add> empty($request->data[$model][$fields['username']]) || <add> empty($request->data[$model][$fields['password']]) <add> ) { <add> return false; <add> } <add> return true; <add> } <add> <ide> /** <ide> * Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields` <ide> * to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if <ide> public function authenticate(CakeRequest $request, CakeResponse $response) { <ide> list($plugin, $model) = pluginSplit($userModel); <ide> <ide> $fields = $this->settings['fields']; <del> if (empty($request->data[$model])) { <del> return false; <del> } <del> if ( <del> empty($request->data[$model][$fields['username']]) || <del> empty($request->data[$model][$fields['password']]) <del> ) { <add> if (!$this->_checkFields($request, $model, $fields)) { <ide> return false; <ide> } <ide> return $this->_findUser( <ide><path>lib/Cake/Test/Case/Controller/Component/Auth/BlowfishAuthenticateTest.php <add><?php <add>/** <add> * BlowfishAuthenticateTest file <add> * <add> * PHP 5 <add> * <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under the MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @package Cake.Test.Case.Controller.Component.Auth <add> * @since CakePHP(tm) v 2.3 <add> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) <add> */ <add> <add>App::uses('AuthComponent', 'Controller/Component'); <add>App::uses('BlowfishAuthenticate', 'Controller/Component/Auth'); <add>App::uses('AppModel', 'Model'); <add>App::uses('CakeRequest', 'Network'); <add>App::uses('CakeResponse', 'Network'); <add>App::uses('Security', 'Utility'); <add> <add>require_once CAKE . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'models.php'; <add> <add>/** <add> * Test case for BlowfishAuthentication <add> * <add> * @package Cake.Test.Case.Controller.Component.Auth <add> */ <add>class BlowfishAuthenticateTest extends CakeTestCase { <add> <add> public $fixtures = array('core.user', 'core.auth_user'); <add> <add>/** <add> * setup <add> * <add> * @return void <add> */ <add> public function setUp() { <add> parent::setUp(); <add> $this->Collection = $this->getMock('ComponentCollection'); <add> $this->auth = new BlowfishAuthenticate($this->Collection, array( <add> 'fields' => array('username' => 'user', 'password' => 'password'), <add> 'userModel' => 'User' <add> )); <add> $password = Security::hash('password', 'blowfish'); <add> $User = ClassRegistry::init('User'); <add> $User->updateAll(array('password' => $User->getDataSource()->value($password))); <add> $this->response = $this->getMock('CakeResponse'); <add> } <add> <add>/** <add> * test applying settings in the constructor <add> * <add> * @return void <add> */ <add> public function testConstructor() { <add> $Object = new BlowfishAuthenticate($this->Collection, array( <add> 'userModel' => 'AuthUser', <add> 'fields' => array('username' => 'user', 'password' => 'password') <add> )); <add> $this->assertEquals('AuthUser', $Object->settings['userModel']); <add> $this->assertEquals(array('username' => 'user', 'password' => 'password'), $Object->settings['fields']); <add> } <add> <add>/** <add> * testAuthenticateNoData method <add> * <add> * @return void <add> */ <add> public function testAuthenticateNoData() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array(); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testAuthenticateNoUsername method <add> * <add> * @return void <add> */ <add> public function testAuthenticateNoUsername() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('User' => array('password' => 'foobar')); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testAuthenticateNoPassword method <add> * <add> * @return void <add> */ <add> public function testAuthenticateNoPassword() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('User' => array('user' => 'mariano')); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testAuthenticatePasswordIsFalse method <add> * <add> * @return void <add> */ <add> public function testAuthenticatePasswordIsFalse() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array( <add> 'User' => array( <add> 'user' => 'mariano', <add> 'password' => null <add> )); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testAuthenticateInjection method <add> * <add> * @return void <add> */ <add> public function testAuthenticateInjection() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('User' => array( <add> 'user' => '> 1', <add> 'password' => "' OR 1 = 1" <add> )); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testAuthenticateSuccess method <add> * <add> * @return void <add> */ <add> public function testAuthenticateSuccess() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('User' => array( <add> 'user' => 'mariano', <add> 'password' => 'password' <add> )); <add> $result = $this->auth->authenticate($request, $this->response); <add> $expected = array( <add> 'id' => 1, <add> 'user' => 'mariano', <add> 'created' => '2007-03-17 01:16:23', <add> 'updated' => '2007-03-17 01:18:31', <add> ); <add> $this->assertEquals($expected, $result); <add> } <add> <add>/** <add> * testAuthenticateScopeFail method <add> * <add> * @return void <add> */ <add> public function testAuthenticateScopeFail() { <add> $this->auth->settings['scope'] = array('user' => 'nate'); <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('User' => array( <add> 'user' => 'mariano', <add> 'password' => 'password' <add> )); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <add>/** <add> * testPluginModel method <add> * <add> * @return void <add> */ <add> public function testPluginModel() { <add> Cache::delete('object_map', '_cake_core_'); <add> App::build(array( <add> 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) <add> ), App::RESET); <add> CakePlugin::load('TestPlugin'); <add> <add> $PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser'); <add> $user['id'] = 1; <add> $user['username'] = 'gwoo'; <add> $user['password'] = Security::hash('password', 'blowfish'); <add> $PluginModel->save($user, false); <add> <add> $this->auth->settings['userModel'] = 'TestPlugin.TestPluginAuthUser'; <add> $this->auth->settings['fields']['username'] = 'username'; <add> <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array('TestPluginAuthUser' => array( <add> 'username' => 'gwoo', <add> 'password' => 'password' <add> )); <add> <add> $result = $this->auth->authenticate($request, $this->response); <add> $expected = array( <add> 'id' => 1, <add> 'username' => 'gwoo', <add> 'created' => '2007-03-17 01:16:23' <add> ); <add> $this->assertEquals(self::date(), $result['updated']); <add> unset($result['updated']); <add> $this->assertEquals($expected, $result); <add> CakePlugin::unload(); <add> } <add>} <ide><path>lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php <ide> public function testAuthenticateNoPassword() { <ide> $this->assertFalse($this->auth->authenticate($request, $this->response)); <ide> } <ide> <add>/** <add> * test authenticate password is false method <add> * <add> * @return void <add> */ <add> public function testAuthenticatePasswordIsFalse() { <add> $request = new CakeRequest('posts/index', false); <add> $request->data = array( <add> 'User' => array( <add> 'user' => 'mariano', <add> 'password' => null <add> )); <add> $this->assertFalse($this->auth->authenticate($request, $this->response)); <add> } <add> <ide> /** <ide> * test the authenticate method <ide> *
5
PHP
PHP
ensure both node() and aftersave() use ->name
e9011badb59ffbfba75d90dcce53935785c6c8aa
<ide><path>cake/libs/model/behaviors/acl.php <ide> function afterSave(&$model, $created) { <ide> } <ide> $data = array( <ide> 'parent_id' => isset($parent[0][$type]['id']) ? $parent[0][$type]['id'] : null, <del> 'model' => $model->alias, <add> 'model' => $model->name, <ide> 'foreign_key' => $model->id <ide> ); <ide> if (!$created) {
1
PHP
PHP
handle missingviewexceptions better
2ba117eeda6e0ad78916575911748add40a40d5d
<ide><path>lib/Cake/Error/ExceptionRenderer.php <ide> protected function _outputMessage($template) { <ide> $this->controller->afterFilter(); <ide> $this->controller->response->send(); <ide> } catch (MissingViewException $e) { <del> try { <del> $this->_outputMessage('error500'); <del> } catch (Exception $e) { <add> $attributes = $e->getAttributes(); <add> if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) { <ide> $this->_outputMessageSafe('error500'); <add> } else { <add> $this->_outputMessage('error500'); <ide> } <ide> } catch (Exception $e) { <ide> $this->_outputMessageSafe('error500');
1
Text
Text
move examples from the website to the wiki
8cd460ce244cbeb707e02382f90fe5c114a96d46
<ide><path>docs/docs/examples.md <ide> permalink: examples.html <ide> prev: complementary-tools.html <ide> --- <ide> <del>### Production Apps <del> <del>* **[Instagram.com](http://instagram.com/)** is 100% built on React, both public site and internal tools. <del>* **[Facebook.com](http://www.facebook.com/)**'s commenting interface, business management tools, [Lookback video editor](http://facebook.com/lookback/edit), page insights, and most, if not all, new JS development. <del>* **[Khan Academy](http://khanacademy.org/)** uses React for most new JS development. <del>* **[Sberbank](http://sberbank.ru/moscow/ru/person/)**, Russia's number one bank, is built with React. <del>* **[The New York Times's 2014 Red Carpet Project](http://www.nytimes.com/interactive/2014/02/02/fashion/red-carpet-project.html?_r=0)** is built with React. <del>* **[The Scribbler](http://scribbler.co)**, is 100% built on React, both on the server and client side. <del> <del>### Sample Code <del> <del>* **[React starter kit](/react/downloads.html)** Includes several examples which you can [view online in our GitHub repository](https://github.com/facebook/react/tree/master/examples/). <del>* **[React one-hour email](https://github.com/petehunt/react-one-hour-email/commits/master)** Goes step-by-step from a static HTML mock to an interactive email reader, written in just one hour! <del>* **[React server rendering example](https://github.com/mhart/react-server-example)** Demonstrates how to use React's server rendering capabilities. <del> <del>### Open-Source Demos <del> <del>* **[TodoMVC](https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/react/js)** <del>* **[Khan Academy question editor](https://github.com/khan/perseus)** (Browse their GitHub account for many more production apps!) <del>* **[github-issue-viewer](https://github.com/jaredly/github-issues-viewer)** <del>* **[hn-react](https://github.com/prabirshrestha/hn-react)** Dead-simple Hacker News client. <del>* **[2048-react](https://github.com/IvanVergiliev/2048-react)** A clone of the 2048 game. <add>This page has moved to the [GitHub wiki](https://github.com/facebook/react/wiki/Examples).
1
Python
Python
check status code in test client or fail silently
676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4
<ide><path>flask/testsuite/basic.py <ide> def index(): <ide> flask.flash(flask.Markup(u'<em>Testing</em>'), 'warning') <ide> return '' <ide> <del> @app.route('/test') <add> @app.route('/test/') <ide> def test(): <ide> messages = flask.get_flashed_messages() <ide> self.assert_equal(len(messages), 3) <ide> def test(): <ide> self.assert_equal(messages[2], flask.Markup(u'<em>Testing</em>')) <ide> return '' <ide> <del> @app.route('/test_with_categories') <add> @app.route('/test_with_categories/') <ide> def test_with_categories(): <ide> messages = flask.get_flashed_messages(with_categories=True) <ide> self.assert_equal(len(messages), 3) <ide> def test_with_categories(): <ide> self.assert_equal(messages[2], ('warning', flask.Markup(u'<em>Testing</em>'))) <ide> return '' <ide> <del> @app.route('/test_filter') <add> @app.route('/test_filter/') <ide> def test_filter(): <ide> messages = flask.get_flashed_messages(category_filter=['message'], with_categories=True) <ide> self.assert_equal(len(messages), 1) <ide> self.assert_equal(messages[0], ('message', u'Hello World')) <ide> return '' <ide> <del> @app.route('/test_filters') <add> @app.route('/test_filters/') <ide> def test_filters(): <ide> messages = flask.get_flashed_messages(category_filter=['message', 'warning'], with_categories=True) <ide> self.assert_equal(len(messages), 2) <ide> self.assert_equal(messages[0], ('message', u'Hello World')) <ide> self.assert_equal(messages[1], ('warning', flask.Markup(u'<em>Testing</em>'))) <ide> return '' <ide> <del> @app.route('/test_filters_without_returning_categories') <add> @app.route('/test_filters_without_returning_categories/') <ide> def test_filters(): <ide> messages = flask.get_flashed_messages(category_filter=['message', 'warning']) <ide> self.assert_equal(len(messages), 2) <ide> self.assert_equal(messages[0], u'Hello World') <ide> self.assert_equal(messages[1], flask.Markup(u'<em>Testing</em>')) <ide> return '' <ide> <add> # Note: if status code assertions are missing, failed tests still pass. <add> # <add> # Since app.test_client() does not set debug=True, the AssertionErrors <add> # in the view functions are swallowed and the only indicator is a 500 <add> # status code. <add> # <add> # Also, create new test client on each test to clean flashed messages. <add> <ide> c = app.test_client() <del> c.get('/') # Flash some messages. <del> c.get('/test') <add> c.get('/') <add> assert c.get('/test/').status_code == 200 <ide> <del> c.get('/') # Flash more messages. <del> c.get('/test_with_categories') <add> c = app.test_client() <add> c.get('/') <add> assert c.get('/test_with_categories/').status_code == 200 <ide> <del> c.get('/') # Flash more messages. <del> c.get('/test_filter') <add> c = app.test_client() <add> c.get('/') <add> assert c.get('/test_filter/').status_code == 200 <ide> <del> c.get('/') # Flash more messages. <del> c.get('/test_filters') <add> c = app.test_client() <add> c.get('/') <add> assert c.get('/test_filters/').status_code == 200 <ide> <del> c.get('/') # Flash more messages. <del> c.get('/test_filters_without_returning_categories') <add> c = app.test_client() <add> c.get('/') <add> assert c.get('/test_filters_without_returning_categories/').status_code == 200 <ide> <ide> def test_request_processing(self): <ide> app = flask.Flask(__name__)
1
Javascript
Javascript
minify ncc'd packages for download speed
bc9f2b6139b26d45203a4cd71b7b6a56588a37fd
<ide><path>packages/next/taskfile-ncc.js <ide> module.exports = function (task) { <ide> return ncc(join(__dirname, file.dir, file.base), { <ide> // cannot bundle <ide> externals: ['chokidar'], <add> minify: true, <ide> ...options <ide> }).then(({ code, assets }) => { <ide> Object.keys(assets).forEach(key =>
1
Python
Python
add unit-test for recent comma-string updates
4b1569e2208baf36a5ebd0de0877946bd86b2a38
<ide><path>numpy/core/tests/test_numerictypes.py <ide> class test_read_values_nested_multiple(read_values_nested, NumpyTestCase): <ide> multiple_rows = True <ide> _buffer = NbufferT <ide> <add>class test_empty_field(NumpyTestCase): <add> def check_assign(self): <add> a = numpy.arange(10, dtype=numpy.float32) <add> a.dtype = [("int", "<0i4"),("float", "<2f4")] <add> assert(a['int'].shape == (5,0)) <add> assert(a['float'].shape == (5,2)) <ide> <ide> if __name__ == "__main__": <ide> NumpyTest().run()
1
Python
Python
use count_params function for non_trainable_count.
d476ecc7eb23509350b60c8cd917808ee4c61d29
<ide><path>keras/utils/layer_utils.py <ide> def print_layer_summary_with_connections(layer): <ide> else: <ide> trainable_count = count_params(model.trainable_weights) <ide> <del> non_trainable_count = int( <del> np.sum([K.count_params(p) for p in set(model.non_trainable_weights)])) <add> non_trainable_count = count_params(model.non_trainable_weights) <ide> <ide> print_fn( <ide> 'Total params: {:,}'.format(trainable_count + non_trainable_count))
1
Python
Python
fix two typos in npyio.py
3c1871459794dbbddb9596cfe98753893e2bef24
<ide><path>numpy/lib/npyio.py <ide> def load(file, mmap_mode=None): <ide> with load('foo.npz') as data: <ide> a = data['a'] <ide> <del> The underlyling file descriptor is closed when exiting the 'with' block. <add> The underlying file descriptor is closed when exiting the 'with' block. <ide> <ide> Examples <ide> -------- <ide> def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', <ide> flags: <ide> ``-`` : left justify <ide> <del> ``+`` : Forces to preceed result with + or -. <add> ``+`` : Forces to precede result with + or -. <ide> <ide> ``0`` : Left pad the number with zeros instead of space (see width). <ide>
1
Text
Text
clarify env inclusion in bundles
7ef653c7942faff7e08820a84bb7f1b5573b2e0d
<ide><path>docs/api-reference/next.config.js/environment-variables.md <ide> description: Learn to add and access environment variables in your Next.js appli <ide> </ul> <ide> </details> <ide> <add>> <b>Note</b>: environment variables specified in this way will <b>always</b> be included in the JavaScript bundle, prefixing the environment variable name with `NEXT_PUBLIC_` only has an effect when specifying them [through the environment or .env files](/docs/basic-features/environment-variables.md). <add> <ide> To add environment variables to the JavaScript bundle, open `next.config.js` and add the `env` config: <ide> <ide> ```js
1
Ruby
Ruby
remove fuse.pc from the whitelist
c92971f475272109153889b6ada0ed0603eb60d4
<ide><path>Library/Homebrew/cmd/doctor.rb <ide> def check_for_stray_pcs <ide> <ide> # Package-config files which are generally OK should be added to this list, <ide> # with a short description of the software they come with. <del> white_list = { <del> "fuse.pc" => "MacFuse", <del> } <add> white_list = { } <ide> <ide> bad_pcs = unbrewed_pcs.reject {|d| white_list.key? File.basename(d) } <ide> return if bad_pcs.empty?
1
PHP
PHP
create a data_set helper function
5f27c24bf153db3dbd33f1d925d3ca128885ffc2
<ide><path>src/Illuminate/Support/helpers.php <ide> function data_get($target, $key, $default = null) <ide> } <ide> } <ide> <add>if (! function_exists('data_set')) { <add> /** <add> * Set an item on an array or object using dot notation. <add> * <add> * @param mixed $target <add> * @param string|array $key <add> * @param mixed $value <add> * @return mixed <add> */ <add> function data_set(&$target, $key, $value) <add> { <add> $segments = is_array($key) ? $key : explode('.', $key); <add> <add> if (($segment = array_shift($segments)) === '*') { <add> if (! Arr::accessible($target)) { <add> $target = []; <add> } elseif ($segments) { <add> foreach ($target as &$inner) { <add> data_set($inner, $segments, $value); <add> } <add> } else { <add> foreach ($target as &$inner) { <add> $inner = $value; <add> } <add> } <add> } elseif (Arr::accessible($target)) { <add> if ($segments) { <add> if (! Arr::exists($target, $segment)) { <add> $target[$segment] = []; <add> } <add> <add> data_set($target[$segment], $segments, $value); <add> } elseif (! Arr::exists($target, $segment)) { <add> $target[$segment] = $value; <add> } <add> } elseif (is_object($target)) { <add> if ($segments) { <add> if (! isset($target->{$segment})) { <add> $target->{$segment} = []; <add> } <add> <add> data_set($target->{$segment}, $segments, $value); <add> } elseif (! isset($target->{$segment})) { <add> $target->{$segment} = $value; <add> } <add> } <add> <add> return $target; <add> } <add>} <add> <ide> if (! function_exists('dd')) { <ide> /** <ide> * Dump the passed variables and end the script. <ide><path>tests/Support/SupportHelpersTest.php <ide> public function testDataGetWithDoubleNestedArraysCollapsesResult() <ide> $this->assertEquals([], data_get($array, 'posts.*.users.*.name')); <ide> } <ide> <add> public function testDataSet() <add> { <add> $data = ['foo' => 'bar']; <add> <add> $this->assertEquals(['foo' => 'bar', 'baz' => 'boom'], data_set($data, 'baz', 'boom')); <add> $this->assertEquals(['foo' => 'bar', 'baz' => 'boom'], data_set($data, 'baz', 'noop')); <add> $this->assertEquals(['foo' => [], 'baz' => 'boom'], data_set($data, 'foo.*', 'noop')); <add> $this->assertEquals( <add> ['foo' => ['bar' => 'kaboom'], 'baz' => 'boom'], <add> data_set($data, 'foo.bar', 'kaboom') <add> ); <add> } <add> <add> public function testDataSetWithStar() <add> { <add> $data = ['foo' => 'bar']; <add> <add> $this->assertEquals( <add> ['foo' => []], <add> data_set($data, 'foo.*.bar', 'noop') <add> ); <add> <add> $this->assertEquals( <add> ['foo' => [], 'bar' => [['baz' => 'original'], []]], <add> data_set($data, 'bar', [['baz' => 'original'], []]) <add> ); <add> <add> $this->assertEquals( <add> ['foo' => [], 'bar' => [['baz' => 'original'], ['baz' => 'boom']]], <add> data_set($data, 'bar.*.baz', 'boom') <add> ); <add> } <add> <add> public function testDataSetWithDoubleStar() <add> { <add> $data = [ <add> 'posts' => [ <add> (object) [ <add> 'comments' => [ <add> (object) ['name' => 'First'], <add> (object) [], <add> ], <add> ], <add> (object) [ <add> 'comments' => [ <add> (object) [], <add> (object) ['name' => 'Second'], <add> ], <add> ], <add> ], <add> ]; <add> <add> data_set($data, 'posts.*.comments.*.name', 'Filled'); <add> <add> $this->assertEquals([ <add> 'posts' => [ <add> (object) [ <add> 'comments' => [ <add> (object) ['name' => 'First'], <add> (object) ['name' => 'Filled'], <add> ], <add> ], <add> (object) [ <add> 'comments' => [ <add> (object) ['name' => 'Filled'], <add> (object) ['name' => 'Second'], <add> ], <add> ], <add> ], <add> ], $data); <add> } <add> <ide> public function testArraySort() <ide> { <ide> $array = [
2
PHP
PHP
fix coding standards
4ffca8457e39c84730686ba0f9999614bff5f6e4
<ide><path>lib/Cake/Test/Case/TestSuite/CakeTestSuiteTest.php <ide> public function testAddTestDirectoryRecursiveWithHidden() { <ide> <ide> $Folder->delete(); <ide> } <del> <add> <ide> /** <ide> * testAddTestDirectoryRecursiveWithNonPhp <ide> * <ide><path>lib/Cake/Test/Case/View/Helper/FormHelperTest.php <ide> public function testDateTime() { <ide> ); <ide> $this->assertTags($result, $expected); <ide> $this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result); <del> <add> <ide> $result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('value' => false)); <ide> $this->assertTags($result, $expected); <ide> $this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result); <ide><path>lib/Cake/Test/Case/View/ViewTest.php <ide> public function testLoadHelpers() { <ide> $this->assertInstanceOf('FormHelper', $View->Form, 'Object type is wrong.'); <ide> } <ide> <del> <ide> /** <ide> * test lazy loading helpers <ide> *
3
Text
Text
update windows prerequisites
b9487449e151b02ff8cb1f3b4a0311e9eb0878e2
<ide><path>BUILDING.md <ide> Prerequisites: <ide> * [Python 2.6 or 2.7](https://www.python.org/downloads/) <ide> * One of: <ide> * [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) <del> * [Visual Studio](https://www.visualstudio.com/) 2013 / 2015, all editions including the Community edition <del> * [Visual Studio](https://www.visualstudio.com/) Express 2013 / 2015 for Desktop <add> * [Visual Studio 2015 Update 3](https://www.visualstudio.com/), all editions <add> including the Community edition. <ide> * Basic Unix tools required for some tests, <ide> [Git for Windows](http://git-scm.com/download/win) includes Git Bash <ide> and tools which can be included in the global `PATH`.
1
Javascript
Javascript
put modern strictmode behind a feature flag
abbbdf4cec992666885cc67344563795a333d4a2
<ide><path>packages/react-reconciler/src/ReactFiberClassComponent.new.js <ide> import type {UpdateQueue} from './ReactFiberClassUpdateQueue.new'; <ide> import type {Flags} from './ReactFiberFlags'; <ide> <ide> import * as React from 'react'; <del>import {LayoutStatic, Update, Snapshot} from './ReactFiberFlags'; <add>import { <add> LayoutStatic, <add> Update, <add> Snapshot, <add> MountLayoutDev, <add>} from './ReactFiberFlags'; <ide> import { <ide> debugRenderPhaseSideEffectsForStrictMode, <ide> disableLegacyContext, <ide> enableDebugTracing, <ide> enableSchedulingProfiler, <ide> warnAboutDeprecatedLifecycles, <ide> enableLazyContextPropagation, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import ReactStrictModeWarnings from './ReactStrictModeWarnings.new'; <ide> import {isMounted} from './ReactFiberTreeReflection'; <ide> import isArray from 'shared/isArray'; <ide> import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols'; <ide> <ide> import {resolveDefaultProps} from './ReactFiberLazyComponent.new'; <del>import {DebugTracingMode, StrictLegacyMode} from './ReactTypeOfMode'; <add>import { <add> DebugTracingMode, <add> NoMode, <add> StrictLegacyMode, <add> StrictEffectsMode, <add>} from './ReactTypeOfMode'; <ide> <ide> import { <ide> enqueueUpdate, <ide> function mountClassInstance( <ide> } <ide> <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> } <ide> function resumeMountClassInstance( <ide> // If an update was already in progress, we should schedule an Update <ide> // effect even though we're bailing out, so that cWU/cDU are called. <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> return false; <ide> function resumeMountClassInstance( <ide> } <ide> } <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> } else { <ide> // If an update was already in progress, we should schedule an Update <ide> // effect even though we're bailing out, so that cWU/cDU are called. <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> <ide><path>packages/react-reconciler/src/ReactFiberClassComponent.old.js <ide> import type {UpdateQueue} from './ReactFiberClassUpdateQueue.old'; <ide> import type {Flags} from './ReactFiberFlags'; <ide> <ide> import * as React from 'react'; <del>import {LayoutStatic, Update, Snapshot} from './ReactFiberFlags'; <add>import { <add> LayoutStatic, <add> Update, <add> Snapshot, <add> MountLayoutDev, <add>} from './ReactFiberFlags'; <ide> import { <ide> debugRenderPhaseSideEffectsForStrictMode, <ide> disableLegacyContext, <ide> enableDebugTracing, <ide> enableSchedulingProfiler, <ide> warnAboutDeprecatedLifecycles, <ide> enableLazyContextPropagation, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import ReactStrictModeWarnings from './ReactStrictModeWarnings.old'; <ide> import {isMounted} from './ReactFiberTreeReflection'; <ide> import isArray from 'shared/isArray'; <ide> import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols'; <ide> <ide> import {resolveDefaultProps} from './ReactFiberLazyComponent.old'; <del>import {DebugTracingMode, StrictLegacyMode} from './ReactTypeOfMode'; <add>import { <add> DebugTracingMode, <add> NoMode, <add> StrictLegacyMode, <add> StrictEffectsMode, <add>} from './ReactTypeOfMode'; <ide> <ide> import { <ide> enqueueUpdate, <ide> function mountClassInstance( <ide> } <ide> <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> } <ide> function resumeMountClassInstance( <ide> // If an update was already in progress, we should schedule an Update <ide> // effect even though we're bailing out, so that cWU/cDU are called. <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> return false; <ide> function resumeMountClassInstance( <ide> } <ide> } <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> } else { <ide> // If an update was already in progress, we should schedule an Update <ide> // effect even though we're bailing out, so that cWU/cDU are called. <ide> if (typeof instance.componentDidMount === 'function') { <del> const fiberFlags: Flags = Update | LayoutStatic; <add> let fiberFlags: Flags = Update | LayoutStatic; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDev; <add> } <ide> workInProgress.flags |= fiberFlags; <ide> } <ide> <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.new.js <ide> import { <ide> enableCache, <ide> enableTransitionTracing, <ide> enableUseEventHook, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import { <ide> FunctionComponent, <ide> function commitPassiveUnmountInsideDeletedTreeOnFiber( <ide> } <ide> } <ide> <del>export {commitPlacement, commitAttachRef, commitDetachRef}; <add>function invokeLayoutEffectMountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListMount(HookLayout | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> case ClassComponent: { <add> const instance = fiber.stateNode; <add> try { <add> instance.componentDidMount(); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokePassiveEffectMountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListMount(HookPassive | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListUnmount( <add> HookLayout | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> case ClassComponent: { <add> const instance = fiber.stateNode; <add> if (typeof instance.componentWillUnmount === 'function') { <add> safelyCallComponentWillUnmount(fiber, fiber.return, instance); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListUnmount( <add> HookPassive | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> } <add> } <add> } <add>} <add> <add>export { <add> commitPlacement, <add> commitAttachRef, <add> commitDetachRef, <add> invokeLayoutEffectMountInDEV, <add> invokeLayoutEffectUnmountInDEV, <add> invokePassiveEffectMountInDEV, <add> invokePassiveEffectUnmountInDEV, <add>}; <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.old.js <ide> import { <ide> enableCache, <ide> enableTransitionTracing, <ide> enableUseEventHook, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import { <ide> FunctionComponent, <ide> function commitPassiveUnmountInsideDeletedTreeOnFiber( <ide> } <ide> } <ide> <del>export {commitPlacement, commitAttachRef, commitDetachRef}; <add>function invokeLayoutEffectMountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListMount(HookLayout | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> case ClassComponent: { <add> const instance = fiber.stateNode; <add> try { <add> instance.componentDidMount(); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokePassiveEffectMountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListMount(HookPassive | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListUnmount( <add> HookLayout | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> break; <add> } <add> case ClassComponent: { <add> const instance = fiber.stateNode; <add> if (typeof instance.componentWillUnmount === 'function') { <add> safelyCallComponentWillUnmount(fiber, fiber.return, instance); <add> } <add> break; <add> } <add> } <add> } <add>} <add> <add>function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { <add> if (__DEV__ && enableStrictEffects) { <add> // We don't need to re-check StrictEffectsMode here. <add> // This function is only called if that check has already passed. <add> switch (fiber.tag) { <add> case FunctionComponent: <add> case ForwardRef: <add> case SimpleMemoComponent: { <add> try { <add> commitHookEffectListUnmount( <add> HookPassive | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <add> } <add> } <add> } <add> } <add>} <add> <add>export { <add> commitPlacement, <add> commitAttachRef, <add> commitDetachRef, <add> invokeLayoutEffectMountInDEV, <add> invokeLayoutEffectUnmountInDEV, <add> invokePassiveEffectMountInDEV, <add> invokePassiveEffectUnmountInDEV, <add>}; <ide><path>packages/react-reconciler/src/ReactFiberFlags.js <ide> import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags'; <ide> export type Flags = number; <ide> <ide> // Don't change these two values. They're used by React Dev Tools. <del>export const NoFlags = /* */ 0b000000000000000000000000; <del>export const PerformedWork = /* */ 0b000000000000000000000001; <add>export const NoFlags = /* */ 0b00000000000000000000000000; <add>export const PerformedWork = /* */ 0b00000000000000000000000001; <ide> <ide> // You can change the rest (and add more). <del>export const Placement = /* */ 0b000000000000000000000010; <del>export const Update = /* */ 0b000000000000000000000100; <del>export const ChildDeletion = /* */ 0b000000000000000000001000; <del>export const ContentReset = /* */ 0b000000000000000000010000; <del>export const Callback = /* */ 0b000000000000000000100000; <del>export const DidCapture = /* */ 0b000000000000000001000000; <del>export const ForceClientRender = /* */ 0b000000000000000010000000; <del>export const Ref = /* */ 0b000000000000000100000000; <del>export const Snapshot = /* */ 0b000000000000001000000000; <del>export const Passive = /* */ 0b000000000000010000000000; <del>export const Hydrating = /* */ 0b000000000000100000000000; <del>export const Visibility = /* */ 0b000000000001000000000000; <del>export const StoreConsistency = /* */ 0b000000000010000000000000; <add>export const Placement = /* */ 0b00000000000000000000000010; <add>export const Update = /* */ 0b00000000000000000000000100; <add>export const ChildDeletion = /* */ 0b00000000000000000000001000; <add>export const ContentReset = /* */ 0b00000000000000000000010000; <add>export const Callback = /* */ 0b00000000000000000000100000; <add>export const DidCapture = /* */ 0b00000000000000000001000000; <add>export const ForceClientRender = /* */ 0b00000000000000000010000000; <add>export const Ref = /* */ 0b00000000000000000100000000; <add>export const Snapshot = /* */ 0b00000000000000001000000000; <add>export const Passive = /* */ 0b00000000000000010000000000; <add>export const Hydrating = /* */ 0b00000000000000100000000000; <add>export const Visibility = /* */ 0b00000000000001000000000000; <add>export const StoreConsistency = /* */ 0b00000000000010000000000000; <ide> <ide> export const LifecycleEffectMask = <ide> Passive | Update | Callback | Ref | Snapshot | StoreConsistency; <ide> <ide> // Union of all commit flags (flags with the lifetime of a particular commit) <del>export const HostEffectMask = /* */ 0b000000000011111111111111; <add>export const HostEffectMask = /* */ 0b00000000000011111111111111; <ide> <ide> // These are not really side effects, but we still reuse this field. <del>export const Incomplete = /* */ 0b000000000100000000000000; <del>export const ShouldCapture = /* */ 0b000000001000000000000000; <del>export const ForceUpdateForLegacySuspense = /* */ 0b000000010000000000000000; <del>export const DidPropagateContext = /* */ 0b000000100000000000000000; <del>export const NeedsPropagation = /* */ 0b000001000000000000000000; <del>export const Forked = /* */ 0b000010000000000000000000; <add>export const Incomplete = /* */ 0b00000000000100000000000000; <add>export const ShouldCapture = /* */ 0b00000000001000000000000000; <add>export const ForceUpdateForLegacySuspense = /* */ 0b00000000010000000000000000; <add>export const DidPropagateContext = /* */ 0b00000000100000000000000000; <add>export const NeedsPropagation = /* */ 0b00000001000000000000000000; <add>export const Forked = /* */ 0b00000010000000000000000000; <ide> <ide> // Static tags describe aspects of a fiber that are not specific to a render, <ide> // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). <ide> // This enables us to defer more work in the unmount case, <ide> // since we can defer traversing the tree during layout to look for Passive effects, <ide> // and instead rely on the static flag as a signal that there may be cleanup work. <del>export const RefStatic = /* */ 0b000100000000000000000000; <del>export const LayoutStatic = /* */ 0b001000000000000000000000; <del>export const PassiveStatic = /* */ 0b010000000000000000000000; <add>export const RefStatic = /* */ 0b00000100000000000000000000; <add>export const LayoutStatic = /* */ 0b00001000000000000000000000; <add>export const PassiveStatic = /* */ 0b00010000000000000000000000; <ide> <ide> // Flag used to identify newly inserted fibers. It isn't reset after commit unlike `Placement`. <del>export const PlacementDEV = /* */ 0b100000000000000000000000; <add>export const PlacementDEV = /* */ 0b00100000000000000000000000; <add>export const MountLayoutDev = /* */ 0b01000000000000000000000000; <add>export const MountPassiveDev = /* */ 0b10000000000000000000000000; <ide> <ide> // Groups of flags that are used in the commit phase to skip over trees that <ide> // don't contain effects, by checking subtreeFlags. <ide><path>packages/react-reconciler/src/ReactFiberHooks.new.js <ide> import { <ide> enableUseHook, <ide> enableUseMemoCacheHook, <ide> enableUseEventHook, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import { <ide> REACT_CONTEXT_TYPE, <ide> REACT_SERVER_CONTEXT_TYPE, <ide> } from 'shared/ReactSymbols'; <ide> <del>import {NoMode, ConcurrentMode, DebugTracingMode} from './ReactTypeOfMode'; <add>import { <add> NoMode, <add> ConcurrentMode, <add> DebugTracingMode, <add> StrictEffectsMode, <add>} from './ReactTypeOfMode'; <ide> import { <ide> NoLane, <ide> SyncLane, <ide> import { <ide> StaticMask as StaticMaskEffect, <ide> Update as UpdateEffect, <ide> StoreConsistency, <add> MountLayoutDev as MountLayoutDevEffect, <add> MountPassiveDev as MountPassiveDevEffect, <ide> } from './ReactFiberFlags'; <ide> import { <ide> HasEffect as HookHasEffect, <ide> export function bailoutHooks( <ide> lanes: Lanes, <ide> ) { <ide> workInProgress.updateQueue = current.updateQueue; <del> workInProgress.flags &= ~(PassiveEffect | UpdateEffect); <add> // TODO: Don't need to reset the flags here, because they're reset in the <add> // complete phase (bubbleProperties). <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> workInProgress.flags &= ~( <add> MountPassiveDevEffect | <add> MountLayoutDevEffect | <add> PassiveEffect | <add> UpdateEffect <add> ); <add> } else { <add> workInProgress.flags &= ~(PassiveEffect | UpdateEffect); <add> } <ide> current.lanes = removeLanes(current.lanes, lanes); <ide> } <ide> <ide> function mountEffect( <ide> create: () => (() => void) | void, <ide> deps: Array<mixed> | void | null, <ide> ): void { <del> return mountEffectImpl( <del> PassiveEffect | PassiveStaticEffect, <del> HookPassive, <del> create, <del> deps, <del> ); <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> return mountEffectImpl( <add> MountPassiveDevEffect | PassiveEffect | PassiveStaticEffect, <add> HookPassive, <add> create, <add> deps, <add> ); <add> } else { <add> return mountEffectImpl( <add> PassiveEffect | PassiveStaticEffect, <add> HookPassive, <add> create, <add> deps, <add> ); <add> } <ide> } <ide> <ide> function updateEffect( <ide> function mountLayoutEffect( <ide> create: () => (() => void) | void, <ide> deps: Array<mixed> | void | null, <ide> ): void { <del> const fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDevEffect; <add> } <ide> return mountEffectImpl(fiberFlags, HookLayout, create, deps); <ide> } <ide> <ide> function mountImperativeHandle<T>( <ide> const effectDeps = <ide> deps !== null && deps !== undefined ? deps.concat([ref]) : null; <ide> <del> const fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDevEffect; <add> } <ide> return mountEffectImpl( <ide> fiberFlags, <ide> HookLayout, <ide><path>packages/react-reconciler/src/ReactFiberHooks.old.js <ide> import { <ide> enableUseHook, <ide> enableUseMemoCacheHook, <ide> enableUseEventHook, <add> enableStrictEffects, <ide> } from 'shared/ReactFeatureFlags'; <ide> import { <ide> REACT_CONTEXT_TYPE, <ide> REACT_SERVER_CONTEXT_TYPE, <ide> } from 'shared/ReactSymbols'; <ide> <del>import {NoMode, ConcurrentMode, DebugTracingMode} from './ReactTypeOfMode'; <add>import { <add> NoMode, <add> ConcurrentMode, <add> DebugTracingMode, <add> StrictEffectsMode, <add>} from './ReactTypeOfMode'; <ide> import { <ide> NoLane, <ide> SyncLane, <ide> import { <ide> StaticMask as StaticMaskEffect, <ide> Update as UpdateEffect, <ide> StoreConsistency, <add> MountLayoutDev as MountLayoutDevEffect, <add> MountPassiveDev as MountPassiveDevEffect, <ide> } from './ReactFiberFlags'; <ide> import { <ide> HasEffect as HookHasEffect, <ide> export function bailoutHooks( <ide> lanes: Lanes, <ide> ) { <ide> workInProgress.updateQueue = current.updateQueue; <del> workInProgress.flags &= ~(PassiveEffect | UpdateEffect); <add> // TODO: Don't need to reset the flags here, because they're reset in the <add> // complete phase (bubbleProperties). <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (workInProgress.mode & StrictEffectsMode) !== NoMode <add> ) { <add> workInProgress.flags &= ~( <add> MountPassiveDevEffect | <add> MountLayoutDevEffect | <add> PassiveEffect | <add> UpdateEffect <add> ); <add> } else { <add> workInProgress.flags &= ~(PassiveEffect | UpdateEffect); <add> } <ide> current.lanes = removeLanes(current.lanes, lanes); <ide> } <ide> <ide> function mountEffect( <ide> create: () => (() => void) | void, <ide> deps: Array<mixed> | void | null, <ide> ): void { <del> return mountEffectImpl( <del> PassiveEffect | PassiveStaticEffect, <del> HookPassive, <del> create, <del> deps, <del> ); <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> return mountEffectImpl( <add> MountPassiveDevEffect | PassiveEffect | PassiveStaticEffect, <add> HookPassive, <add> create, <add> deps, <add> ); <add> } else { <add> return mountEffectImpl( <add> PassiveEffect | PassiveStaticEffect, <add> HookPassive, <add> create, <add> deps, <add> ); <add> } <ide> } <ide> <ide> function updateEffect( <ide> function mountLayoutEffect( <ide> create: () => (() => void) | void, <ide> deps: Array<mixed> | void | null, <ide> ): void { <del> const fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDevEffect; <add> } <ide> return mountEffectImpl(fiberFlags, HookLayout, create, deps); <ide> } <ide> <ide> function mountImperativeHandle<T>( <ide> const effectDeps = <ide> deps !== null && deps !== undefined ? deps.concat([ref]) : null; <ide> <del> const fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; <add> if ( <add> __DEV__ && <add> enableStrictEffects && <add> (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode <add> ) { <add> fiberFlags |= MountLayoutDevEffect; <add> } <ide> return mountEffectImpl( <ide> fiberFlags, <ide> HookLayout, <ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js <ide> import { <ide> enableUpdaterTracking, <ide> enableCache, <ide> enableTransitionTracing, <add> useModernStrictMode, <ide> } from 'shared/ReactFeatureFlags'; <ide> import ReactSharedInternals from 'shared/ReactSharedInternals'; <ide> import is from 'shared/objectIs'; <ide> import { <ide> Profiler, <ide> } from './ReactWorkTags'; <ide> import {ConcurrentRoot, LegacyRoot} from './ReactRootTags'; <add>import type {Flags} from './ReactFiberFlags'; <ide> import { <ide> NoFlags, <ide> Incomplete, <ide> import { <ide> PassiveMask, <ide> PlacementDEV, <ide> Visibility, <add> MountPassiveDev, <add> MountLayoutDev, <ide> } from './ReactFiberFlags'; <ide> import { <ide> NoLanes, <ide> import { <ide> reappearLayoutEffects, <ide> disconnectPassiveEffect, <ide> reportUncaughtErrorInDEV, <add> invokeLayoutEffectMountInDEV, <add> invokePassiveEffectMountInDEV, <add> invokeLayoutEffectUnmountInDEV, <add> invokePassiveEffectUnmountInDEV, <ide> } from './ReactFiberCommitWork.new'; <ide> import {enqueueUpdate} from './ReactFiberClassUpdateQueue.new'; <ide> import {resetContextDependencies} from './ReactFiberNewContext.new'; <ide> function commitRootImpl( <ide> <ide> if (__DEV__ && enableStrictEffects) { <ide> if (!rootDidHavePassiveEffects) { <del> commitDoubleInvokeEffectsInDEV(root); <add> commitDoubleInvokeEffectsInDEV(root, false); <ide> } <ide> } <ide> <ide> function flushPassiveEffectsImpl() { <ide> } <ide> <ide> if (__DEV__ && enableStrictEffects) { <del> commitDoubleInvokeEffectsInDEV(root); <add> commitDoubleInvokeEffectsInDEV(root, true); <ide> } <ide> <ide> executionContext = prevExecutionContext; <ide> function doubleInvokeEffectsInDEVIfNecessary( <ide> } <ide> } <ide> <del>function commitDoubleInvokeEffectsInDEV(root: FiberRoot) { <add>function commitDoubleInvokeEffectsInDEV( <add> root: FiberRoot, <add> hasPassiveEffects: boolean, <add>) { <ide> if (__DEV__ && enableStrictEffects) { <del> let doubleInvokeEffects = true; <add> if (useModernStrictMode) { <add> let doubleInvokeEffects = true; <ide> <del> if (root.tag === LegacyRoot && !(root.current.mode & StrictLegacyMode)) { <del> doubleInvokeEffects = false; <add> if (root.tag === LegacyRoot && !(root.current.mode & StrictLegacyMode)) { <add> doubleInvokeEffects = false; <add> } <add> if ( <add> root.tag === ConcurrentRoot && <add> !(root.current.mode & (StrictLegacyMode | StrictEffectsMode)) <add> ) { <add> doubleInvokeEffects = false; <add> } <add> recursivelyTraverseAndDoubleInvokeEffectsInDEV( <add> root, <add> root.current, <add> doubleInvokeEffects, <add> ); <add> } else { <add> legacyCommitDoubleInvokeEffectsInDEV(root.current, hasPassiveEffects); <ide> } <add> } <add>} <add> <add>function legacyCommitDoubleInvokeEffectsInDEV( <add> fiber: Fiber, <add> hasPassiveEffects: boolean, <add>) { <add> // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects <add> // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. <add> // Maybe not a big deal since this is DEV only behavior. <add> <add> setCurrentDebugFiberInDEV(fiber); <add> invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); <add> if (hasPassiveEffects) { <add> invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV); <add> } <add> <add> invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); <add> if (hasPassiveEffects) { <add> invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); <add> } <add> resetCurrentDebugFiberInDEV(); <add>} <add> <add>function invokeEffectsInDev( <add> firstChild: Fiber, <add> fiberFlags: Flags, <add> invokeEffectFn: (fiber: Fiber) => void, <add>) { <add> let current = firstChild; <add> let subtreeRoot = null; <add> while (current != null) { <add> const primarySubtreeFlag = current.subtreeFlags & fiberFlags; <ide> if ( <del> root.tag === ConcurrentRoot && <del> !(root.current.mode & (StrictLegacyMode | StrictEffectsMode)) <add> current !== subtreeRoot && <add> current.child != null && <add> primarySubtreeFlag !== NoFlags <ide> ) { <del> doubleInvokeEffects = false; <add> current = current.child; <add> } else { <add> if ((current.flags & fiberFlags) !== NoFlags) { <add> invokeEffectFn(current); <add> } <add> <add> if (current.sibling !== null) { <add> current = current.sibling; <add> } else { <add> current = subtreeRoot = current.return; <add> } <ide> } <del> recursivelyTraverseAndDoubleInvokeEffectsInDEV( <del> root, <del> root.current, <del> doubleInvokeEffects, <del> ); <ide> } <ide> } <ide> <ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.old.js <ide> import { <ide> enableUpdaterTracking, <ide> enableCache, <ide> enableTransitionTracing, <add> useModernStrictMode, <ide> } from 'shared/ReactFeatureFlags'; <ide> import ReactSharedInternals from 'shared/ReactSharedInternals'; <ide> import is from 'shared/objectIs'; <ide> import { <ide> Profiler, <ide> } from './ReactWorkTags'; <ide> import {ConcurrentRoot, LegacyRoot} from './ReactRootTags'; <add>import type {Flags} from './ReactFiberFlags'; <ide> import { <ide> NoFlags, <ide> Incomplete, <ide> import { <ide> PassiveMask, <ide> PlacementDEV, <ide> Visibility, <add> MountPassiveDev, <add> MountLayoutDev, <ide> } from './ReactFiberFlags'; <ide> import { <ide> NoLanes, <ide> import { <ide> reappearLayoutEffects, <ide> disconnectPassiveEffect, <ide> reportUncaughtErrorInDEV, <add> invokeLayoutEffectMountInDEV, <add> invokePassiveEffectMountInDEV, <add> invokeLayoutEffectUnmountInDEV, <add> invokePassiveEffectUnmountInDEV, <ide> } from './ReactFiberCommitWork.old'; <ide> import {enqueueUpdate} from './ReactFiberClassUpdateQueue.old'; <ide> import {resetContextDependencies} from './ReactFiberNewContext.old'; <ide> function commitRootImpl( <ide> <ide> if (__DEV__ && enableStrictEffects) { <ide> if (!rootDidHavePassiveEffects) { <del> commitDoubleInvokeEffectsInDEV(root); <add> commitDoubleInvokeEffectsInDEV(root, false); <ide> } <ide> } <ide> <ide> function flushPassiveEffectsImpl() { <ide> } <ide> <ide> if (__DEV__ && enableStrictEffects) { <del> commitDoubleInvokeEffectsInDEV(root); <add> commitDoubleInvokeEffectsInDEV(root, true); <ide> } <ide> <ide> executionContext = prevExecutionContext; <ide> function doubleInvokeEffectsInDEVIfNecessary( <ide> } <ide> } <ide> <del>function commitDoubleInvokeEffectsInDEV(root: FiberRoot) { <add>function commitDoubleInvokeEffectsInDEV( <add> root: FiberRoot, <add> hasPassiveEffects: boolean, <add>) { <ide> if (__DEV__ && enableStrictEffects) { <del> let doubleInvokeEffects = true; <add> if (useModernStrictMode) { <add> let doubleInvokeEffects = true; <ide> <del> if (root.tag === LegacyRoot && !(root.current.mode & StrictLegacyMode)) { <del> doubleInvokeEffects = false; <add> if (root.tag === LegacyRoot && !(root.current.mode & StrictLegacyMode)) { <add> doubleInvokeEffects = false; <add> } <add> if ( <add> root.tag === ConcurrentRoot && <add> !(root.current.mode & (StrictLegacyMode | StrictEffectsMode)) <add> ) { <add> doubleInvokeEffects = false; <add> } <add> recursivelyTraverseAndDoubleInvokeEffectsInDEV( <add> root, <add> root.current, <add> doubleInvokeEffects, <add> ); <add> } else { <add> legacyCommitDoubleInvokeEffectsInDEV(root.current, hasPassiveEffects); <ide> } <add> } <add>} <add> <add>function legacyCommitDoubleInvokeEffectsInDEV( <add> fiber: Fiber, <add> hasPassiveEffects: boolean, <add>) { <add> // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects <add> // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. <add> // Maybe not a big deal since this is DEV only behavior. <add> <add> setCurrentDebugFiberInDEV(fiber); <add> invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); <add> if (hasPassiveEffects) { <add> invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV); <add> } <add> <add> invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); <add> if (hasPassiveEffects) { <add> invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); <add> } <add> resetCurrentDebugFiberInDEV(); <add>} <add> <add>function invokeEffectsInDev( <add> firstChild: Fiber, <add> fiberFlags: Flags, <add> invokeEffectFn: (fiber: Fiber) => void, <add>) { <add> let current = firstChild; <add> let subtreeRoot = null; <add> while (current != null) { <add> const primarySubtreeFlag = current.subtreeFlags & fiberFlags; <ide> if ( <del> root.tag === ConcurrentRoot && <del> !(root.current.mode & (StrictLegacyMode | StrictEffectsMode)) <add> current !== subtreeRoot && <add> current.child != null && <add> primarySubtreeFlag !== NoFlags <ide> ) { <del> doubleInvokeEffects = false; <add> current = current.child; <add> } else { <add> if ((current.flags & fiberFlags) !== NoFlags) { <add> invokeEffectFn(current); <add> } <add> <add> if (current.sibling !== null) { <add> current = current.sibling; <add> } else { <add> current = subtreeRoot = current.return; <add> } <ide> } <del> recursivelyTraverseAndDoubleInvokeEffectsInDEV( <del> root, <del> root.current, <del> doubleInvokeEffects, <del> ); <ide> } <ide> } <ide> <ide><path>packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js <ide> describe('ReactOffscreenStrictMode', () => { <ide> ]); <ide> }); <ide> <del> // @gate __DEV__ && enableStrictEffects && enableOffscreen <add> // @gate __DEV__ && enableStrictEffects && enableOffscreen && useModernStrictMode <ide> it('should not trigger strict effects when offscreen is hidden', () => { <ide> act(() => { <ide> ReactNoop.render( <ide><path>packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js <ide> describe('StrictEffectsMode defaults', () => { <ide> expect(Scheduler).toHaveYielded([]); <ide> }); <ide> <add> //@gate useModernStrictMode <ide> it('disconnects refs during double invoking', () => { <ide> const onRefMock = jest.fn(); <ide> function App({text}) { <ide><path>packages/react/src/__tests__/ReactStrictMode-test.js <ide> describe('ReactStrictMode', () => { <ide> ); <ide> }); <ide> <del> // @gate __DEV__ && !enableStrictEffects <add> // @gate __DEV__ <ide> it('should invoke precommit lifecycle methods twice', () => { <ide> let log = []; <ide> let shouldComponentUpdate = false; <ide><path>packages/shared/ReactFeatureFlags.js <ide> export const enableGetInspectorDataForInstanceInProduction = false; <ide> export const enableProfilerNestedUpdateScheduledHook = false; <ide> <ide> export const consoleManagedByDevToolsDuringStrictMode = true; <add> <add>// Modern <StrictMode /> behaviour aligns more with what components <add>// components will encounter in production, especially when used With <Offscreen />. <add>// TODO: clean up legacy <StrictMode /> once tests pass WWW. <add>export const useModernStrictMode = false; <ide><path>packages/shared/forks/ReactFeatureFlags.native-fb.js <ide> export const enableUseMutableSource = true; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.native-oss.js <ide> export const enableUseMutableSource = false; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.test-renderer.js <ide> export const enableUseMutableSource = false; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.test-renderer.native.js <ide> export const enableUseMutableSource = false; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.test-renderer.www.js <ide> export const enableUseMutableSource = true; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.testing.js <ide> export const enableUseMutableSource = false; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.testing.www.js <ide> export const enableUseMutableSource = true; <ide> export const enableTransitionTracing = false; <ide> <ide> export const enableFloat = false; <add> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null; <ide><path>packages/shared/forks/ReactFeatureFlags.www.js <ide> export const enableUseMutableSource = true; <ide> <ide> export const enableCustomElementPropertySupport = __EXPERIMENTAL__; <ide> <add>export const useModernStrictMode = false; <ide> // Flow magic to verify the exports of this file match the original version. <ide> // eslint-disable-next-line no-unused-vars <ide> type Check<_X, Y: _X, X: Y = _X> = null;
21
Text
Text
add speakeasy link
db9d92041f53223274796ade51265d68e03bae1a
<ide><path>README.md <ide> <ide> Check out our [documentation on the docs tab](https://github.com/github/atom/docs). <ide> <del>## Building from source <add>## Installing <add> <add>Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). <add> <add>It will automatically update when a new build is available. <add> <add>## Building <ide> <ide> ### Requirements <ide>
1
Text
Text
fix minor docs typos
cccaa0090fbc8f737068270c65308d7f0b1d298c
<ide><path>docs/basics/UsageWithReact.md <ide> In this todo app, we will only have a single “smart” component at the top of <ide> <ide> Remember how we [designed the shape of the root state object](Reducers.md)? It’s time we design the UI hierarchy to match it. This is not a Redux-specific task. [Thinking in React](https://facebook.github.io/react/docs/thinking-in-react.html) is a great tutorial that explains the process. <ide> <del>Our design brief is simple. We want to show a list of todo items. On click, a todo item is crossed out as completed. We want to show a field where the user may add a new todo. In the footer, we want to show a toggle to show all / only completed / only incompleted todos. <add>Our design brief is simple. We want to show a list of todo items. On click, a todo item is crossed out as completed. We want to show a field where the user may add a new todo. In the footer, we want to show a toggle to show all / only completed / only incomplete todos. <ide> <ide> I see the following components (and their props) emerge from this brief: <ide> <ide><path>docs/recipes/ServerRendering.md <ide> export function fetchCounter(callback) { <ide> <ide> Again, this is just a mock API, so we use `setTimeout` to simulate a network request that takes 500 milliseconds to respond (this should be much faster with a real world API). We pass in a callback that returns a random number asynchronously. If you’re using a Promise-based API client, then you would issue this callback in your `then` handler. <ide> <del>On the server side, we simply wrap our existing code in the `fetchCounter` and recieve the result in the callback: <add>On the server side, we simply wrap our existing code in the `fetchCounter` and receive the result in the callback: <ide> <ide> #### `server.js` <ide>
2
Go
Go
implement pos for set and add unit tests
79bb8212e05cc9c14b8edda2b8a924fef63ea2e0
<ide><path>networkdriver/portallocator/allocator.go <ide> import ( <ide> "sync" <ide> ) <ide> <del>type networkSet map[iPNet]iPSet <add>type networkSet map[iPNet]*iPSet <ide> <ide> type iPNet struct { <ide> IP string <ide> func RegisterNetwork(network *net.IPNet) error { <ide> } <ide> n := newIPNet(network) <ide> <del> allocatedIPs[n] = iPSet{} <del> availableIPS[n] = iPSet{} <add> allocatedIPs[n] = &iPSet{} <add> availableIPS[n] = &iPSet{} <ide> <ide> return nil <ide> } <ide> func ReleaseIP(network *net.IPNet, ip *net.IP) error { <ide> lock.Lock() <ide> defer lock.Unlock() <ide> <del> n := newIPNet(network) <del> existing := allocatedIPs[n] <add> var ( <add> first, _ = networkRange(network) <add> base = ipToInt(&first) <add> n = newIPNet(network) <add> existing = allocatedIPs[n] <add> available = availableIPS[n] <add> i = ipToInt(ip) <add> pos = i - base <add> ) <ide> <del> i := ipToInt(ip) <del> existing.Remove(int(i)) <del> available := availableIPS[n] <del> available.Push(int(i)) <add> existing.Remove(int(pos)) <add> available.Push(int(pos)) <ide> <ide> return nil <ide> } <ide> <ide> func getNextIp(network *net.IPNet) (*net.IP, error) { <ide> var ( <ide> n = newIPNet(network) <add> ownIP = ipToInt(&network.IP) <ide> available = availableIPS[n] <del> next = available.Pop() <ide> allocated = allocatedIPs[n] <del> ownIP = int(ipToInt(&network.IP)) <add> <add> first, _ = networkRange(network) <add> base = ipToInt(&first) <add> <add> pos = int32(available.Pop()) <ide> ) <ide> <del> if next != 0 { <del> ip := intToIP(int32(next)) <del> allocated.Push(int(next)) <add> // We pop and push the position not the ip <add> if pos != 0 { <add> ip := intToIP(int32(base + pos)) <add> allocated.Push(int(pos)) <add> <ide> return ip, nil <ide> } <del> size := int(networkSize(network.Mask)) <del> next = allocated.PullBack() + 1 <ide> <del> // size -1 for the broadcast address, -1 for the gateway address <del> for i := 0; i < size-2; i++ { <add> var ( <add> size = int(networkSize(network.Mask)) <add> max = int32(size - 2) // size -1 for the broadcast address, -1 for the gateway address <add> ) <add> <add> if pos = int32(allocated.PullBack()); pos == 0 { <add> pos = 1 <add> } <add> <add> for i := int32(0); i < max; i++ { <add> next := int32(base + pos) <add> pos = pos%max + 1 <add> <ide> if next == ownIP { <del> next++ <ide> continue <ide> } <ide> <del> ip := intToIP(int32(next)) <del> allocated.Push(next) <add> ip := intToIP(next) <add> allocated.Push(int(pos)) <ide> <ide> return ip, nil <ide> } <ide> func getNextIp(network *net.IPNet) (*net.IP, error) { <ide> <ide> func registerIP(network *net.IPNet, ip *net.IP) error { <ide> existing := allocatedIPs[newIPNet(network)] <add> // checking position not ip <ide> if existing.Exists(int(ipToInt(ip))) { <ide> return ErrIPAlreadyAllocated <ide> } <ide><path>networkdriver/portallocator/allocator_test.go <ide> package ipallocator <ide> <ide> import ( <add> "fmt" <ide> "net" <ide> "testing" <ide> ) <ide> <add>func reset() { <add> allocatedIPs = networkSet{} <add> availableIPS = networkSet{} <add>} <add> <ide> func TestRegisterNetwork(t *testing.T) { <add> defer reset() <ide> network := &net.IPNet{ <ide> IP: []byte{192, 168, 0, 1}, <ide> Mask: []byte{255, 255, 255, 0}, <ide> func TestRegisterNetwork(t *testing.T) { <ide> t.Fatal("IPNet should exist in available IPs") <ide> } <ide> } <add> <add>func TestRegisterTwoNetworks(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> network2 := &net.IPNet{ <add> IP: []byte{10, 1, 42, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network2); err != nil { <add> t.Fatal(err) <add> } <add>} <add> <add>func TestRegisterNetworkThatExists(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> if err := RegisterNetwork(network); err != ErrNetworkAlreadyRegisterd { <add> t.Fatalf("Expected error of %s got %s", ErrNetworkAlreadyRegisterd, err) <add> } <add>} <add> <add>func TestRequestNewIps(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> for i := 2; i < 10; i++ { <add> ip, err := RequestIP(network, nil) <add> if err != nil { <add> t.Fatal(err) <add> } <add> <add> if expected := fmt.Sprintf("192.168.0.%d", i); ip.String() != expected { <add> t.Fatalf("Expected ip %s got %s", expected, ip.String()) <add> } <add> } <add>} <add> <add>func TestReleaseIp(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> ip, err := RequestIP(network, nil) <add> if err != nil { <add> t.Fatal(err) <add> } <add> <add> if err := ReleaseIP(network, ip); err != nil { <add> t.Fatal(err) <add> } <add>} <add> <add>func TestGetReleasedIp(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> ip, err := RequestIP(network, nil) <add> if err != nil { <add> t.Fatal(err) <add> } <add> <add> value := ip.String() <add> if err := ReleaseIP(network, ip); err != nil { <add> t.Fatal(err) <add> } <add> <add> ip, err = RequestIP(network, nil) <add> if err != nil { <add> t.Fatal(err) <add> } <add> <add> if ip.String() != value { <add> t.Fatalf("Expected to receive same ip %s got %s", value, ip.String()) <add> } <add>} <add> <add>func TestRequesetSpecificIp(t *testing.T) { <add> defer reset() <add> network := &net.IPNet{ <add> IP: []byte{192, 168, 0, 1}, <add> Mask: []byte{255, 255, 255, 0}, <add> } <add> <add> if err := RegisterNetwork(network); err != nil { <add> t.Fatal(err) <add> } <add> <add> ip := net.ParseIP("192.168.1.5") <add> <add> if _, err := RequestIP(network, &ip); err != nil { <add> t.Fatal(err) <add> } <add>} <ide><path>networkdriver/portallocator/ipset.go <ide> func (s *iPSet) Remove(elem int) { <ide> } <ide> } <ide> } <del> <del>// Len returns the length of the list. <del>func (s *iPSet) Len() int { <del> return len(s.set) <del>}
3
Javascript
Javascript
fix textdecoder test for small-icu builds
e43ecd5fec309ffb78f214f2856cd9a8a94bb75c
<ide><path>test/parallel/test-whatwg-encoding-custom-textdecoder.js <ide> if (common.hasIntl) { <ide> } <ide> <ide> if (common.hasIntl) { <del> const decoder = new TextDecoder('Shift_JIS'); <del> const chunk = new Uint8Array([-1]); <del> const str = decoder.decode(chunk); <del> assert.strictEqual(str, '\ufffd'); <add> try { <add> const decoder = new TextDecoder('Shift_JIS'); <add> const chunk = new Uint8Array([-1]); <add> const str = decoder.decode(chunk); <add> assert.strictEqual(str, '\ufffd'); <add> } catch (e) { <add> // Encoding may not be available, e.g. small-icu builds <add> assert.strictEqual(e.code, 'ERR_ENCODING_NOT_SUPPORTED'); <add> } <ide> }
1
Text
Text
enforce omitting `name` and `version`
6aa9ef1955b16a5e2a9e624bfc7e61595f5cfc11
<ide><path>contributing.md <ide> When you add an example to the [examples](examples) directory, don’t forget to <ide> - Replace `DIRECTORY_NAME` with the directory name you’re adding. <ide> - Fill in `Example Name` and `Description`. <ide> - Examples should be TypeScript first, if possible. <del>- You don’t need to add `name` or `version` in your `package.json`. <add>- Omit the `name` and `version` fields from your `package.json`. <ide> - Ensure all your dependencies are up to date. <ide> - Ensure you’re using [`next/image`](https://nextjs.org/docs/api-reference/next/image). <ide> - To add additional installation instructions, please add it where appropriate.
1
Go
Go
check nil volume on mount init
7122b6643e4124db3d37b3b46f4741a97ba03611
<ide><path>daemon/volumes.go <ide> func (m *Mount) initialize() error { <ide> <ide> // Make sure we remove these old volumes we don't actually want now. <ide> // Ignore any errors here since this is just cleanup, maybe someone volumes-from'd this volume <del> v := m.container.daemon.volumes.Get(hostPath) <del> v.RemoveContainer(m.container.ID) <del> m.container.daemon.volumes.Delete(v.Path) <add> if v := m.container.daemon.volumes.Get(hostPath); v != nil { <add> v.RemoveContainer(m.container.ID) <add> m.container.daemon.volumes.Delete(v.Path) <add> } <ide> } <ide> <ide> // This is the full path to container fs + mntToPath
1
PHP
PHP
fix bug in db profiling
ab17ea674a24245053a9384b05f0b7981d8b7719
<ide><path>laravel/database/connection.php <ide> protected function log($sql, $bindings, $time) <ide> { <ide> Event::fire('laravel: query', array($sql, $bindings, $time)); <ide> <del> static::$queries = compact('sql', 'bindings', 'time'); <add> static::$queries[] = compact('sql', 'bindings', 'time'); <ide> } <ide> <ide> /**
1
Ruby
Ruby
terminate the backend ourselves on pg 9.2+
3b645fd3ed60c682b255bf31e7df08cfc6a37321
<ide><path>activerecord/test/cases/adapters/postgresql/connection_test.rb <ide> def test_statement_key_is_logged <ide> assert_operator plan.length, :>, 0 <ide> end <ide> <del> # Must have with_manual_interventions set to true for this <del> # test to run. <add> # Must have PostgreSQL >= 9.2, or with_manual_interventions set to <add> # true for this test to run. <add> # <ide> # When prompted, restart the PostgreSQL server with the <ide> # "-m fast" option or kill the individual connection assuming <ide> # you know the incantation to do that. <ide> # To restart PostgreSQL 9.1 on OS X, installed via MacPorts, ... <ide> # sudo su postgres -c "pg_ctl restart -D /opt/local/var/db/postgresql91/defaultdb/ -m fast" <del> if ARTest.config['with_manual_interventions'] <del> def test_reconnection_after_actual_disconnection_with_verify <del> original_connection_pid = @connection.query('select pg_backend_pid()') <add> def test_reconnection_after_actual_disconnection_with_verify <add> original_connection_pid = @connection.query('select pg_backend_pid()') <ide> <del> # Sanity check. <del> assert @connection.active? <add> # Sanity check. <add> assert @connection.active? <ide> <add> if @connection.send(:postgresql_version) >= 90200 <add> secondary_connection = ActiveRecord::Base.connection_pool.checkout <add> secondary_connection.query("select pg_terminate_backend(#{original_connection_pid.first.first})") <add> ActiveRecord::Base.connection_pool.checkin(secondary_connection) <add> elsif ARTest.config['with_manual_interventions'] <ide> puts 'Kill the connection now (e.g. by restarting the PostgreSQL ' + <ide> 'server with the "-m fast" option) and then press enter.' <ide> $stdin.gets <add> else <add> # We're not capable of terminating the backend ourselves, and <add> # we're not allowed to seek assistance; bail out without <add> # actually testing anything. <add> return <add> end <ide> <del> @connection.verify! <add> @connection.verify! <ide> <del> assert @connection.active? <add> assert @connection.active? <ide> <del> # If we get no exception here, then either we re-connected successfully, or <del> # we never actually got disconnected. <del> new_connection_pid = @connection.query('select pg_backend_pid()') <add> # If we get no exception here, then either we re-connected successfully, or <add> # we never actually got disconnected. <add> new_connection_pid = @connection.query('select pg_backend_pid()') <ide> <del> assert_not_equal original_connection_pid, new_connection_pid, <del> "umm -- looks like you didn't break the connection, because we're still " + <del> "successfully querying with the same connection pid." <add> assert_not_equal original_connection_pid, new_connection_pid, <add> "umm -- looks like you didn't break the connection, because we're still " + <add> "successfully querying with the same connection pid." <ide> <del> # Repair all fixture connections so other tests won't break. <del> @fixture_connections.each do |c| <del> c.verify! <del> end <add> # Repair all fixture connections so other tests won't break. <add> @fixture_connections.each do |c| <add> c.verify! <ide> end <ide> end <ide>
1
Go
Go
add debug to iptables
00f1398f7a8543e2448723635d93ea6ddf1eaadb
<ide><path>iptables/iptables.go <ide> import ( <ide> "errors" <ide> "fmt" <ide> "net" <add> "os" <ide> "os/exec" <ide> "strconv" <ide> "strings" <ide> func Raw(args ...string) ([]byte, error) { <ide> if err != nil { <ide> return nil, ErrIptablesNotFound <ide> } <add> if os.Getenv("DEBUG") != "" { <add> fmt.Printf("[DEBUG] [iptables]: %s, %v\n", path, args) <add> } <ide> output, err := exec.Command(path, args...).CombinedOutput() <ide> if err != nil { <ide> return nil, fmt.Errorf("iptables failed: iptables %v: %s (%s)", strings.Join(args, " "), output, err) <ide> } <ide> return output, err <del> <ide> }
1
Text
Text
add stackedarea chart type to community extensions
e69aa04918f0603555ee1b19a82516047a4ac6fc
<ide><path>docs/06-Advanced.md <ide> new Chart(ctx).LineAlt(data); <ide> ### Community extensions <ide> <ide> - <a href="https://github.com/Regaddi/Chart.StackedBar.js" target="_blank">Stacked Bar Chart</a> by <a href="https://twitter.com/Regaddi" target="_blank">@Regaddi</a> <add>- <a href="https://github.com/tannerlinsley/Chart.StackedArea.js" target="_blank">Stacked Bar Chart</a> by <a href="https://twitter.com/tannerlinsley" target="_blank">@tannerlinsley</a> <ide> - <a href="https://github.com/CAYdenberg/Chart.js" target="_blank">Error bars (bar and line charts)</a> by <a href="https://twitter.com/CAYdenberg" target="_blank">@CAYdenberg</a> <ide> - <a href="http://dima117.github.io/Chart.Scatter/" target="_blank">Scatter chart (number & date scales are supported)</a> by <a href="https://github.com/dima117" target="_blank">@dima117</a> <ide>
1
Text
Text
add css class to style an element details
45b24b1de12848fdd236bab4ef320386fd0da2aa
<ide><path>guide/english/certifications/responsive-web-design/basic-css/use-a-css-class-to-style-an-element/index.md <ide> title: Use a CSS Class to Style an Element <ide> --- <ide> ## Use a CSS Class to Style an Element <ide> <del>This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/responsive-web-design/basic-css/use-a-css-class-to-style-an-element/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>. <add><!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <ide> <del><a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>. <add>In CSS, we can target the styling of specific elements that match the specified class attribute. <ide> <del><!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <add>For example, if you have an element with a class of ```button```, then we can style the look & feel as follows: <add>* Start with a ```.``` (period) character followed by the class name and add your style <add> <add>```css <add>.button { <add> border: 2px solid black; <add> text-align: center; <add> display: inline-block; <add> padding: 5px 10px; <add>} <add>``` <add> <add>Now, the real benefit of using class to style an element is to target multiple elements that have the matching class attribute. For example, if there are 2 buttons on a webpage and they both look similar in style but only differ in size, then we can use a common class to give them common styles and a unique class for each button to give them different size values. <add> <add>The following HTML code snippet depicts 2 buttons: <add>* ```Sign up``` button that should have common button style + should be large in size <add>* ```Login``` button that should have common button style + should be small in size <add> <add>```html <add><div class="button large">Sign up</div> <add><div class="button small">Login</div> <add>``` <add> <add>Using the above defined ```.button``` class as a common style for both buttons, and using ```.large``` and ```.small``` class attributes to give them different sizes, we can achieve the look we want without duplicating our code. <add> <add>```css <add>.large { <add> font-size: 20px <add>} <add>``` <add> <add>```css <add>.small { <add> font-size: 10px <add>} <add>```
1
Python
Python
fix import issue
0588cb85b3c5037365432aab213d82b79a4bd25b
<ide><path>numpy/lib/tests/test_io.py <ide> import gzip <ide> import os <ide> <del>from tempfile import mkstemp <add>from tempfile import mkstemp, NamedTemporaryFile <ide> import sys, time <ide> from datetime import datetime <ide>
1
Javascript
Javascript
improve specs for `update` class
19d30c7dc955b557927571fbf60038fc446e4a6d
<ide><path>spec/update-spec.js <ide> 'use babel' <ide> <ide> import Update from '../src/update' <del>import remote from 'remote' <del>import ipc from 'ipc' <add>import {remote} from 'electron' <add>const electronAutoUpdater = remote.require('electron').autoUpdater <ide> <del>fdescribe('Update', () => { <add>describe('Update', () => { <ide> let update <ide> <del> afterEach(() => { <del> update.dispose() <del> }) <del> <del> describe('::initialize', () => { <del> it('subscribes to appropriate applicationDelegate events', () => { <del> update = new Update() <del> <del> const downloadingSpy = jasmine.createSpy('downloadingSpy') <del> const checkingSpy = jasmine.createSpy('checkingSpy') <del> const noUpdateSpy = jasmine.createSpy('noUpdateSpy') <del> const completedDownloadSpy = jasmine.createSpy('completedDownloadSpy') <del> <del> update.emitter.on('did-begin-checking-for-update', checkingSpy) <del> update.emitter.on('did-begin-downloading-update', downloadingSpy) <del> update.emitter.on('did-complete-downloading-update', completedDownloadSpy) <del> update.emitter.on('update-not-available', noUpdateSpy) <del> <del> update.initialize() <del> <del> const webContents = remote.getCurrentWebContents() <del> webContents.send('message', 'checking-for-update') <del> webContents.send('message', 'did-begin-downloading-update') <del> webContents.send('message', 'update-available', {releaseVersion: '1.2.3'}) <del> webContents.send('message', 'update-not-available') <del> <del> waitsFor(() => { <del> return noUpdateSpy.callCount > 0 <del> }) <del> <del> runs(() => { <del> expect(downloadingSpy.callCount).toBe(1) <del> expect(checkingSpy.callCount).toBe(1) <del> expect(noUpdateSpy.callCount).toBe(1) <del> expect(completedDownloadSpy.callCount).toBe(1) <del> }) <del> }) <del> }) <del> <ide> beforeEach(() => { <ide> update = new Update() <ide> update.initialize() <ide> }) <ide> <add> afterEach(() => { <add> update.dispose() <add> }) <add> <ide> describe('::onDidBeginCheckingForUpdate', () => { <ide> it('subscribes to "did-begin-checking-for-update" event', () => { <ide> const spy = jasmine.createSpy('spy') <ide> update.onDidBeginCheckingForUpdate(spy) <del> update.emitter.emit('did-begin-checking-for-update') <del> expect(spy.callCount).toBe(1) <add> electronAutoUpdater.emit('checking-for-update') <add> waitsFor(() => { <add> return spy.callCount === 1 <add> }) <ide> }) <ide> }) <ide> <ide> describe('::onDidBeginDownload', () => { <ide> it('subscribes to "did-begin-downloading-update" event', () => { <ide> const spy = jasmine.createSpy('spy') <ide> update.onDidBeginDownload(spy) <del> update.emitter.emit('did-begin-downloading-update') <del> expect(spy.callCount).toBe(1) <add> electronAutoUpdater.emit('update-available') <add> waitsFor(() => { <add> return spy.callCount === 1 <add> }) <ide> }) <ide> }) <ide> <ide> describe('::onDidCompleteDownload', () => { <ide> it('subscribes to "did-complete-downloading-update" event', () => { <ide> const spy = jasmine.createSpy('spy') <ide> update.onDidCompleteDownload(spy) <del> update.emitter.emit('did-complete-downloading-update') <del> expect(spy.callCount).toBe(1) <add> electronAutoUpdater.emit('update-downloaded', null, null, {releaseVersion: '1.2.3'}) <add> waitsFor(() => { <add> return spy.callCount === 1 <add> }) <ide> }) <ide> }) <ide> <ide> describe('::onUpdateNotAvailable', () => { <ide> it('subscribes to "update-not-available" event', () => { <ide> const spy = jasmine.createSpy('spy') <ide> update.onUpdateNotAvailable(spy) <del> update.emitter.emit('update-not-available') <del> expect(spy.callCount).toBe(1) <del> }) <del> }) <del> <del> describe('::onUpdateAvailable', () => { <del> it('subscribes to "update-available" event', () => { <del> const spy = jasmine.createSpy('spy') <del> update.onUpdateAvailable(spy) <del> update.emitter.emit('update-available') <del> expect(spy.callCount).toBe(1) <del> }) <del> }) <del> <del> // TODO: spec is timing out. spy is not called <del> // describe('::check', () => { <del> // it('sends "check-for-update" event', () => { <del> // const spy = jasmine.createSpy('spy') <del> // ipc.on('check-for-update', () => { <del> // spy() <del> // }) <del> // update.check() <del> // waitsFor(() => { <del> // return spy.callCount > 0 <del> // }) <del> // }) <del> // }) <del> <del> describe('::dispose', () => { <del> it('disposes of subscriptions', () => { <del> expect(update.subscriptions.disposables).not.toBeNull() <del> update.dispose() <del> expect(update.subscriptions.disposables).toBeNull() <add> electronAutoUpdater.emit('update-not-available') <add> waitsFor(() => { <add> return spy.callCount === 1 <add> }) <ide> }) <ide> }) <ide>
1
Javascript
Javascript
use rn fork in default branch of feature flags
a437f3ff302dc92347d812d518c9a9659d9aa546
<ide><path>scripts/rollup/forks.js <ide> const forks = Object.freeze({ <ide> return 'shared/forks/ReactFeatureFlags.testing.www.js'; <ide> } <ide> return 'shared/forks/ReactFeatureFlags.testing.js'; <del> case 'react': <add> default: <ide> switch (bundleType) { <ide> case FB_WWW_DEV: <ide> case FB_WWW_PROD: <ide> const forks = Object.freeze({ <ide> case RN_FB_PROD: <ide> case RN_FB_PROFILING: <ide> return 'shared/forks/ReactFeatureFlags.native-fb.js'; <del> default: <del> return 'shared/ReactFeatureFlags.js'; <del> } <del> default: <del> switch (bundleType) { <del> case FB_WWW_DEV: <del> case FB_WWW_PROD: <del> case FB_WWW_PROFILING: <del> return 'shared/forks/ReactFeatureFlags.www.js'; <ide> } <ide> } <ide> return null;
1
Javascript
Javascript
make test for function as param more explicit
f6c3b357451a2125550811946084fc25ae4eb0ce
<ide><path>src/ngResource/resource.js <ide> function shallowClearAndCopy(src, dst) { <ide> * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in <ide> * `actions` methods. If a parameter value is a function, it will be called every time <ide> * a param value needs to be obtained for a request (unless the param was overridden). The function <del> * will be passed the current data value as a argument. <add> * will be passed the current data value as an argument. <ide> * <ide> * Each key value in the parameter object is first bound to url template if present and then any <ide> * excess keys are appended to the url search query after the `?`. <ide> function shallowClearAndCopy(src, dst) { <ide> * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of <ide> * the parameter value is a function, it will be called every time when a param value needs to <ide> * be obtained for a request (unless the param was overridden). The function will be passed the <del> * current data value as a argument. <add> * current data value as an argument. <ide> * - **`url`** – {string} – action specific `url` override. The url templating is supported just <ide> * like for the resource-level urls. <ide> * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, <ide><path>test/ngResource/resourceSpec.js <ide> describe("basic usage", function() { <ide> <ide> expect(fedor).toEqualData({id: 'fedor', email: '[email protected]', count: 1}); <ide> <del> $httpBackend.expect('POST', '/Person/fedor').respond( <del> {id: 'fedor', email: '[email protected]', count: 2}); <add> $httpBackend.expect('POST', '/Person/fedor2').respond( <add> {id: 'fedor2', email: '[email protected]', count: 2}); <add> <add> fedor.id = 'fedor2'; <ide> fedor.$save(); <ide> $httpBackend.flush(); <del> expect(fedor).toEqualData({id: 'fedor', email: '[email protected]', count: 2}); <add> <add> expect(fedor).toEqualData({id: 'fedor2', email: '[email protected]', count: 2}); <ide> }); <ide> <ide>
2
PHP
PHP
add file headers
00724143b8d060b7f79f1377ff03ca132a38dfb5
<ide><path>Cake/Test/TestCase/View/StringTemplateTest.php <ide> <?php <del> <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @since CakePHP(tm) v3.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <ide> namespace Cake\Test\View; <ide> <ide> use Cake\Core\Plugin; <ide><path>Cake/View/StringTemplate.php <ide> <?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @since CakePHP(tm) v3.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <ide> namespace Cake\View; <ide> <ide> use Cake\Core\Plugin;
2
PHP
PHP
fix command output for seeder
6f522cbc05aaf23e242800bef5412d9c5a12ea47
<ide><path>src/Illuminate/Database/Seeder.php <ide> public function call($class) <ide> { <ide> $this->resolve($class)->run(); <ide> <del> $this->command->getOutput()->writeln("<info>Seeded:</info> $class"); <add> if ( ! is_null($this->command)) <add> { <add> $this->command->getOutput()->writeln("<info>Seeded:</info> $class"); <add> } <ide> } <ide> <ide> /** <ide><path>tests/Database/DatabaseSeederTest.php <ide> public function testCallResolveTheClassAndCallsRun() <ide> $seeder->call('ClassName'); <ide> } <ide> <add> public function testSetContainer() <add> { <add> $seeder = new Seeder; <add> $container = m::mock('Illuminate\Container\Container'); <add> $this->assertEquals($seeder->setContainer($container), $seeder); <add> } <add> <add> public function testSetCommand() <add> { <add> $seeder = new Seeder; <add> $command = m::mock('Illuminate\Console\Command'); <add> $this->assertEquals($seeder->setCommand($command), $seeder); <add> } <add> <ide> } <ide>\ No newline at end of file
2
Javascript
Javascript
log jsbundlerequiretime and jsapprequiretime
9fe36beec94f73dcd65aba2ea63dfed800a74663
<ide><path>Libraries/Utilities/PerformanceLogger.js <ide> var PerformanceLogger = { <ide> timespans[key].endTime - timespans[key].startTime; <ide> }, <ide> <del> clearTimespans() { <add> clear() { <ide> timespans = {}; <ide> extras = {}; <ide> }, <ide> <add> clearExceptTimespans(keys) { <add> timespans = Object.keys(timespans).reduce(function(previous, key) { <add> if (keys.indexOf(key) !== -1) { <add> previous[key] = timespans[key]; <add> } <add> return previous; <add> }, {}); <add> extras = {}; <add> }, <add> <ide> getTimespans() { <ide> return timespans; <ide> },
1
Ruby
Ruby
handle implicit rendering correctly
8301969df9fd76bcde140f310300349b609e2b10
<ide><path>actionpack/lib/action_dispatch/http/response.rb <ide> def charset=(charset) <ide> if false == charset <ide> set_header CONTENT_TYPE, header_info.mime_type <ide> else <del> content_type = header_info.mime_type || Mime::TEXT.to_s <add> content_type = header_info.mime_type <ide> set_content_type content_type, charset || self.class.default_charset <ide> end <ide> end <ide> def cookies <ide> def parse_content_type(content_type) <ide> if content_type <ide> type, charset = content_type.split(/;\s*charset=/) <add> type = nil if type.empty? <ide> ContentTypeHeader.new(type, charset) <ide> else <ide> ContentTypeHeader.new(nil, nil) <ide> end <ide> end <ide> <ide> def set_content_type(content_type, charset) <del> type = content_type.dup <add> type = (content_type || '').dup <ide> type << "; charset=#{charset}" if charset <ide> set_header CONTENT_TYPE, type <ide> end <ide> def munge_body_object(body) <ide> end <ide> <ide> def assign_default_content_type_and_charset! <del> return if get_header(CONTENT_TYPE).present? <add> return if content_type <ide> <ide> ct = parse_content_type get_header(CONTENT_TYPE) <ide> set_content_type(ct.mime_type || Mime::HTML.to_s,
1
Ruby
Ruby
remove dead test code for unsupported adapters
7ff9b334e1a3c194fb5354560d6f1c3282adcd1f
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb <ide> def drop_table(table_name, **options) <ide> # but the maximum supported <tt>:precision</tt> is 16. No default. <ide> # * Oracle: <tt>:precision</tt> [1..38], <tt>:scale</tt> [-84..127]. <ide> # Default is (38,0). <del> # * DB2: <tt>:precision</tt> [1..63], <tt>:scale</tt> [0..62]. <del> # Default unknown. <ide> # * SqlServer: <tt>:precision</tt> [1..38], <tt>:scale</tt> [0..38]. <ide> # Default (38,0). <ide> # <ide><path>activerecord/lib/active_record/migration.rb <ide> def initialize(current: nil, stored: nil) <ide> # If any of the migrations throw an <tt>ActiveRecord::IrreversibleMigration</tt> exception, <ide> # that step will fail and you'll have some manual work to do. <ide> # <del> # == Database support <del> # <del> # Migrations are currently supported in MySQL, PostgreSQL, SQLite, <del> # SQL Server, and Oracle (all supported databases except DB2). <del> # <ide> # == More examples <ide> # <ide> # Not all migrations change the schema. Some just fix the data: <ide><path>activerecord/test/cases/attribute_methods_test.rb <ide> def setup <ide> end <ide> <ide> test "case-sensitive attributes hash" do <del> # DB2 is not case-sensitive. <del> return true if current_adapter?(:DB2Adapter) <del> <ide> assert_equal @loaded_fixtures["computers"]["workstation"].to_hash, Computer.first.attributes <ide> end <ide> <ide> def topic.title() "b" end <ide> test "typecast attribute from select to false" do <ide> Topic.create(title: "Budget") <ide> # Oracle does not support boolean expressions in SELECT. <del> if current_adapter?(:OracleAdapter, :FbAdapter) <add> if current_adapter?(:OracleAdapter) <ide> topic = Topic.all.merge!(select: "topics.*, 0 as is_test").first <ide> else <ide> topic = Topic.all.merge!(select: "topics.*, 1=2 as is_test").first <ide> def topic.title() "b" end <ide> test "typecast attribute from select to true" do <ide> Topic.create(title: "Budget") <ide> # Oracle does not support boolean expressions in SELECT. <del> if current_adapter?(:OracleAdapter, :FbAdapter) <add> if current_adapter?(:OracleAdapter) <ide> topic = Topic.all.merge!(select: "topics.*, 1 as is_test").first <ide> else <ide> topic = Topic.all.merge!(select: "topics.*, 2=2 as is_test").first <ide><path>activerecord/test/cases/base_test.rb <ide> def test_column_names_are_escaped <ide> "Mysql2Adapter" => "`", <ide> "PostgreSQLAdapter" => '"', <ide> "OracleAdapter" => '"', <del> "FbAdapter" => '"' <ide> }.fetch(classname) { <ide> raise "need a bad char for #{classname}" <ide> } <ide><path>activerecord/test/cases/binary_test.rb <ide> # frozen_string_literal: true <ide> <ide> require "cases/helper" <add>require "models/binary" <ide> <del># Without using prepared statements, it makes no sense to test <del># BLOB data with DB2, because the length of a statement <del># is limited to 32KB. <del>unless current_adapter?(:DB2Adapter) <del> require "models/binary" <add>class BinaryTest < ActiveRecord::TestCase <add> FIXTURES = %w(flowers.jpg example.log test.txt) <ide> <del> class BinaryTest < ActiveRecord::TestCase <del> FIXTURES = %w(flowers.jpg example.log test.txt) <add> def test_mixed_encoding <add> str = +"\x80" <add> str.force_encoding("ASCII-8BIT") <ide> <del> def test_mixed_encoding <del> str = +"\x80" <del> str.force_encoding("ASCII-8BIT") <add> binary = Binary.new name: "いただきます!", data: str <add> binary.save! <add> binary.reload <add> assert_equal str, binary.data <ide> <del> binary = Binary.new name: "いただきます!", data: str <del> binary.save! <del> binary.reload <del> assert_equal str, binary.data <add> name = binary.name <ide> <del> name = binary.name <del> <del> assert_equal "いただきます!", name <del> end <add> assert_equal "いただきます!", name <add> end <ide> <del> def test_load_save <del> Binary.delete_all <add> def test_load_save <add> Binary.delete_all <ide> <del> FIXTURES.each do |filename| <del> data = File.read(ASSETS_ROOT + "/#{filename}") <del> data.force_encoding("ASCII-8BIT") <del> data.freeze <add> FIXTURES.each do |filename| <add> data = File.read(ASSETS_ROOT + "/#{filename}") <add> data.force_encoding("ASCII-8BIT") <add> data.freeze <ide> <del> bin = Binary.new(data: data) <del> assert_equal data, bin.data, "Newly assigned data differs from original" <add> bin = Binary.new(data: data) <add> assert_equal data, bin.data, "Newly assigned data differs from original" <ide> <del> bin.save! <del> assert_equal data, bin.data, "Data differs from original after save" <add> bin.save! <add> assert_equal data, bin.data, "Data differs from original after save" <ide> <del> assert_equal data, bin.reload.data, "Reloaded data differs from original" <del> end <add> assert_equal data, bin.reload.data, "Reloaded data differs from original" <ide> end <ide> end <ide> end <ide><path>activerecord/test/cases/migration/rename_table_test.rb <ide> def teardown <ide> super <ide> end <ide> <del> if current_adapter?(:SQLite3Adapter) <del> def test_rename_table_for_sqlite_should_work_with_reserved_words <add> unless current_adapter?(:OracleAdapter) <add> def test_rename_table_should_work_with_reserved_words <ide> renamed = false <ide> <ide> add_column :test_models, :url, :string <ide> def test_rename_table_for_sqlite_should_work_with_reserved_words <ide> end <ide> end <ide> <del> unless current_adapter?(:FbAdapter) # Firebird cannot rename tables <del> def test_rename_table <del> rename_table :test_models, :octopi <add> def test_rename_table <add> rename_table :test_models, :octopi <ide> <del> connection.execute "INSERT INTO octopi (#{connection.quote_column_name('id')}, #{connection.quote_column_name('url')}) VALUES (1, 'http://www.foreverflying.com/octopus-black7.jpg')" <add> connection.execute "INSERT INTO octopi (#{connection.quote_column_name('id')}, #{connection.quote_column_name('url')}) VALUES (1, 'http://www.foreverflying.com/octopus-black7.jpg')" <ide> <del> assert_equal "http://www.foreverflying.com/octopus-black7.jpg", connection.select_value("SELECT url FROM octopi WHERE id=1") <del> end <add> assert_equal "http://www.foreverflying.com/octopus-black7.jpg", connection.select_value("SELECT url FROM octopi WHERE id=1") <add> end <ide> <del> def test_rename_table_with_an_index <del> add_index :test_models, :url <add> def test_rename_table_with_an_index <add> add_index :test_models, :url <ide> <del> rename_table :test_models, :octopi <add> rename_table :test_models, :octopi <ide> <del> connection.execute "INSERT INTO octopi (#{connection.quote_column_name('id')}, #{connection.quote_column_name('url')}) VALUES (1, 'http://www.foreverflying.com/octopus-black7.jpg')" <add> connection.execute "INSERT INTO octopi (#{connection.quote_column_name('id')}, #{connection.quote_column_name('url')}) VALUES (1, 'http://www.foreverflying.com/octopus-black7.jpg')" <ide> <del> assert_equal "http://www.foreverflying.com/octopus-black7.jpg", connection.select_value("SELECT url FROM octopi WHERE id=1") <del> index = connection.indexes(:octopi).first <del> assert_includes index.columns, "url" <del> assert_equal "index_octopi_on_url", index.name <del> end <add> assert_equal "http://www.foreverflying.com/octopus-black7.jpg", connection.select_value("SELECT url FROM octopi WHERE id=1") <add> index = connection.indexes(:octopi).first <add> assert_includes index.columns, "url" <add> assert_equal "index_octopi_on_url", index.name <add> end <ide> <del> def test_rename_table_does_not_rename_custom_named_index <del> add_index :test_models, :url, name: "special_url_idx" <add> def test_rename_table_does_not_rename_custom_named_index <add> add_index :test_models, :url, name: "special_url_idx" <ide> <del> rename_table :test_models, :octopi <add> rename_table :test_models, :octopi <ide> <del> assert_equal ["special_url_idx"], connection.indexes(:octopi).map(&:name) <del> end <add> assert_equal ["special_url_idx"], connection.indexes(:octopi).map(&:name) <ide> end <ide> <ide> if current_adapter?(:PostgreSQLAdapter) <ide><path>activerecord/test/cases/schema_dumper_test.rb <ide> def test_schema_dump_keeps_large_precision_integer_columns_as_decimal <ide> # Oracle supports precision up to 38 and it identifies decimals with scale 0 as integers <ide> if current_adapter?(:OracleAdapter) <ide> assert_match %r{t\.integer\s+"atoms_in_universe",\s+precision: 38}, output <del> elsif current_adapter?(:FbAdapter) <del> assert_match %r{t\.integer\s+"atoms_in_universe",\s+precision: 18}, output <ide> else <ide> assert_match %r{t\.decimal\s+"atoms_in_universe",\s+precision: 55}, output <ide> end <ide><path>activerecord/test/schema/schema.rb <ide> # Oracle/SQLServer supports precision up to 38 <ide> if current_adapter?(:OracleAdapter, :SQLServerAdapter) <ide> t.decimal :atoms_in_universe, precision: 38, scale: 0 <del> elsif current_adapter?(:FbAdapter) <del> t.decimal :atoms_in_universe, precision: 18, scale: 0 <ide> else <ide> t.decimal :atoms_in_universe, precision: 55, scale: 0 <ide> end
8
Javascript
Javascript
move relay sources to unsigned directory
80e1ca870be5f70f923a9d3b1700d9ec45107966
<ide><path>packager/blacklist.js <ide> var sharedBlacklist = [ <ide> /website\/node_modules\/.*/, <ide> <ide> // TODO(jkassens, #9876132): Remove this rule when it's no longer needed. <del> 'downstream/relay/tools/relayUnstableBatchedUpdates.js', <add> 'Libraries/Relay/relay/tools/relayUnstableBatchedUpdates.js', <ide> ]; <ide> <ide> var platformBlacklists = {
1
PHP
PHP
add secure flag option for csrfcomponent
b516145f8093665737f7327f1e4efde49622c0c6
<ide><path>Cake/Controller/Component/CsrfComponent.php <ide> class CsrfComponent extends Component { <ide> * <ide> * - cookieName = The name of the cookie to send. <ide> * - expiry = How long the CSRF token should last. Defaults to browser session. <add> * - secure = Whether or not the cookie will be set with the Secure flag. Defaults to false. <ide> * - field = The form field to check. Changing this will also require configuring <ide> * FormHelper. <ide> * <ide> class CsrfComponent extends Component { <ide> public $settings = [ <ide> 'cookieName' => 'csrfToken', <ide> 'expiry' => 0, <add> 'secure' => false, <ide> 'field' => '_csrfToken', <ide> ]; <ide> <ide> protected function _setCookie(Request $request, Response $response) { <ide> 'value' => $value, <ide> 'expiry' => $settings['expiry'], <ide> 'path' => $request->base, <add> 'secure' => $settings['secure'], <ide> ]); <ide> } <ide> <ide><path>Cake/Test/TestCase/Controller/Component/CsrfComponentTest.php <ide> public function testConfigurationCookieCreate() { <ide> $component = new CsrfComponent($this->registry, [ <ide> 'cookieName' => 'token', <ide> 'expiry' => 90, <add> 'secure' => true <ide> ]); <ide> <ide> $event = new Event('Controller.startup', $controller); <ide> public function testConfigurationCookieCreate() { <ide> $this->assertRegExp('/^[a-f0-9]+$/', $cookie['value'], 'Should look like a hash.'); <ide> $this->assertEquals(90, $cookie['expiry'], 'session duration.'); <ide> $this->assertEquals('/dir', $cookie['path'], 'session path.'); <add> $this->assertTrue($cookie['secure'], 'cookie security flag missing'); <ide> } <ide> <ide> /**
2
PHP
PHP
(
95cc3f238f20c5dbc6d6ff8c6088b3b7bfc82452
<ide><path>tests/Redis/PhpRedisConnectionTest.php <ide> class RedisStub <ide> } <ide> <ide> class RedisClusterStub <del>{ <add>{ <ide> }
1