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
push 7th argument to new line
ed91b7ddaedcde80dcfda261d8f125fd1ee19c4f
<ide><path>src/Illuminate/Auth/Access/Gate.php <ide> public function forUser($user) <ide> <ide> return new static( <ide> $this->container, $callback, $this->abilities, <del> $this->policies, $this->beforeCallbacks, $this->afterCallbacks, $this->guessPolicyNamesUsingCallback <add> $this->policies, $this->beforeCallbacks, $this->afterCallbacks, <add> $this->guessPolicyNamesUsingCallback <ide> ); <ide> } <ide>
1
Python
Python
add test for issue 3209
bc300d4e3179da1575577e78d88ea1e5377e1b25
<ide><path>spacy/tests/regression/test_issue3209.py <add>'''Test that labels are mapped to classes consistently when loading NER model.''' <add>from __future__ import unicode_literals <add>from spacy.lang.en import English <add> <add>def test_issue3209(): <add> '''Test issue that occurred in spaCy nightly where NER labels were being <add> mapped to classes incorrectly after loading the model, when the labels <add> were added using ner.add_label(). <add> ''' <add> nlp = English() <add> ner = nlp.create_pipe('ner') <add> nlp.add_pipe(ner) <add> <add> ner.add_label('ANIMAL') <add> nlp.begin_training() <add> move_names = ['O', 'B-ANIMAL', 'I-ANIMAL', 'L-ANIMAL', 'U-ANIMAL'] <add> assert ner.move_names == move_names <add> nlp2 = English() <add> nlp2.add_pipe(nlp2.create_pipe('ner')) <add> nlp2.from_bytes(nlp.to_bytes()) <add> assert nlp2.get_pipe('ner').move_names == move_names <add>
1
Javascript
Javascript
handle rejections to avoid uncaught rejections
0b54e0047598e255bcbb7e3aff23c26d7382c54d
<ide><path>packages/react-server-dom-webpack/src/ReactFlightClientWebpackBundlerConfig.js <ide> export function resolveModuleReference<T>( <ide> const chunkCache: Map<string, null | Promise<any>> = new Map(); <ide> const asyncModuleCache: Map<string, Thenable<any>> = new Map(); <ide> <add>function ignoreReject() { <add> // We rely on rejected promises to be handled by another listener. <add>} <ide> // Start preloading the modules since we might need them soon. <ide> // This function doesn't suspend. <ide> export function preloadModule<T>( <ide> export function preloadModule<T>( <ide> const thenable = __webpack_chunk_load__(chunkId); <ide> promises.push(thenable); <ide> const resolve = chunkCache.set.bind(chunkCache, chunkId, null); <del> thenable.then(resolve); <add> thenable.then(resolve, ignoreReject); <ide> chunkCache.set(chunkId, thenable); <ide> } else if (entry !== null) { <ide> promises.push(entry);
1
PHP
PHP
fix errors in sqlserver 2008
39fef4c4148d758e71f02fa9b171e1d36abf9696
<ide><path>src/Database/QueryCompiler.php <ide> protected function _stringifyExpressions($expressions, $generator) <ide> $result = []; <ide> foreach ($expressions as $k => $expression) { <ide> if ($expression instanceof ExpressionInterface) { <del> $expression = '(' . $expression->sql($generator) . ')'; <add> $value = $expression->sql($generator); <add> if (!is_string($value)) { <add> debug($expression); <add> } <add> $expression = '(' . $value . ')'; <ide> } <ide> $result[$k] = $expression; <ide> } <ide><path>src/ORM/Association/SelectableAssociationTrait.php <ide> */ <ide> namespace Cake\ORM\Association; <ide> <add>use Cake\Database\ExpressionInterface; <ide> use Cake\Database\Expression\IdentifierExpression; <ide> use Cake\Database\Expression\TupleComparison; <ide> <ide> protected function _buildSubquery($query) <ide> $order = $filterQuery->clause('order'); <ide> if ($order) { <ide> $order->iterateParts(function ($dir, $field) use ($filterQuery) { <del> $filterQuery->select(new IdentifierExpression(is_int($field) ? $dir : $field)); <add> $col = is_int($field) ? $dir : $field; <add> if (!($col instanceof ExpressionInterface)) { <add> $filterQuery->select(new IdentifierExpression($col)); <add> } <ide> return $dir; <ide> }); <ide> }
2
Text
Text
fix typo for docker swarm description
eb4b965ddbe0c351df45dfd81b32c08c7194d804
<ide><path>docs/swarm/how-swarm-mode-works/services.md <ide> The underlying logic of Docker swarm mode is a general purpose scheduler and <ide> orchestrator. The service and task abstractions themselves are unaware of the <ide> containers they implement. Hypothetically, you could implement other types of <ide> tasks such as virtual machine tasks or non-containerized process tasks. The <del>scheduler and orchestrator are agnostic about they type of task. However, the <add>scheduler and orchestrator are agnostic about their type of task. However, the <ide> current version of Docker only supports container tasks. <ide> <ide> The diagram below shows how swarm mode accepts service create requests and
1
PHP
PHP
fix cluster connecting
2bcb405ddc9ed69355513de5f2396dc658fd004d
<ide><path>src/Illuminate/Redis/RedisManager.php <ide> public function resolve($name = null) <ide> protected function resolveCluster($name) <ide> { <ide> return $this->connector()->connectToCluster( <del> $this->parseConnectionConfiguration($this->config['clusters'][$name]), <add> array_map(function ($config) { <add> return $this->parseConnectionConfiguration($config); <add> }, $this->config['clusters'][$name]), <ide> $this->config['clusters']['options'] ?? [], <ide> $this->config['options'] ?? [] <ide> );
1
Java
Java
allow late binding servletcontextawareprocessor
e9a2e688cbc6321ed40b2b468501642877080681
<ide><path>spring-web/src/main/java/org/springframework/web/context/support/ServletContextAwareProcessor.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2013 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> * underlying bean factory. Applications do not use this directly. <ide> * <ide> * @author Juergen Hoeller <add> * @author Phillip Webb <ide> * @since 12.03.2004 <ide> * @see org.springframework.web.context.ServletContextAware <ide> * @see org.springframework.web.context.support.XmlWebApplicationContext#postProcessBeanFactory <ide> public class ServletContextAwareProcessor implements BeanPostProcessor { <ide> private ServletConfig servletConfig; <ide> <ide> <add> /** <add> * Create a new ServletContextAwareProcessor without an initial context or config. <add> * When this constructor is used the {@link #getServletContext()} and/or <add> * {@link #getServletConfig()} methods should be overriden. <add> */ <add> protected ServletContextAwareProcessor() { <add> } <add> <ide> /** <ide> * Create a new ServletContextAwareProcessor for the given context. <ide> */ <ide> public ServletContextAwareProcessor(ServletConfig servletConfig) { <ide> public ServletContextAwareProcessor(ServletContext servletContext, ServletConfig servletConfig) { <ide> this.servletContext = servletContext; <ide> this.servletConfig = servletConfig; <del> if (servletContext == null && servletConfig != null) { <del> this.servletContext = servletConfig.getServletContext(); <add> } <add> <add> <add> /** <add> * Returns the {@link ServletContext} to be injected or {@code null}. This method <add> * can be overridden by subclasses when a context is obtained after the post-processor <add> * has been registered. <add> */ <add> protected ServletContext getServletContext() { <add> if(this.servletContext == null && getServletConfig() != null) { <add> return getServletConfig().getServletContext(); <ide> } <add> return this.servletContext; <ide> } <ide> <add> /** <add> * Returns the {@link ServletContext} to be injected or {@code null}. This method <add> * can be overridden by subclasses when a context is obtained after the post-processor <add> * has been registered. <add> */ <add> protected ServletConfig getServletConfig() { <add> return this.servletConfig; <add> } <ide> <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <del> if (this.servletContext != null && bean instanceof ServletContextAware) { <del> ((ServletContextAware) bean).setServletContext(this.servletContext); <add> if (getServletContext() != null && bean instanceof ServletContextAware) { <add> ((ServletContextAware) bean).setServletContext(getServletContext()); <ide> } <del> if (this.servletConfig != null && bean instanceof ServletConfigAware) { <del> ((ServletConfigAware) bean).setServletConfig(this.servletConfig); <add> if (getServletConfig() != null && bean instanceof ServletConfigAware) { <add> ((ServletConfigAware) bean).setServletConfig(getServletConfig()); <ide> } <ide> return bean; <ide> }
1
Javascript
Javascript
add filter ability to platform test result view
54f03817e0cfcbc508d0451ab93dc8a3f99638af
<ide><path>packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js <ide> import type { <ide> } from './RNTesterPlatformTestTypes'; <ide> <ide> import * as React from 'react'; <del>import {useMemo} from 'react'; <del>import {Button, View, Text, StyleSheet, FlatList} from 'react-native'; <add>import {useMemo, useState, useCallback} from 'react'; <add>import { <add> Button, <add> View, <add> Text, <add> StyleSheet, <add> FlatList, <add> Modal, <add> SafeAreaView, <add> TextInput, <add> KeyboardAvoidingView, <add> Platform, <add>} from 'react-native'; <ide> <ide> const DISPLAY_STATUS_MAPPING: {[PlatformTestResultStatus]: string} = { <ide> PASS: 'Pass', <ide> FAIL: 'Fail', <ide> ERROR: 'Error', <ide> }; <ide> <add>type FilterModalProps = $ReadOnly<{ <add> filterText: string, <add> setFilterText: (newFilterText: string) => void, <add>}>; <add>function FilterModalButton(props: FilterModalProps) { <add> const {filterText, setFilterText} = props; <add> <add> const [modalVisible, setModalVisible] = useState(false); <add> const [pendingFilterText, setPendingFilterText] = useState(filterText); <add> <add> const onFilterButtonPress = useCallback(() => { <add> setPendingFilterText(filterText); <add> setModalVisible(true); <add> }, [filterText]); <add> <add> const onFilterSubmit = useCallback(() => { <add> setFilterText(pendingFilterText); <add> setModalVisible(false); <add> }, [pendingFilterText, setFilterText]); <add> <add> const onFilterCancel = useCallback(() => { <add> setModalVisible(false); <add> }, []); <add> <add> const onPendingTextChange = useCallback(newText => { <add> setPendingFilterText(newText); <add> }, []); <add> <add> return ( <add> <> <add> <Button title="Filter" onPress={onFilterButtonPress} /> <add> <Modal <add> visible={modalVisible} <add> animationType="fade" <add> presentationStyle="overFullScreen" <add> transparent={true}> <add> <SafeAreaView style={styles.filterModalRoot}> <add> <KeyboardAvoidingView <add> style={styles.filterModalKeboardAvoidingRoot} <add> behavior={Platform.OS === 'ios' ? 'padding' : 'height'}> <add> <View style={styles.filterModalContainer}> <add> <View style={styles.filterModalContentContainer}> <add> <View style={styles.filterModalPromptContainer}> <add> <Text style={styles.filterModalPromptText}> <add> Enter a test name filter <add> </Text> <add> </View> <add> <TextInput <add> autoCapitalize="none" <add> autoCorrect={false} <add> autoFocus={true} <add> style={styles.filterModalPendingTextInput} <add> value={pendingFilterText} <add> onChangeText={onPendingTextChange} <add> onSubmitEditing={onFilterSubmit} <add> /> <add> </View> <add> <View style={styles.filterModalActionsContainer}> <add> <Button title="Cancel" onPress={onFilterCancel} /> <add> <Button title="Submit" onPress={onFilterSubmit} /> <add> </View> <add> </View> <add> </KeyboardAvoidingView> <add> </SafeAreaView> <add> </Modal> <add> </> <add> ); <add>} <add> <ide> function TableHeader() { <ide> return ( <ide> <View style={styles.tableRow}> <ide> export default function RNTesterPlatformTestResultView( <ide> ): React.MixedElement { <ide> const {numPending, reset, results, style} = props; <ide> <add> const [filterText, setFilterText] = useState(''); <add> <add> const filteredResults = useMemo(() => { <add> if (filterText === '') { <add> return results; <add> } <add> return results.filter(result => <add> result.name.toLowerCase().includes(filterText.toLowerCase()), <add> ); <add> }, [filterText, results]); <add> <ide> const {numPass, numFail, numError} = useMemo( <ide> () => <del> results.reduce( <add> filteredResults.reduce( <ide> (acc, result) => { <ide> switch (result.status) { <ide> case 'PASS': <ide> export default function RNTesterPlatformTestResultView( <ide> numError: 0, <ide> }, <ide> ), <del> [results], <add> [filteredResults], <ide> ); <ide> <add> const handleReset = useCallback(() => { <add> setFilterText(''); <add> reset(); <add> }, [reset]); <add> <ide> return ( <ide> <View style={style}> <ide> <View style={styles.titleContainer}> <del> <Text style={styles.title}>Results</Text> <del> <Button title="Reset" onPress={reset} /> <add> <Text style={styles.title}> <add> Results <add> {filterText !== '' ? ( <add> <> <add> {' '} <add> <Text style={styles.filteredText}> <add> (Filtered: '{filterText}') <add> </Text> <add> </> <add> ) : null} <add> </Text> <add> <View style={styles.actionsContainer}> <add> <FilterModalButton <add> filterText={filterText} <add> setFilterText={setFilterText} <add> /> <add> <View style={styles.buttonSpacer} /> <add> <Button title="Reset" onPress={handleReset} /> <add> </View> <ide> </View> <ide> <ide> <Text style={styles.summaryContainer}> <ide> export default function RNTesterPlatformTestResultView( <ide> <ide> <View style={styles.table}> <ide> <TableHeader /> <del> <FlatList data={results} renderItem={renderTableRow} /> <add> <FlatList data={filteredResults} renderItem={renderTableRow} /> <ide> </View> <ide> </View> <ide> ); <ide> } <ide> <ide> const styles = StyleSheet.create({ <add> actionsContainer: { <add> flexDirection: 'row', <add> }, <add> buttonSpacer: { <add> width: 8, <add> }, <ide> errorText: { <ide> color: 'orange', <ide> }, <ide> failText: { <ide> color: 'red', <ide> }, <add> filteredText: { <add> fontSize: 18, <add> fontWeight: 'normal', <add> opacity: 0.5, <add> }, <add> filterModalActionButton: { <add> flex: 1, <add> }, <add> filterModalActionsContainer: { <add> flexDirection: 'row', <add> alignItems: 'center', <add> justifyContent: 'space-around', <add> minHeight: 50, <add> }, <add> filterModalContainer: { <add> minWidth: 250, <add> backgroundColor: 'white', <add> borderRadius: 20, <add> shadowColor: '#000', <add> shadowOffset: { <add> width: 0, <add> height: 2, <add> }, <add> shadowOpacity: 0.25, <add> shadowRadius: 4, <add> elevation: 5, <add> }, <add> filterModalContentContainer: { <add> paddingHorizontal: 12, <add> }, <add> filterModalPromptContainer: { <add> alignItems: 'center', <add> justifyContent: 'center', <add> }, <add> filterModalRoot: { <add> flex: 1, <add> justifyContent: 'center', <add> alignItems: 'stretch', <add> backgroundColor: 'rgba(0, 0, 0, 0.2)', <add> }, <add> filterModalPromptText: { <add> paddingVertical: 12, <add> fontSize: 16, <add> }, <add> filterModalPendingTextInput: { <add> // height: 40, <add> padding: 6, <add> backgroundColor: 'white', <add> borderWidth: StyleSheet.hairlineWidth, <add> borderColor: 'rgb(171, 171, 171)', <add> borderRadius: 8, <add> }, <add> filterModalKeboardAvoidingRoot: { <add> flex: 1, <add> alignItems: 'center', <add> justifyContent: 'center', <add> }, <ide> passText: { <ide> color: 'green', <ide> }, <ide> const styles = StyleSheet.create({ <ide> }, <ide> titleContainer: { <ide> flexDirection: 'row', <del> alignItems: 'center', <add> alignItems: 'flex-end', <ide> justifyContent: 'space-between', <ide> }, <ide> });
1
Text
Text
fix example of explicit format url (for real)
2484dbf4e15e2156079b4bcd447b17258649e67f
<ide><path>docs/tutorial/2-requests-and-responses.md <ide> See the [browsable api][browsable-api] topic for more information about the brow <ide> <ide> In [tutorial part 3][tut-3], we'll start using class based views, and see how generic views reduce the amount of code we need to write. <ide> <del>[json-url]: http://example.com/api/items/4.json <add>[json-url]: http://example.com/api/items/4/.json <ide> [devserver]: http://127.0.0.1:8000/snippets/ <ide> [browsable-api]: ../topics/browsable-api.md <ide> [tut-1]: 1-serialization.md
1
Javascript
Javascript
initialize pdfview.url = ''
bb13fb939ee89fecc53d7ab1714ef0f465075238
<ide><path>web/viewer.js <ide> var PDFView = { <ide> isViewerEmbedded: (window.parent !== window), <ide> idleTimeout: null, <ide> currentPosition: null, <add> url: '', <ide> <ide> // called once when the document is loaded <ide> initialize: function pdfViewInitialize() {
1
Go
Go
initialize portmapper in requestport too
584180fce7ad11516a256b8abd4621138337e918
<ide><path>daemon/networkdriver/bridge/driver.go <ide> var ( <ide> bridgeIPv6Addr net.IP <ide> globalIPv6Network *net.IPNet <ide> portMapper *portmapper.PortMapper <add> once sync.Once <ide> <ide> defaultBindingIP = net.ParseIP("0.0.0.0") <ide> currentInterfaces = ifaces{c: make(map[string]*networkInterface)} <ide> ipAllocator = ipallocator.New() <ide> ) <ide> <add>func initPortMapper() { <add> once.Do(func() { <add> portMapper = portmapper.New() <add> }) <add>} <add> <ide> func InitDriver(job *engine.Job) error { <ide> var ( <ide> networkv4 *net.IPNet <ide> func InitDriver(job *engine.Job) error { <ide> fixedCIDR = job.Getenv("FixedCIDR") <ide> fixedCIDRv6 = job.Getenv("FixedCIDRv6") <ide> ) <del> portMapper = portmapper.New() <add> initPortMapper() <ide> <ide> if defaultIP := job.Getenv("DefaultBindingIP"); defaultIP != "" { <ide> defaultBindingIP = net.ParseIP(defaultIP) <ide> func setupIPTables(addr net.Addr, icc, ipmasq bool) error { <ide> } <ide> <ide> func RequestPort(ip net.IP, proto string, port int) (int, error) { <add> initPortMapper() <ide> return portMapper.Allocator.RequestPort(ip, proto, port) <ide> } <ide>
1
PHP
PHP
fix sqlserver reflection of varbinary(max)
7adc0cfc66cd978d9b924e839177bd570dd7cb70
<ide><path>src/Database/Schema/SqlserverSchema.php <ide> protected function _convertColumn($col, $length = null, $precision = null, $scal <ide> } <ide> <ide> if ($col === 'image' || strpos($col, 'binary') !== false) { <add> // -1 is the value for MAX which we treat as a 'long' binary <add> if ($length == -1) { <add> $length = TableSchema::LENGTH_LONG; <add> } <ide> return ['type' => TableSchema::TYPE_BINARY, 'length' => $length]; <ide> } <ide> <ide><path>tests/TestCase/Database/Schema/SqlserverSchemaTest.php <ide> public static function convertColumnProvider() <ide> null, <ide> ['type' => 'binary', 'length' => 30] <ide> ], <add> [ <add> 'VARBINARY', <add> -1, <add> null, <add> null, <add> ['type' => 'binary', 'length' => TableSchema::LENGTH_LONG] <add> ], <ide> ]; <ide> } <ide>
2
PHP
PHP
improve doc blocks
c8f40e4c6a27292c2195654b51f3e2c7631bb83d
<ide><path>src/Database/Dialect/SqlserverDialectTrait.php <ide> use Cake\Database\SqlserverCompiler; <ide> <ide> /** <del> * Contains functions that encapsulates the SQL dialect used by MySQL, <add> * Contains functions that encapsulates the SQL dialect used by SQLServer, <ide> * including query translators and schema introspection. <ide> */ <ide> trait SqlserverDialectTrait { <ide> trait SqlserverDialectTrait { <ide> use TupleComparisonTranslatorTrait; <ide> <ide> /** <del> * String used to start a database identifier quoting to make it safe <add> * String used to start a database identifier quoting to make it safe <ide> * <ide> * @var string <ide> */ <ide> protected function _selectQueryTranslator($query) { <ide> } <ide> <ide> /** <del> * Returns an dictionary of expressions to be transformed when compiling a Query <add> * Returns a dictionary of expressions to be transformed when compiling a Query <ide> * to SQL. Array keys are method names to be called in this class <ide> * <ide> * @return array <ide><path>src/Database/Driver.php <ide> public function autoQuoting($enable = null) { <ide> * Transforms the passed query to this Driver's dialect and returns an instance <ide> * of the transformed query and the full compiled SQL string <ide> * <add> * @param \Cake\Database\Query $query The query to compile. <add> * @param \Cake\Database\ValueBinder $generator The value binder to use. <ide> * @return array containing 2 entries. The first enty is the transformed query <ide> * and the secod one the compiled SQL <ide> */
2
Python
Python
log backend type to stderr
83aaadaa9d69214880d20b1e2bd9715a6c37fbe6
<ide><path>keras/backend/__init__.py <ide> from __future__ import print_function <ide> import os <ide> import json <add>import sys <ide> from .common import epsilon, floatx, set_epsilon, set_floatx <ide> <ide> _keras_base_dir = os.path.expanduser('~') <ide> _BACKEND = _backend <ide> <ide> if _BACKEND == 'theano': <del> print('Using Theano backend.') <add> sys.stderr.write('Using Theano backend.\n') <ide> from .theano_backend import * <ide> elif _BACKEND == 'tensorflow': <del> print('Using TensorFlow backend.') <add> sys.stderr.write('Using TensorFlow backend.\n') <ide> from .tensorflow_backend import * <ide> else: <ide> raise Exception('Unknown backend: ' + str(_BACKEND))
1
Text
Text
add tests for metric-imperial-converter (infosec)
81479ffd40251584b368d1b87dc089b6b9288955
<ide><path>curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.english.md <ide> tests: <ide> testString: '' <ide> - text: 'I can GET /api/convert with a single parameter containing an accepted number and unit and have it converted. (Hint: Split the input by looking for the index of the first character which will mark the start of the unit)' <ide> testString: '' <del> - text: I can convert 'gal' to 'L' and vice versa. (1 gal to 3.78541 L) <del> testString: '' <del> - text: I can convert 'lbs' to 'kg' and vice versa. (1 lbs to 0.453592 kg) <del> testString: '' <del> - text: I can convert 'mi' to 'km' and vice versa. (1 mi to 1.60934 km) <del> testString: '' <del> - text: If my unit of measurement is invalid, returned will be 'invalid unit'. <del> testString: '' <add> - text: I can convert <code>'gal'</code> to <code>'L'</code> and vice versa. (1 gal to 3.78541 L) <add> testString: "async getUserInput => { <add> try { <add> const data1 = await $.get(getUserInput('url') + '/api/convert?input=1gal'); <add> assert.equal(data1.returnNum, 3.78541); <add> assert.equal(data1.returnUnit, 'l'); <add> const data2 = await $.get(getUserInput('url') + '/api/convert?input=10gal'); <add> assert.equal(data2.returnNum, 37.8541); <add> assert.equal(data2.returnUnit, 'l'); <add> const data3 = await $.get(getUserInput('url') + '/api/convert?input=1l'); <add> assert.equal(data3.returnNum, 0.26417); <add> assert.equal(data3.returnUnit, 'gal'); <add> const data4 = await $.get(getUserInput('url') + '/api/convert?input=10l'); <add> assert.equal(data4.returnNum, 2.64172); <add> assert.equal(data4.returnUnit, 'gal'); <add> } catch(xhr) { <add> throw new Error(xhr.responseText); <add> } <add> } <add> " <add> - text: I can convert <code>'lbs'</code> to <code>'kg'</code> and vice versa. (1 lbs to 0.453592 kg) <add> testString: "async getUserInput => { <add> try { <add> const data1 = await $.get(getUserInput('url') + '/api/convert?input=1lbs'); <add> assert.equal(data1.returnNum, 0.45359); <add> assert.equal(data1.returnUnit, 'kg'); <add> const data2 = await $.get(getUserInput('url') + '/api/convert?input=10lbs'); <add> assert.equal(data2.returnNum, 4.53592); <add> assert.equal(data2.returnUnit, 'kg'); <add> const data3 = await $.get(getUserInput('url') + '/api/convert?input=1kg'); <add> assert.equal(data3.returnNum, 2.20462); <add> assert.equal(data3.returnUnit, 'lbs'); <add> const data4 = await $.get(getUserInput('url') + '/api/convert?input=10kg'); <add> assert.equal(data4.returnNum, 22.04624); <add> assert.equal(data4.returnUnit, 'lbs'); <add> } catch(xhr) { <add> throw new Error(xhr.responseText); <add> } <add> } <add> " <add> - text: I can convert <code>'mi'</code> to <code>'km'</code> and vice versa. (1 mi to 1.60934 km) <add> testString: "async getUserInput => { <add> try { <add> const data1 = await $.get(getUserInput('url') + '/api/convert?input=1mi'); <add> assert.equal(data1.returnNum, 1.60934); <add> assert.equal(data1.returnUnit, 'km'); <add> const data2 = await $.get(getUserInput('url') + '/api/convert?input=10mi'); <add> assert.equal(data2.returnNum, 16.0934); <add> assert.equal(data2.returnUnit, 'km'); <add> const data3 = await $.get(getUserInput('url') + '/api/convert?input=1km'); <add> assert.equal(data3.returnNum, 0.62137); <add> assert.equal(data3.returnUnit, 'mi'); <add> const data4 = await $.get(getUserInput('url') + '/api/convert?input=10km'); <add> assert.equal(data4.returnNum, 6.21373); <add> assert.equal(data4.returnUnit, 'mi'); <add> } catch(xhr) { <add> throw new Error(xhr.responseText); <add> } <add> } <add> " <add> - text: If my unit of measurement is invalid, returned will be <code>'invalid unit'</code>. <add> testString: "async getUserInput => { <add> try { <add> const data = await $.get(getUserInput('url') + '/api/convert?input=1min'); <add> assert(data.initUnit === 'invalid unit' || data === 'invalid unit'); <add> } catch(xhr) { <add> throw new Error(xhr.responseText); <add> } <add> } <add> " <ide> - text: If my number is invalid, returned with will 'invalid number'. <ide> testString: '' <ide> - text: If both are invalid, return will be 'invalid number and unit'.
1
Text
Text
add readme to persona example
1ba6c2248d0a2d7a191c6b3b9a9a92c10c688236
<ide><path>examples/persona/README.md <add>A simple example for integrating [Persona](https://login.persona.org/) into a <add>Flask application. In addition to Flask, it requires the <add>[requests](www.python-requests.org/) library.
1
Go
Go
use subtests for testnetworkinspect
4045c4ceafde1512ea96979ec660a1549db9b986
<ide><path>client/network_inspect_test.go <ide> import ( <ide> "bytes" <ide> "context" <ide> "encoding/json" <del> "fmt" <add> "errors" <ide> "io" <ide> "net/http" <ide> "strings" <ide> import ( <ide> "github.com/docker/docker/api/types" <ide> "github.com/docker/docker/api/types/network" <ide> "github.com/docker/docker/errdefs" <del> "github.com/pkg/errors" <ide> "gotest.tools/v3/assert" <ide> is "gotest.tools/v3/assert/cmp" <ide> ) <ide> <del>func TestNetworkInspectError(t *testing.T) { <del> client := &Client{ <del> client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")), <del> } <del> <del> _, err := client.NetworkInspect(context.Background(), "nothing", types.NetworkInspectOptions{}) <del> if !errdefs.IsSystem(err) { <del> t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err) <del> } <del>} <del> <del>func TestNetworkInspectNotFoundError(t *testing.T) { <del> client := &Client{ <del> client: newMockClient(errorMock(http.StatusNotFound, "missing")), <del> } <del> <del> _, err := client.NetworkInspect(context.Background(), "unknown", types.NetworkInspectOptions{}) <del> assert.Check(t, is.Error(err, "Error: No such network: unknown")) <del> assert.Check(t, IsErrNotFound(err)) <del>} <del> <del>func TestNetworkInspectWithEmptyID(t *testing.T) { <del> client := &Client{ <del> client: newMockClient(func(req *http.Request) (*http.Response, error) { <del> return nil, errors.New("should not make request") <del> }), <del> } <del> _, _, err := client.NetworkInspectWithRaw(context.Background(), "", types.NetworkInspectOptions{}) <del> if !IsErrNotFound(err) { <del> t.Fatalf("Expected NotFoundError, got %v", err) <del> } <del>} <del> <ide> func TestNetworkInspect(t *testing.T) { <del> expectedURL := "/networks/network_id" <ide> client := &Client{ <ide> client: newMockClient(func(req *http.Request) (*http.Response, error) { <del> if !strings.HasPrefix(req.URL.Path, expectedURL) { <del> return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL) <del> } <ide> if req.Method != http.MethodGet { <del> return nil, fmt.Errorf("expected GET method, got %s", req.Method) <add> return nil, errors.New("expected GET method, got " + req.Method) <add> } <add> if req.URL.Path == "/networks/" { <add> return errorMock(http.StatusInternalServerError, "client should not make a request for empty IDs")(req) <add> } <add> if strings.HasPrefix(req.URL.Path, "/networks/unknown") { <add> return errorMock(http.StatusNotFound, "Error: No such network: unknown")(req) <add> } <add> if strings.HasPrefix(req.URL.Path, "/networks/test-500-response") { <add> return errorMock(http.StatusInternalServerError, "Server error")(req) <add> } <add> // other test-cases all use "network_id" <add> if !strings.HasPrefix(req.URL.Path, "/networks/network_id") { <add> return nil, errors.New("expected URL '/networks/network_id', got " + req.URL.Path) <add> } <add> if strings.Contains(req.URL.RawQuery, "scope=global") { <add> return errorMock(http.StatusNotFound, "Error: No such network: unknown")(req) <ide> } <del> <ide> var ( <ide> content []byte <ide> err error <ide> ) <del> if strings.Contains(req.URL.RawQuery, "scope=global") { <del> return &http.Response{ <del> StatusCode: http.StatusNotFound, <del> Body: io.NopCloser(bytes.NewReader(content)), <del> }, nil <del> } <del> <ide> if strings.Contains(req.URL.RawQuery, "verbose=true") { <ide> s := map[string]network.ServiceInfo{ <ide> "web": {}, <ide> func TestNetworkInspect(t *testing.T) { <ide> return nil, err <ide> } <ide> return &http.Response{ <add> Header: http.Header{"Content-Type": []string{"application/json"}}, <ide> StatusCode: http.StatusOK, <ide> Body: io.NopCloser(bytes.NewReader(content)), <ide> }, nil <ide> }), <ide> } <ide> <del> r, err := client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{}) <del> if err != nil { <del> t.Fatal(err) <del> } <del> if r.Name != "mynetwork" { <del> t.Fatalf("expected `mynetwork`, got %s", r.Name) <del> } <del> <del> r, err = client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{Verbose: true}) <del> if err != nil { <del> t.Fatal(err) <del> } <del> if r.Name != "mynetwork" { <del> t.Fatalf("expected `mynetwork`, got %s", r.Name) <del> } <del> _, ok := r.Services["web"] <del> if !ok { <del> t.Fatalf("expected service `web` missing in the verbose output") <del> } <del> <del> _, err = client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{Scope: "global"}) <del> assert.Check(t, is.Error(err, "Error: No such network: network_id")) <add> t.Run("empty ID", func(t *testing.T) { <add> // verify that the client does not create a request if the network-ID/name is empty. <add> _, err := client.NetworkInspect(context.Background(), "", types.NetworkInspectOptions{}) <add> assert.Check(t, IsErrNotFound(err)) <add> }) <add> t.Run("no options", func(t *testing.T) { <add> r, err := client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{}) <add> assert.NilError(t, err) <add> assert.Equal(t, r.Name, "mynetwork") <add> }) <add> t.Run("verbose", func(t *testing.T) { <add> r, err := client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{Verbose: true}) <add> assert.NilError(t, err) <add> assert.Equal(t, r.Name, "mynetwork") <add> _, ok := r.Services["web"] <add> if !ok { <add> t.Fatalf("expected service `web` missing in the verbose output") <add> } <add> }) <add> t.Run("global scope", func(t *testing.T) { <add> _, err := client.NetworkInspect(context.Background(), "network_id", types.NetworkInspectOptions{Scope: "global"}) <add> assert.Check(t, is.Error(err, "Error: No such network: network_id")) <add> assert.Check(t, IsErrNotFound(err)) <add> }) <add> t.Run("unknown network", func(t *testing.T) { <add> _, err := client.NetworkInspect(context.Background(), "unknown", types.NetworkInspectOptions{}) <add> assert.Check(t, is.Error(err, "Error: No such network: unknown")) <add> assert.Check(t, IsErrNotFound(err)) <add> }) <add> t.Run("server error", func(t *testing.T) { <add> // Just testing that an internal server error is converted correctly by the client <add> _, err := client.NetworkInspect(context.Background(), "test-500-response", types.NetworkInspectOptions{}) <add> assert.Check(t, errdefs.IsSystem(err)) <add> }) <ide> }
1
PHP
PHP
scheduler improvements
42a851a3df17cfa8ea0fd81fa0bf4a2af4c1061a
<ide><path>src/Illuminate/Console/Command.php <ide> class Command extends SymfonyCommand <ide> */ <ide> protected $description; <ide> <add> /** <add> * Indicates whether the command should be shown in the Artisan command list. <add> * <add> * @var bool <add> */ <add> protected $hidden = false; <add> <ide> /** <ide> * The default verbosity of output commands. <ide> * <ide> public function __construct() <ide> <ide> $this->setDescription($this->description); <ide> <add> $this->setHidden($this->hidden); <add> <ide> if (! isset($this->signature)) { <ide> $this->specifyParameters(); <ide> } <ide><path>src/Illuminate/Console/ScheduleServiceProvider.php <ide> class ScheduleServiceProvider extends ServiceProvider <ide> */ <ide> public function register() <ide> { <del> $this->commands('Illuminate\Console\Scheduling\ScheduleRunCommand'); <add> $this->commands([ <add> 'Illuminate\Console\Scheduling\ScheduleRunCommand', <add> 'Illuminate\Console\Scheduling\ScheduleFinishCommand', <add> ]); <ide> } <ide> <ide> /** <ide> public function provides() <ide> { <ide> return [ <ide> 'Illuminate\Console\Scheduling\ScheduleRunCommand', <add> 'Illuminate\Console\Scheduling\ScheduleFinishCommand', <ide> ]; <ide> } <ide> } <ide><path>src/Illuminate/Console/Scheduling/CommandBuilder.php <add><?php <add> <add>namespace Illuminate\Console\Scheduling; <add> <add>use Illuminate\Console\Application; <add>use Symfony\Component\Process\ProcessUtils; <add> <add>class CommandBuilder <add>{ <add> /** <add> * Build the command for the given event. <add> * <add> * @param \Illuminate\Console\Scheduling\Event $event <add> * @return string <add> */ <add> public function buildCommand(Event $event) <add> { <add> if ($event->runInBackground) { <add> return $this->buildBackgroundCommand($event); <add> } else { <add> return $this->buildForegroundCommand($event); <add> } <add> } <add> <add> /** <add> * Build the command for running the event in the foreground. <add> * <add> * @param \Illuminate\Console\Scheduling\Event $event <add> * @return string <add> */ <add> protected function buildForegroundCommand(Event $event) <add> { <add> $output = ProcessUtils::escapeArgument($event->output); <add> <add> return $this->finalize($event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1'); <add> } <add> <add> /** <add> * Build the command for running the event in the foreground. <add> * <add> * @param \Illuminate\Console\Scheduling\Event $event <add> * @return string <add> */ <add> protected function buildBackgroundCommand(Event $event) <add> { <add> $output = ProcessUtils::escapeArgument($event->output); <add> <add> $redirect = $event->shouldAppendOutput ? ' >> ' : ' > '; <add> <add> $finished = Application::formatCommandString('schedule:finish').' "'.$event->mutexName().'"'; <add> <add> return $this->finalize($event, <add> '('.$event->command.$redirect.$output.' 2>&1 '.(windows_os() ? '&' : ';').' '.$finished.') > ' <add> .ProcessUtils::escapeArgument($event->getDefaultOutput()).' 2>&1 &' <add> ); <add> } <add> <add> /** <add> * Finalize the event's command syntax. <add> * <add> * @param \Illuminate\Console\Scheduling\Event $event <add> * @param string $command <add> * @return string <add> */ <add> protected function finalize(Event $event, $command) <add> { <add> return $event->user && ! windows_os() ? 'sudo -u '.$event->user.' -- sh -c \''.$command.'\'' : $command; <add> } <add>} <ide><path>src/Illuminate/Console/Scheduling/Event.php <ide> use Carbon\Carbon; <ide> use LogicException; <ide> use Cron\CronExpression; <del>use Illuminate\Console\Application; <ide> use GuzzleHttp\Client as HttpClient; <ide> use Illuminate\Contracts\Mail\Mailer; <ide> use Symfony\Component\Process\Process; <del>use Symfony\Component\Process\ProcessUtils; <ide> use Illuminate\Contracts\Container\Container; <ide> use Illuminate\Contracts\Cache\Repository as Cache; <ide> <ide> class Event <ide> * <ide> * @var bool <ide> */ <del> protected $shouldAppendOutput = false; <add> public $shouldAppendOutput = false; <ide> <ide> /** <ide> * The array of callbacks to be run before the event is started. <ide> public function __construct(Cache $cache, $command) <ide> * <ide> * @return string <ide> */ <del> protected function getDefaultOutput() <add> public function getDefaultOutput() <ide> { <ide> return (DIRECTORY_SEPARATOR == '\\') ? 'NUL' : '/dev/null'; <ide> } <ide> public function run(Container $container) <ide> } <ide> <ide> if ($this->runInBackground) { <del> $this->runCommandInBackground(); <add> $this->runCommandInBackground($container); <ide> } else { <ide> $this->runCommandInForeground($container); <ide> } <ide> protected function runCommandInForeground(Container $container) <ide> /** <ide> * Run the command in the background. <ide> * <add> * @param \Illuminate\Contracts\Container\Container $container <ide> * @return void <ide> */ <del> protected function runCommandInBackground() <add> protected function runCommandInBackground(Container $container) <ide> { <add> $this->callBeforeCallbacks($container); <add> <ide> (new Process( <ide> $this->buildCommand(), base_path(), null, null, null <ide> ))->run(); <ide> protected function runCommandInBackground() <ide> * @param \Illuminate\Contracts\Container\Container $container <ide> * @return void <ide> */ <del> protected function callBeforeCallbacks(Container $container) <add> public function callBeforeCallbacks(Container $container) <ide> { <ide> foreach ($this->beforeCallbacks as $callback) { <ide> $container->call($callback); <ide> protected function callBeforeCallbacks(Container $container) <ide> * @param \Illuminate\Contracts\Container\Container $container <ide> * @return void <ide> */ <del> protected function callAfterCallbacks(Container $container) <add> public function callAfterCallbacks(Container $container) <ide> { <ide> foreach ($this->afterCallbacks as $callback) { <ide> $container->call($callback); <ide> protected function callAfterCallbacks(Container $container) <ide> */ <ide> public function buildCommand() <ide> { <del> $output = ProcessUtils::escapeArgument($this->output); <del> <del> $redirect = $this->shouldAppendOutput ? ' >> ' : ' > '; <del> <del> if ($this->withoutOverlapping) { <del> $forget = Application::formatCommandString('cache:forget'); <del> <del> if (windows_os()) { <del> $command = '('.$this->command.' & '.$forget.' "'.$this->mutexName().'")'.$redirect.$output.' 2>&1 &'; <del> } else { <del> $command = '('.$this->command.'; '.$forget.' '.$this->mutexName().')'.$redirect.$output.' 2>&1 &'; <del> } <del> } else { <del> $command = $this->command.$redirect.$output.' 2>&1 &'; <del> } <del> <del> return $this->user && ! windows_os() ? 'sudo -u '.$this->user.' -- sh -c \''.$command.'\'' : $command; <add> return (new CommandBuilder)->buildCommand($this); <ide> } <ide> <ide> /** <ide> * Get the mutex name for the scheduled command. <ide> * <ide> * @return string <ide> */ <del> protected function mutexName() <add> public function mutexName() <ide> { <ide> return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command); <ide> } <ide> public function withoutOverlapping() <ide> { <ide> $this->withoutOverlapping = true; <ide> <del> return $this->skip(function () { <add> return $this->then(function () { <add> $this->cache->forget($this->mutexName()); <add> })->skip(function () { <ide> return $this->cache->has($this->mutexName()); <ide> }); <ide> } <ide><path>src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php <add><?php <add> <add>namespace Illuminate\Console\Scheduling; <add> <add>use Illuminate\Console\Command; <add> <add>class ScheduleFinishCommand extends Command <add>{ <add> /** <add> * The console command name. <add> * <add> * @var string <add> */ <add> protected $signature = 'schedule:finish {id}'; <add> <add> /** <add> * The console command description. <add> * <add> * @var string <add> */ <add> protected $description = 'Handle the completion of a scheduled command'; <add> <add> /** <add> * Indicates whether the command should be shown in the Artisan command list. <add> * <add> * @var bool <add> */ <add> protected $hidden = true; <add> <add> /** <add> * The schedule instance. <add> * <add> * @var \Illuminate\Console\Scheduling\Schedule <add> */ <add> protected $schedule; <add> <add> /** <add> * Create a new command instance. <add> * <add> * @param \Illuminate\Console\Scheduling\Schedule $schedule <add> * @return void <add> */ <add> public function __construct(Schedule $schedule) <add> { <add> $this->schedule = $schedule; <add> <add> parent::__construct(); <add> } <add> <add> /** <add> * Execute the console command. <add> * <add> * @return void <add> */ <add> public function fire() <add> { <add> collect($this->schedule->events())->filter(function ($value) { <add> return $value->mutexName() == $this->argument('id'); <add> })->each->callAfterCallbacks($this->laravel); <add> } <add>} <ide><path>tests/Console/Scheduling/EventTest.php <ide> public function testBuildCommand() <ide> $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i'); <ide> <ide> $defaultOutput = (DIRECTORY_SEPARATOR == '\\') ? 'NUL' : '/dev/null'; <del> $this->assertSame("php -i > {$quote}{$defaultOutput}{$quote} 2>&1 &", $event->buildCommand()); <add> $this->assertSame("php -i > {$quote}{$defaultOutput}{$quote} 2>&1", $event->buildCommand()); <add> <add> $quote = (DIRECTORY_SEPARATOR == '\\') ? '"' : "'"; <add> <add> $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i'); <add> $event->runInBackground(); <add> <add> $defaultOutput = (DIRECTORY_SEPARATOR == '\\') ? 'NUL' : '/dev/null'; <add> $this->assertSame("(php -i > {$quote}{$defaultOutput}{$quote} 2>&1 ; '".PHP_BINARY."' artisan schedule:finish \"framework/schedule-c65b1c374c37056e0c57fccb0c08d724ce6f5043\") > {$quote}{$defaultOutput}{$quote} 2>&1 &", $event->buildCommand()); <ide> } <ide> <ide> public function testBuildCommandSendOutputTo() <ide> public function testBuildCommandSendOutputTo() <ide> $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i'); <ide> <ide> $event->sendOutputTo('/dev/null'); <del> $this->assertSame("php -i > {$quote}/dev/null{$quote} 2>&1 &", $event->buildCommand()); <add> $this->assertSame("php -i > {$quote}/dev/null{$quote} 2>&1", $event->buildCommand()); <ide> <ide> $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i'); <ide> <ide> $event->sendOutputTo('/my folder/foo.log'); <del> $this->assertSame("php -i > {$quote}/my folder/foo.log{$quote} 2>&1 &", $event->buildCommand()); <add> $this->assertSame("php -i > {$quote}/my folder/foo.log{$quote} 2>&1", $event->buildCommand()); <ide> } <ide> <ide> public function testBuildCommandAppendOutput() <ide> public function testBuildCommandAppendOutput() <ide> $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i'); <ide> <ide> $event->appendOutputTo('/dev/null'); <del> $this->assertSame("php -i >> {$quote}/dev/null{$quote} 2>&1 &", $event->buildCommand()); <add> $this->assertSame("php -i >> {$quote}/dev/null{$quote} 2>&1", $event->buildCommand()); <ide> } <ide> <ide> /**
6
Python
Python
add tests for hypot function
197d9411d78b405fa9fc9de90c29660af833185c
<ide><path>numpy/core/tests/test_umath.py <ide> def test_expm1(self): <ide> assert_almost_equal(ncu.expm1(0.2), ncu.exp(0.2)-1) <ide> assert_almost_equal(ncu.expm1(1e-6), ncu.exp(1e-6)-1) <ide> <add>class TestHypot(TestCase, object): <add> def test_simple(self): <add> assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2)) <add> assert_almost_equal(ncu.hypot(0, 0), 0) <add> <add>def assert_hypot_isnan(x, y): <add> assert np.isnan(ncu.hypot(x, y)) <add> <add>def assert_hypot_isinf(x, y): <add> assert np.isinf(ncu.hypot(x, y)) <add> <add>def test_hypot_special_values(): <add> yield assert_hypot_isnan, np.nan, np.nan <add> yield assert_hypot_isnan, np.nan, 1 <add> yield assert_hypot_isinf, np.nan, np.inf <add> yield assert_hypot_isinf, np.inf, np.nan <add> yield assert_hypot_isinf, np.inf, 0 <add> yield assert_hypot_isinf, 0, np.inf <add> <ide> class TestMaximum(TestCase): <ide> def test_reduce_complex(self): <ide> assert_equal(np.maximum.reduce([1,2j]),1)
1
Ruby
Ruby
fix virtualenv symlinks for versioned python
2594e7093ea082daa1add40104e69616a7e1ef15
<ide><path>Library/Homebrew/language/python.rb <ide> def create <ide> next unless f.symlink? <ide> next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR <ide> <del> new_target = rp.sub %r{#{HOMEBREW_CELLAR}/python/[^/]+}, Formula["python"].opt_prefix <add> version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/} <add> version = "@#{version.captures.first}" unless version.nil? <add> <add> new_target = rp.sub %r{#{HOMEBREW_CELLAR}/python#{version}/[^/]+}, Formula["python#{version}"].opt_prefix <ide> f.unlink <ide> f.make_symlink new_target <ide> end <ide> <ide> Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file| <ide> prefix_path = prefix_file.read <del> prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/python/[^/]+}, Formula["python"].opt_prefix <add> <add> version = prefix_path.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/} <add> version = "@#{version.captures.first}" unless version.nil? <add> <add> prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/python#{version}/[^/]+}, Formula["python#{version}"].opt_prefix <ide> prefix_file.atomic_write prefix_path <ide> end <ide> end
1
Text
Text
use code markup/markdown in headers
fc0aa3f2b47c2e913951a5f556b11bc7514f8750
<ide><path>doc/api/process.md <ide> const process = require('process'); <ide> <ide> The `process` object is an instance of [`EventEmitter`][]. <ide> <del>### Event: 'beforeExit' <add>### Event: `'beforeExit'` <ide> <!-- YAML <ide> added: v0.11.12 <ide> --> <ide> console.log('This message is displayed first.'); <ide> // Process exit event with code: 0 <ide> ``` <ide> <del>### Event: 'disconnect' <add>### Event: `'disconnect'` <ide> <!-- YAML <ide> added: v0.7.7 <ide> --> <ide> If the Node.js process is spawned with an IPC channel (see the [Child Process][] <ide> and [Cluster][] documentation), the `'disconnect'` event will be emitted when <ide> the IPC channel is closed. <ide> <del>### Event: 'exit' <add>### Event: `'exit'` <ide> <!-- YAML <ide> added: v0.1.7 <ide> --> <ide> process.on('exit', (code) => { <ide> }); <ide> ``` <ide> <del>### Event: 'message' <add>### Event: `'message'` <ide> <!-- YAML <ide> added: v0.5.10 <ide> --> <ide> process, the `message` argument can contain data that JSON is not able <ide> to represent. <ide> See [Advanced Serialization for `child_process`][] for more details. <ide> <del>### Event: 'multipleResolves' <add>### Event: `'multipleResolves'` <ide> <!-- YAML <ide> added: v10.12.0 <ide> --> <ide> main().then(console.log); <ide> // First call <ide> ``` <ide> <del>### Event: 'rejectionHandled' <add>### Event: `'rejectionHandled'` <ide> <!-- YAML <ide> added: v1.4.1 <ide> --> <ide> possible to record such errors in an error log, either periodically (which is <ide> likely best for long-running application) or upon process exit (which is likely <ide> most convenient for scripts). <ide> <del>### Event: 'uncaughtException' <add>### Event: `'uncaughtException'` <ide> <!-- YAML <ide> added: v0.1.18 <ide> changes: <ide> To restart a crashed application in a more reliable way, whether <ide> in a separate process to detect application failures and recover or restart as <ide> needed. <ide> <del>### Event: 'unhandledRejection' <add>### Event: `'unhandledRejection'` <ide> <!-- YAML <ide> added: v1.4.1 <ide> changes: <ide> address such failures, a non-operational <ide> `resource.loaded`, which would prevent the `'unhandledRejection'` event from <ide> being emitted. <ide> <del>### Event: 'warning' <add>### Event: `'warning'` <ide> <!-- YAML <ide> added: v6.0.0 <ide> --> <ide> with [`process.kill()`][], and [`subprocess.kill()`][]. Sending signal `0` can <ide> be used to test for the existence of a process. Sending `SIGINT`, `SIGTERM`, <ide> and `SIGKILL` cause the unconditional termination of the target process. <ide> <del>## process.abort() <add>## `process.abort()` <ide> <!-- YAML <ide> added: v0.7.0 <ide> --> <ide> generate a core file. <ide> <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.allowedNodeEnvironmentFlags <add>## `process.allowedNodeEnvironmentFlags` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> If Node.js was compiled *without* [`NODE_OPTIONS`][] support (shown in <ide> [`process.config`][]), `process.allowedNodeEnvironmentFlags` will <ide> contain what *would have* been allowable. <ide> <del>## process.arch <add>## `process.arch` <ide> <!-- YAML <ide> added: v0.5.0 <ide> --> <ide> Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, <ide> console.log(`This processor architecture is ${process.arch}`); <ide> ``` <ide> <del>## process.argv <add>## `process.argv` <ide> <!-- YAML <ide> added: v0.1.27 <ide> --> <ide> Would generate the output: <ide> 4: four <ide> ``` <ide> <del>## process.argv0 <add>## `process.argv0` <ide> <!-- YAML <ide> added: v6.4.0 <ide> --> <ide> $ bash -c 'exec -a customArgv0 ./node' <ide> 'customArgv0' <ide> ``` <ide> <del>## process.channel <add>## `process.channel` <ide> <!-- YAML <ide> added: v7.1.0 <ide> --> <ide> If the Node.js process was spawned with an IPC channel (see the <ide> property is a reference to the IPC channel. If no IPC channel exists, this <ide> property is `undefined`. <ide> <del>## process.chdir(directory) <add>## `process.chdir(directory)` <ide> <!-- YAML <ide> added: v0.1.17 <ide> --> <ide> try { <ide> <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.config <add>## `process.config` <ide> <!-- YAML <ide> added: v0.7.7 <ide> --> <ide> The `process.config` property is **not** read-only and there are existing <ide> modules in the ecosystem that are known to extend, modify, or entirely replace <ide> the value of `process.config`. <ide> <del>## process.connected <add>## `process.connected` <ide> <!-- YAML <ide> added: v0.7.2 <ide> --> <ide> and [Cluster][] documentation), the `process.connected` property will return <ide> Once `process.connected` is `false`, it is no longer possible to send messages <ide> over the IPC channel using `process.send()`. <ide> <del>## process.cpuUsage(\[previousValue\]) <add>## `process.cpuUsage([previousValue])` <ide> <!-- YAML <ide> added: v6.1.0 <ide> --> <ide> console.log(process.cpuUsage(startUsage)); <ide> // { user: 514883, system: 11226 } <ide> ``` <ide> <del>## process.cwd() <add>## `process.cwd()` <ide> <!-- YAML <ide> added: v0.1.8 <ide> --> <ide> process. <ide> console.log(`Current directory: ${process.cwd()}`); <ide> ``` <ide> <del>## process.debugPort <add>## `process.debugPort` <ide> <!-- YAML <ide> added: v0.7.2 <ide> --> <ide> The port used by Node.js's debugger when enabled. <ide> process.debugPort = 5858; <ide> ``` <ide> <del>## process.disconnect() <add>## `process.disconnect()` <ide> <!-- YAML <ide> added: v0.7.2 <ide> --> <ide> The effect of calling `process.disconnect()` is the same as calling <ide> If the Node.js process was not spawned with an IPC channel, <ide> `process.disconnect()` will be `undefined`. <ide> <del>## process.dlopen(module, filename\[, flags\]) <add>## `process.dlopen(module, filename[, flags])` <ide> <!-- YAML <ide> added: v0.1.16 <ide> changes: <ide> process.dlopen(module, require.resolve('binding'), <ide> module.exports.foo(); <ide> ``` <ide> <del>## process.emitWarning(warning\[, options\]) <add>## `process.emitWarning(warning[, options])` <ide> <!-- YAML <ide> added: v8.0.0 <ide> --> <ide> process.on('warning', (warning) => { <ide> <ide> If `warning` is passed as an `Error` object, the `options` argument is ignored. <ide> <del>## process.emitWarning(warning\[, type\[, code\]\]\[, ctor\]) <add>## `process.emitWarning(warning[, type[, code]][, ctor])` <ide> <!-- YAML <ide> added: v6.0.0 <ide> --> <ide> emitMyWarning(); <ide> // Emits nothing <ide> ``` <ide> <del>## process.env <add>## `process.env` <ide> <!-- YAML <ide> added: v0.1.27 <ide> changes: <ide> to the [`Worker`][] constructor. Changes to `process.env` will not be visible <ide> across [`Worker`][] threads, and only the main thread can make changes that <ide> are visible to the operating system or to native add-ons. <ide> <del>## process.execArgv <add>## `process.execArgv` <ide> <!-- YAML <ide> added: v0.7.7 <ide> --> <ide> And `process.argv`: <ide> ['/usr/local/bin/node', 'script.js', '--version'] <ide> ``` <ide> <del>## process.execPath <add>## `process.execPath` <ide> <!-- YAML <ide> added: v0.1.100 <ide> --> <ide> that started the Node.js process. <ide> '/usr/local/bin/node' <ide> ``` <ide> <del>## process.exit(\[code\]) <add>## `process.exit([code])` <ide> <!-- YAML <ide> added: v0.1.13 <ide> --> <ide> is safer than calling `process.exit()`. <ide> In [`Worker`][] threads, this function stops the current thread rather <ide> than the current process. <ide> <del>## process.exitCode <add>## `process.exitCode` <ide> <!-- YAML <ide> added: v0.11.8 <ide> --> <ide> a code. <ide> Specifying a code to [`process.exit(code)`][`process.exit()`] will override any <ide> previous setting of `process.exitCode`. <ide> <del>## process.getegid() <add>## `process.getegid()` <ide> <!-- YAML <ide> added: v2.0.0 <ide> --> <ide> if (process.getegid) { <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> <del>## process.geteuid() <add>## `process.geteuid()` <ide> <!-- YAML <ide> added: v2.0.0 <ide> --> <ide> if (process.geteuid) { <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> <del>## process.getgid() <add>## `process.getgid()` <ide> <!-- YAML <ide> added: v0.1.31 <ide> --> <ide> if (process.getgid) { <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> <del>## process.getgroups() <add>## `process.getgroups()` <ide> <!-- YAML <ide> added: v0.9.4 <ide> --> <ide> Node.js ensures it always is. <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> <del>## process.getuid() <add>## `process.getuid()` <ide> <!-- YAML <ide> added: v0.1.28 <ide> --> <ide> if (process.getuid) { <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> <del>## process.hasUncaughtExceptionCaptureCallback() <add>## `process.hasUncaughtExceptionCaptureCallback()` <ide> <!-- YAML <ide> added: v9.3.0 <ide> --> <ide> added: v9.3.0 <ide> Indicates whether a callback has been set using <ide> [`process.setUncaughtExceptionCaptureCallback()`][]. <ide> <del>## process.hrtime(\[time\]) <add>## `process.hrtime([time])` <ide> <!-- YAML <ide> added: v0.7.6 <ide> --> <ide> setTimeout(() => { <ide> }, 1000); <ide> ``` <ide> <del>## process.hrtime.bigint() <add>## `process.hrtime.bigint()` <ide> <!-- YAML <ide> added: v10.7.0 <ide> --> <ide> setTimeout(() => { <ide> }, 1000); <ide> ``` <ide> <del>## process.initgroups(user, extraGroup) <add>## `process.initgroups(user, extraGroup)` <ide> <!-- YAML <ide> added: v0.9.4 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.kill(pid\[, signal\]) <add>## `process.kill(pid[, signal])` <ide> <!-- YAML <ide> added: v0.0.6 <ide> --> <ide> process.kill(process.pid, 'SIGHUP'); <ide> When `SIGUSR1` is received by a Node.js process, Node.js will start the <ide> debugger. See [Signal Events][]. <ide> <del>## process.mainModule <add>## `process.mainModule` <ide> <!-- YAML <ide> added: v0.1.17 <ide> --> <ide> safe to assume that the two refer to the same module. <ide> As with [`require.main`][], `process.mainModule` will be `undefined` if there <ide> is no entry script. <ide> <del>## process.memoryUsage() <add>## `process.memoryUsage()` <ide> <!-- YAML <ide> added: v0.1.16 <ide> changes: <ide> _code segment_. <ide> When using [`Worker`][] threads, `rss` will be a value that is valid for the <ide> entire process, while the other fields will only refer to the current thread. <ide> <del>## process.nextTick(callback\[, ...args\]) <add>## `process.nextTick(callback[, ...args])` <ide> <!-- YAML <ide> added: v0.1.26 <ide> changes: <ide> function definitelyAsync(arg, cb) { <ide> } <ide> ``` <ide> <del>## process.noDeprecation <add>## `process.noDeprecation` <ide> <!-- YAML <ide> added: v0.8.0 <ide> --> <ide> the [`'warning'` event][process_warning] and the <ide> [`emitWarning()` method][process_emit_warning] for more information about this <ide> flag's behavior. <ide> <del>## process.pid <add>## `process.pid` <ide> <!-- YAML <ide> added: v0.1.15 <ide> --> <ide> The `process.pid` property returns the PID of the process. <ide> console.log(`This process is pid ${process.pid}`); <ide> ``` <ide> <del>## process.platform <add>## `process.platform` <ide> <!-- YAML <ide> added: v0.1.16 <ide> --> <ide> The value `'android'` may also be returned if the Node.js is built on the <ide> Android operating system. However, Android support in Node.js <ide> [is experimental][Android building]. <ide> <del>## process.ppid <add>## `process.ppid` <ide> <!-- YAML <ide> added: <ide> - v9.2.0 <ide> The `process.ppid` property returns the PID of the current parent process. <ide> console.log(`The parent process is pid ${process.ppid}`); <ide> ``` <ide> <del>## process.release <add>## `process.release` <ide> <!-- YAML <ide> added: v3.0.0 <ide> changes: <ide> In custom builds from non-release versions of the source tree, only the <ide> `name` property may be present. The additional properties should not be <ide> relied upon to exist. <ide> <del>## process.report <add>## `process.report` <ide> <!-- YAML <ide> added: v11.8.0 <ide> --> <ide> added: v11.8.0 <ide> reports for the current process. Additional documentation is available in the <ide> [report documentation][]. <ide> <del>### process.report.directory <add>### `process.report.directory` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> Node.js process. <ide> console.log(`Report directory is ${process.report.directory}`); <ide> ``` <ide> <del>### process.report.filename <add>### `process.report.filename` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> value is the empty string. <ide> console.log(`Report filename is ${process.report.filename}`); <ide> ``` <ide> <del>### process.report.getReport(\[err\]) <add>### `process.report.getReport([err])` <ide> <!-- YAML <ide> added: v11.8.0 <ide> --> <ide> fs.writeFileSync(util.inspect(data), 'my-report.log', 'utf8'); <ide> <ide> Additional documentation is available in the [report documentation][]. <ide> <del>### process.report.reportOnFatalError <add>### `process.report.reportOnFatalError` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> memory errors or failed C++ assertions. <ide> console.log(`Report on fatal error: ${process.report.reportOnFatalError}`); <ide> ``` <ide> <del>### process.report.reportOnSignal <add>### `process.report.reportOnSignal` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> signal specified by `process.report.signal`. <ide> console.log(`Report on signal: ${process.report.reportOnSignal}`); <ide> ``` <ide> <del>### process.report.reportOnUncaughtException <add>### `process.report.reportOnUncaughtException` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> If `true`, a diagnostic report is generated on uncaught exception. <ide> console.log(`Report on exception: ${process.report.reportOnUncaughtException}`); <ide> ``` <ide> <del>### process.report.signal <add>### `process.report.signal` <ide> <!-- YAML <ide> added: v11.12.0 <ide> --> <ide> The signal used to trigger the creation of a diagnostic report. Defaults to <ide> console.log(`Report signal: ${process.report.signal}`); <ide> ``` <ide> <del>### process.report.writeReport(\[filename\]\[, err\]) <add>### `process.report.writeReport([filename][, err])` <ide> <!-- YAML <ide> added: v11.8.0 <ide> --> <ide> process.report.writeReport(); <ide> <ide> Additional documentation is available in the [report documentation][]. <ide> <del>## process.resourceUsage() <add>## `process.resourceUsage()` <ide> <!-- YAML <ide> added: v12.6.0 <ide> --> <ide> console.log(process.resourceUsage()); <ide> */ <ide> ``` <ide> <del>## process.send(message\[, sendHandle\[, options\]\]\[, callback\]) <add>## `process.send(message[, sendHandle[, options]][, callback])` <ide> <!-- YAML <ide> added: v0.5.9 <ide> --> <ide> If Node.js was not spawned with an IPC channel, `process.send` will be <ide> The message goes through serialization and parsing. The resulting message might <ide> not be the same as what is originally sent. <ide> <del>## process.setegid(id) <add>## `process.setegid(id)` <ide> <!-- YAML <ide> added: v2.0.0 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.seteuid(id) <add>## `process.seteuid(id)` <ide> <!-- YAML <ide> added: v2.0.0 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.setgid(id) <add>## `process.setgid(id)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.setgroups(groups) <add>## `process.setgroups(groups)` <ide> <!-- YAML <ide> added: v0.9.4 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.setuid(id) <add>## `process.setuid(id)` <ide> <!-- YAML <ide> added: v0.1.28 <ide> --> <ide> This function is only available on POSIX platforms (i.e. not Windows or <ide> Android). <ide> This feature is not available in [`Worker`][] threads. <ide> <del>## process.setUncaughtExceptionCaptureCallback(fn) <add>## `process.setUncaughtExceptionCaptureCallback(fn)` <ide> <!-- YAML <ide> added: v9.3.0 <ide> --> <ide> throw an error. <ide> Using this function is mutually exclusive with using the deprecated <ide> [`domain`][] built-in module. <ide> <del>## process.stderr <add>## `process.stderr` <ide> <ide> * {Stream} <ide> <ide> a [Writable][] stream. <ide> `process.stderr` differs from other Node.js streams in important ways. See <ide> [note on process I/O][] for more information. <ide> <del>## process.stdin <add>## `process.stdin` <ide> <ide> * {Stream} <ide> <ide> In "old" streams mode the `stdin` stream is paused by default, so one <ide> must call `process.stdin.resume()` to read from it. Note also that calling <ide> `process.stdin.resume()` itself would switch stream to "old" mode. <ide> <del>## process.stdout <add>## `process.stdout` <ide> <ide> * {Stream} <ide> <ide> false <ide> <ide> See the [TTY][] documentation for more information. <ide> <del>## process.throwDeprecation <add>## `process.throwDeprecation` <ide> <!-- YAML <ide> added: v0.9.12 <ide> --> <ide> Thrown: <ide> [DeprecationWarning: test] { name: 'DeprecationWarning' } <ide> ``` <ide> <del>## process.title <add>## `process.title` <ide> <!-- YAML <ide> added: v0.1.104 <ide> --> <ide> allowed for longer process title strings by also overwriting the `environ` <ide> memory but that was potentially insecure and confusing in some (rather obscure) <ide> cases. <ide> <del>## process.traceDeprecation <add>## `process.traceDeprecation` <ide> <!-- YAML <ide> added: v0.8.0 <ide> --> <ide> documentation for the [`'warning'` event][process_warning] and the <ide> [`emitWarning()` method][process_emit_warning] for more information about this <ide> flag's behavior. <ide> <del>## process.umask(\[mask\]) <add>## `process.umask([mask])` <ide> <!-- YAML <ide> added: v0.1.19 <ide> --> <ide> console.log( <ide> [`Worker`][] threads are able to read the umask, however attempting to set the <ide> umask will result in a thrown exception. <ide> <del>## process.uptime() <add>## `process.uptime()` <ide> <!-- YAML <ide> added: v0.5.0 <ide> --> <ide> process has been running. <ide> The return value includes fractions of a second. Use `Math.floor()` to get whole <ide> seconds. <ide> <del>## process.version <add>## `process.version` <ide> <!-- YAML <ide> added: v0.1.3 <ide> --> <ide> The `process.version` property returns the Node.js version string. <ide> console.log(`Version: ${process.version}`); <ide> ``` <ide> <del>## process.versions <add>## `process.versions` <ide> <!-- YAML <ide> added: v0.2.0 <ide> changes:
1
Java
Java
remove unused scheduler.parallelism
9d07b367b2e1efd2e2dfe28ec0240595b8d76108
<ide><path>src/main/java/rx/Scheduler.java <ide> public long now() { <ide> } <ide> } <ide> <del> /** <del> * Indicates the parallelism available to this Scheduler. <del> * <p> <del> * This defaults to {@code Runtime.getRuntime().availableProcessors()} but can be overridden for use cases <del> * such as scheduling work on a computer cluster. <del> * <del> * @return the scheduler's available degree of parallelism <del> */ <del> public int parallelism() { <del> return Runtime.getRuntime().availableProcessors(); <del> } <del> <ide> /** <ide> * Gets the current time, in milliseconds, according to this Scheduler. <ide> *
1
PHP
PHP
move locale method
13063142ac0539362d07f4aca83084b43cbf77b1
<ide><path>src/Illuminate/Foundation/Application.php <ide> public function getProviderRepository() <ide> return new ProviderRepository(new Filesystem, $manifest); <ide> } <ide> <del> /** <del> * Get the current application locale. <del> * <del> * @return string <del> */ <del> public function getLocale() <del> { <del> return $this['config']->get('app.locale'); <del> } <del> <del> /** <del> * Set the current application locale. <del> * <del> * @param string $locale <del> * @return void <del> */ <del> public function setLocale($locale) <del> { <del> $this['config']->set('app.locale', $locale); <del> <del> $this['translator']->setLocale($locale); <del> <del> $this['events']->fire('locale.changed', array($locale)); <del> } <del> <ide> /** <ide> * Get the service providers that have been loaded. <ide> * <ide> public static function onRequest($method, $parameters = array()) <ide> return forward_static_call_array(array(static::requestClass(), $method), $parameters); <ide> } <ide> <add> /** <add> * Get the current application locale. <add> * <add> * @return string <add> */ <add> public function getLocale() <add> { <add> return $this['config']->get('app.locale'); <add> } <add> <add> /** <add> * Set the current application locale. <add> * <add> * @param string $locale <add> * @return void <add> */ <add> public function setLocale($locale) <add> { <add> $this['config']->set('app.locale', $locale); <add> <add> $this['translator']->setLocale($locale); <add> <add> $this['events']->fire('locale.changed', array($locale)); <add> } <add> <ide> /** <ide> * Register the core class aliases in the container. <ide> *
1
Ruby
Ruby
fix deprecation warning about variants and formats
6a4bf486c3ec7f09d517fffba5c23f53e53a39d9
<ide><path>actionview/test/template/testing/fixture_resolver_test.rb <ide> def test_should_match_templates_with_variants <ide> assert_equal 1, templates.size, "expected one template" <ide> assert_equal "this text", templates.first.source <ide> assert_equal "arbitrary/path", templates.first.virtual_path <del> assert_equal [:html], templates.first.formats <del> assert_equal ["variant"], templates.first.variants <add> assert_equal :html, templates.first.format <add> assert_equal "variant", templates.first.variant <ide> end <ide> end
1
Text
Text
add link for revalidate from notfound section
432261a1e15b253b8a56be42cc3698a4d7bdf513
<ide><path>docs/api-reference/data-fetching/get-static-props.md <ide> Learn more about [Incremental Static Regeneration](/docs/basic-features/data-fet <ide> <ide> ### `notFound` <ide> <del>The `notFound` boolean allows the page to return a `404` status and [404 Page](/docs/advanced-features/custom-error-page.md#404-page). With `notFound: true`, the page will return a `404` even if there was a successfully generated page before. This is meant to support use cases like user-generated content getting removed by its author. <add>The `notFound` boolean allows the page to return a `404` status and [404 Page](/docs/advanced-features/custom-error-page.md#404-page). With `notFound: true`, the page will return a `404` even if there was a successfully generated page before. This is meant to support use cases like user-generated content getting removed by its author. Note, `notFound` follows the same `revalidate` behavior [described here](/docs/api-reference/data-fetching/get-static-props.md#revalidate) <ide> <ide> ```js <ide> export async function getStaticProps(context) {
1
Javascript
Javascript
use markdown syntax
8555c0f5d616e8594362cebf5a3b4c0f146afe08
<ide><path>packages/ember-runtime/lib/mixins/enumerable.js <ide> function iter(key, value) { <ide> can use any of these methods on simple arrays. If Array already implements <ide> one of these methods, the mixin will not override them. <ide> <del> h3. Writing Your Own Enumerable <add> ## Writing Your Own Enumerable <ide> <ide> To make your own custom class enumerable, you need two items: <ide> <ide> function iter(key, value) { <ide> to your class and you will be able to enumerate the contents of your object <ide> like any other collection. <ide> <del> h3. Using Ember Enumeration with Other Libraries <add> ## Using Ember Enumeration with Other Libraries <ide> <ide> Many other libraries provide some kind of iterator or enumeration like <ide> facility. This is often where the most common API conflicts occur.
1
PHP
PHP
fix error catch to handle older carbon versions
94ad84680a190dc8a213a0a3947f4c3419bd06e2
<ide><path>src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php <ide> use Illuminate\Support\Collection as BaseCollection; <ide> use Illuminate\Support\Facades\Date; <ide> use Illuminate\Support\Str; <add>use InvalidArgumentException; <ide> use LogicException; <ide> <ide> trait HasAttributes <ide> protected function asDateTime($value) <ide> // that is returned back out to the developers after we convert it here. <ide> try { <ide> $date = Date::createFromFormat($format, $value); <del> } catch (InvalidFormatException $_) { <add> } catch (InvalidFormatException | InvalidArgumentException $_) { <ide> $date = false; <ide> } <ide>
1
PHP
PHP
update doc blocks and coding standards
a2a4c8ca0eb09e97cbe47614bc495b6046939050
<ide><path>src/View/Input/Checkbox.php <ide> */ <ide> namespace Cake\View\Input; <ide> <del>use Cake\View\StringTemplate; <del> <ide> /** <ide> * Input widget for creating checkbox widgets. <ide> */ <ide> public function __construct($templates) { <ide> /** <ide> * Render a checkbox element. <ide> * <add> * Data supports the following keys: <add> * <add> * - `name` - The name of the input. <add> * - `value` - The value attribute. Defaults to '1'. <add> * - `checked` - Whether or not the checkbox should be checked. <add> * - `disabled` - Whether or not the checkbox should be disabled. <add> * <add> * Any other attributes passed in will be treated as HTML attributes. <add> * <ide> * @param array $data The data to create a checkbox with. <add> * @return string Generated HTML string. <ide> */ <ide> public function render($data) { <ide> $data += [ <ide><path>tests/TestCase/View/Input/CheckboxTest.php <ide> public function testRenderCheckedValue() { <ide> $this->assertTags($result, $expected); <ide> } <ide> <del> <ide> }
2
Javascript
Javascript
update js examples
e3b7148455ade60b594547478d1aff5a8ee1cf4a
<ide><path>examples/js/postprocessing/ClearPass.js <ide> THREE.ClearPass = function ( clearColor, clearAlpha ) { <ide> <ide> this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000; <ide> this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0; <add> this.oldClearColor = new THREE.Color(); <ide> <ide> }; <ide> <ide> THREE.ClearPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ) <ide> <ide> render: function ( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) { <ide> <del> var oldClearColor, oldClearAlpha; <add> var oldClearAlpha; <ide> <ide> if ( this.clearColor ) { <ide> <del> oldClearColor = renderer.getClearColor().getHex(); <add> renderer.getClearColor( this.oldClearColor ); <ide> oldClearAlpha = renderer.getClearAlpha(); <ide> <ide> renderer.setClearColor( this.clearColor, this.clearAlpha ); <ide> THREE.ClearPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ) <ide> <ide> if ( this.clearColor ) { <ide> <del> renderer.setClearColor( oldClearColor, oldClearAlpha ); <add> renderer.setClearColor( this.oldClearColor, oldClearAlpha ); <ide> <ide> } <ide> <ide><path>examples/js/postprocessing/RenderPass.js <ide> THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clear <ide> this.clear = true; <ide> this.clearDepth = false; <ide> this.needsSwap = false; <add> this.oldClearColor = new THREE.Color(); <ide> <ide> }; <ide> <ide> THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype <ide> var oldAutoClear = renderer.autoClear; <ide> renderer.autoClear = false; <ide> <del> var oldClearColor, oldClearAlpha, oldOverrideMaterial; <add> var oldClearAlpha, oldOverrideMaterial; <ide> <ide> if ( this.overrideMaterial !== undefined ) { <ide> <ide> THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype <ide> <ide> if ( this.clearColor ) { <ide> <del> oldClearColor = renderer.getClearColor().getHex(); <add> renderer.getClearColor( this.oldClearColor ); <ide> oldClearAlpha = renderer.getClearAlpha(); <ide> <ide> renderer.setClearColor( this.clearColor, this.clearAlpha ); <ide> THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype <ide> <ide> if ( this.clearColor ) { <ide> <del> renderer.setClearColor( oldClearColor, oldClearAlpha ); <add> renderer.setClearColor( this.oldClearColor, oldClearAlpha ); <ide> <ide> } <ide> <ide><path>examples/js/postprocessing/SSAARenderPass.js <ide> THREE.SSAARenderPass = function ( scene, camera, clearColor, clearAlpha ) { <ide> // as we need to clear the buffer in this pass, clearColor must be set to something, defaults to black. <ide> this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000; <ide> this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0; <add> this.oldClearColor = new THREE.Color(); <ide> <ide> if ( THREE.CopyShader === undefined ) console.error( "THREE.SSAARenderPass relies on THREE.CopyShader" ); <ide> <ide> THREE.SSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.protot <ide> var autoClear = renderer.autoClear; <ide> renderer.autoClear = false; <ide> <del> var oldClearColor = renderer.getClearColor().getHex(); <add> renderer.getClearColor( this.oldClearColor ); <ide> var oldClearAlpha = renderer.getClearAlpha(); <ide> <ide> var baseSampleWeight = 1.0 / jitterOffsets.length; <ide> THREE.SSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.protot <ide> if ( this.camera.clearViewOffset ) this.camera.clearViewOffset(); <ide> <ide> renderer.autoClear = autoClear; <del> renderer.setClearColor( oldClearColor, oldClearAlpha ); <add> renderer.setClearColor( this.oldClearColor, oldClearAlpha ); <ide> <ide> } <ide>
3
Go
Go
move names to a more appropriate package
22b246417f52aa6bd0e358e41e2bfb9c0a59c867
<ide><path>daemon/checkpoint.go <ide> import ( <ide> "os" <ide> "path/filepath" <ide> <del> "github.com/docker/docker/api" <ide> "github.com/docker/docker/api/types" <add> "github.com/docker/docker/daemon/names" <ide> ) <ide> <ide> var ( <del> validCheckpointNameChars = api.RestrictedNameChars <del> validCheckpointNamePattern = api.RestrictedNamePattern <add> validCheckpointNameChars = names.RestrictedNameChars <add> validCheckpointNamePattern = names.RestrictedNamePattern <ide> ) <ide> <ide> // getCheckpointDir verifies checkpoint directory for create,remove, list options and checks if checkpoint already exists <ide><path>daemon/names.go <ide> import ( <ide> "fmt" <ide> "strings" <ide> <del> "github.com/docker/docker/api" <ide> "github.com/docker/docker/container" <add> "github.com/docker/docker/daemon/names" <ide> "github.com/docker/docker/pkg/namesgenerator" <ide> "github.com/docker/docker/pkg/stringid" <ide> "github.com/pkg/errors" <ide> "github.com/sirupsen/logrus" <ide> ) <ide> <ide> var ( <del> validContainerNameChars = api.RestrictedNameChars <del> validContainerNamePattern = api.RestrictedNamePattern <add> validContainerNameChars = names.RestrictedNameChars <add> validContainerNamePattern = names.RestrictedNamePattern <ide> ) <ide> <ide> func (daemon *Daemon) registerName(container *container.Container) error { <add><path>daemon/names/names.go <del><path>api/names.go <del>package api <add>package names <ide> <ide> import "regexp" <ide> <ide><path>volume/local/local.go <ide> import ( <ide> "strings" <ide> "sync" <ide> <del> "github.com/docker/docker/api" <add> "github.com/docker/docker/daemon/names" <ide> "github.com/docker/docker/pkg/idtools" <ide> "github.com/docker/docker/pkg/mount" <ide> "github.com/docker/docker/volume" <ide> var ( <ide> // volumeNameRegex ensures the name assigned for the volume is valid. <ide> // This name is used to create the bind directory, so we need to avoid characters that <ide> // would make the path to escape the root directory. <del> volumeNameRegex = api.RestrictedNamePattern <add> volumeNameRegex = names.RestrictedNamePattern <ide> ) <ide> <ide> type activeMount struct { <ide> func (r *Root) validateName(name string) error { <ide> return validationError("volume name is too short, names should be at least two alphanumeric characters") <ide> } <ide> if !volumeNameRegex.MatchString(name) { <del> return validationError(fmt.Sprintf("%q includes invalid characters for a local volume name, only %q are allowed. If you intended to pass a host directory, use absolute path", name, api.RestrictedNameChars)) <add> return validationError(fmt.Sprintf("%q includes invalid characters for a local volume name, only %q are allowed. If you intended to pass a host directory, use absolute path", name, names.RestrictedNameChars)) <ide> } <ide> return nil <ide> }
4
Ruby
Ruby
join values using '; ' as per rfc spec
89df021375564fd613de646c53fa90b2d1eb7fb1
<ide><path>actionpack/lib/action_dispatch/middleware/cookies.rb <ide> def update_cookies_from_jar <ide> end <ide> <ide> def to_header <del> @cookies.map { |k,v| "#{escape(k)}=#{escape(v)}" }.join ';' <add> @cookies.map { |k,v| "#{escape(k)}=#{escape(v)}" }.join '; ' <ide> end <ide> <ide> def handle_options(options) #:nodoc:
1
Python
Python
add dataset read permission to viewer role
fd7d9c4669bb090524fb01bd7152cdb99e55396d
<ide><path>airflow/www/security.py <ide> class AirflowSecurityManager(SecurityManager, LoggingMixin): <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_DEPENDENCIES), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_CODE), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_RUN), <add> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DATASET), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_IMPORT_ERROR), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_WARNING), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_JOB), <ide><path>tests/www/test_security.py <ide> def test_get_user_roles_for_anonymous_user(app, security_manager): <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_DEPENDENCIES), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_CODE), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_RUN), <add> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DATASET), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_IMPORT_ERROR), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_WARNING), <ide> (permissions.ACTION_CAN_READ, permissions.RESOURCE_JOB),
2
Go
Go
remove mountedlayer mount and unmount
8bb4d31b10e4c3abee9ca92535461859bbf25d46
<ide><path>daemon/daemon.go <ide> func (daemon *Daemon) restore() error { <ide> defer wg.Done() <ide> rm := c.RestartManager(false) <ide> if c.IsRunning() || c.IsPaused() { <del> // Fix activityCount such that graph mounts can be unmounted later <del> if err := daemon.layerStore.ReinitRWLayer(c.RWLayer); err != nil { <del> logrus.Errorf("Failed to ReinitRWLayer for %s due to %s", c.ID, err) <del> return <del> } <ide> if err := daemon.containerd.Restore(c.ID, libcontainerd.WithRestartManager(rm)); err != nil { <ide> logrus.Errorf("Failed to restore with containerd: %q", err) <ide> return <ide><path>daemon/graphdriver/windows/windows.go <ide> import ( <ide> "time" <ide> "unsafe" <ide> <add> "github.com/Microsoft/go-winio" <ide> "github.com/Microsoft/go-winio/archive/tar" <ide> "github.com/Microsoft/go-winio/backuptar" <ide> "github.com/Microsoft/hcsshim" <ide> import ( <ide> "github.com/docker/docker/pkg/longpath" <ide> "github.com/docker/docker/pkg/reexec" <ide> "github.com/docker/docker/pkg/system" <del> "github.com/docker/docker/vendor/src/github.com/Microsoft/go-winio" <ide> "github.com/vbatts/tar-split/tar/storage" <ide> ) <ide> <ide><path>daemon/graphdriver/zfs/zfs.go <ide> func Init(base string, opt []string, uidMaps, gidMaps []idtools.IDMap) (graphdri <ide> filesystemsCache: filesystemsCache, <ide> uidMaps: uidMaps, <ide> gidMaps: gidMaps, <del> ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(graphdriver.FsMagicZfs)), <add> ctr: graphdriver.NewRefCounter(graphdriver.NewDefaultChecker()), <ide> } <ide> return graphdriver.NewNaiveDiffDriver(d, uidMaps, gidMaps), nil <ide> } <ide><path>distribution/xfer/download_test.go <ide> func (ls *mockLayerStore) GetMountID(string) (string, error) { <ide> return "", errors.New("not implemented") <ide> } <ide> <del>func (ls *mockLayerStore) ReinitRWLayer(layer.RWLayer) error { <del> return errors.New("not implemented") <del>} <del> <ide> func (ls *mockLayerStore) Cleanup() error { <ide> return nil <ide> } <ide><path>layer/layer.go <ide> type Store interface { <ide> CreateRWLayer(id string, parent ChainID, mountLabel string, initFunc MountInit, storageOpt map[string]string) (RWLayer, error) <ide> GetRWLayer(id string) (RWLayer, error) <ide> GetMountID(id string) (string, error) <del> ReinitRWLayer(l RWLayer) error <ide> ReleaseRWLayer(RWLayer) ([]Metadata, error) <ide> <ide> Cleanup() error <ide><path>layer/layer_store.go <ide> func (ls *layerStore) GetMountID(id string) (string, error) { <ide> return mount.mountID, nil <ide> } <ide> <del>// ReinitRWLayer reinitializes a given mount to the layerstore, specifically <del>// initializing the usage count. It should strictly only be used in the <del>// daemon's restore path to restore state of live containers. <del>func (ls *layerStore) ReinitRWLayer(l RWLayer) error { <del> ls.mountL.Lock() <del> defer ls.mountL.Unlock() <del> <del> if _, ok := ls.mounts[l.Name()]; !ok { <del> return ErrMountDoesNotExist <del> } <del> return nil <del>} <del> <ide> func (ls *layerStore) ReleaseRWLayer(l RWLayer) ([]Metadata, error) { <ide> ls.mountL.Lock() <ide> defer ls.mountL.Unlock() <ide><path>layer/layer_test.go <ide> func getCachedLayer(l Layer) *roLayer { <ide> } <ide> <ide> func getMountLayer(l RWLayer) *mountedLayer { <del> if rl, ok := l.(*referencedRWLayer); ok { <del> return rl.mountedLayer <del> } <del> return l.(*mountedLayer) <add> return l.(*referencedRWLayer).mountedLayer <ide> } <ide> <ide> func createMetadata(layers ...Layer) []Metadata { <ide><path>layer/mounted_layer.go <ide> func (ml *mountedLayer) Parent() Layer { <ide> return nil <ide> } <ide> <del>func (ml *mountedLayer) Mount(mountLabel string) (string, error) { <del> return ml.layerStore.driver.Get(ml.mountID, mountLabel) <del>} <del> <del>func (ml *mountedLayer) Unmount() error { <del> return ml.layerStore.driver.Put(ml.mountID) <del>} <del> <ide> func (ml *mountedLayer) Size() (int64, error) { <ide> return ml.layerStore.driver.DiffSize(ml.mountID, ml.cacheParent()) <ide> } <ide> type referencedRWLayer struct { <ide> } <ide> <ide> func (rl *referencedRWLayer) Mount(mountLabel string) (string, error) { <del> return rl.mountedLayer.Mount(mountLabel) <add> return rl.layerStore.driver.Get(rl.mountedLayer.mountID, mountLabel) <ide> } <ide> <ide> // Unmount decrements the activity count and unmounts the underlying layer <ide> // Callers should only call `Unmount` once per call to `Mount`, even on error. <ide> func (rl *referencedRWLayer) Unmount() error { <del> return rl.mountedLayer.Unmount() <add> return rl.layerStore.driver.Put(rl.mountedLayer.mountID) <ide> }
8
Ruby
Ruby
use a local instead of an instance variable
4851b1e7a877246d57ca87e9e48b7d962f100015
<ide><path>Library/Homebrew/formula.rb <ide> def verify_download_integrity fn <ide> end <ide> <ide> def run_test <del> @oldhome = ENV["HOME"] <add> old_home = ENV["HOME"] <ide> self.build = Tab.for_formula(self) <ide> mktemp do <ide> @testpath = Pathname.pwd <ide> def run_test <ide> end <ide> ensure <ide> @testpath = nil <del> ENV["HOME"] = @oldhome <add> ENV["HOME"] = old_home <ide> end <ide> <ide> def test_defined?
1
PHP
PHP
remove unused imports
53564916cd38cd7b67d4f966b17ba2f96f929eda
<ide><path>src/Illuminate/Broadcasting/BroadcastEvent.php <ide> use ReflectionProperty; <ide> use Illuminate\Support\Arr; <ide> use Illuminate\Bus\Queueable; <del>use Illuminate\Contracts\Queue\Job; <ide> use Illuminate\Contracts\Queue\ShouldQueue; <ide> use Illuminate\Contracts\Support\Arrayable; <ide> use Illuminate\Contracts\Broadcasting\Broadcaster; <ide><path>src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php <ide> use ReflectionFunction; <ide> use Illuminate\Support\Str; <ide> use Illuminate\Container\Container; <del>use Illuminate\Database\Eloquent\Model; <ide> use Illuminate\Contracts\Routing\UrlRoutable; <ide> use Illuminate\Contracts\Routing\BindingRegistrar; <ide> use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; <ide><path>src/Illuminate/Cache/DatabaseStore.php <ide> <ide> use Closure; <ide> use Exception; <del>use Illuminate\Support\Carbon; <ide> use Illuminate\Contracts\Cache\Store; <ide> use Illuminate\Support\InteractsWithTime; <ide> use Illuminate\Database\ConnectionInterface; <ide><path>src/Illuminate/Foundation/Console/OptimizeCommand.php <ide> namespace Illuminate\Foundation\Console; <ide> <ide> use Illuminate\Console\Command; <del>use Illuminate\Support\Composer; <ide> use Symfony\Component\Console\Input\InputOption; <ide> <ide> class OptimizeCommand extends Command <ide><path>src/Illuminate/Foundation/Testing/TestResponse.php <ide> use Illuminate\Contracts\View\View; <ide> use Illuminate\Support\Traits\Macroable; <ide> use PHPUnit\Framework\Assert as PHPUnit; <del>use Symfony\Component\HttpFoundation\Cookie; <ide> <ide> /** <ide> * @mixin \Illuminate\Http\Response <ide><path>src/Illuminate/Http/Resources/CollectsResources.php <ide> namespace Illuminate\Http\Resources; <ide> <ide> use Illuminate\Support\Str; <del>use Illuminate\Support\Collection; <ide> use Illuminate\Pagination\AbstractPaginator; <ide> <ide> trait CollectsResources <ide><path>src/Illuminate/Http/Resources/Json/ResourceCollection.php <ide> namespace Illuminate\Http\Resources\Json; <ide> <ide> use IteratorAggregate; <del>use Illuminate\Support\Collection; <ide> use Illuminate\Pagination\AbstractPaginator; <ide> use Illuminate\Http\Resources\CollectsResources; <ide>
7
Text
Text
remove unnecessary inline code tag in challenge
35a8f555151b03b2cb0600d590ebbfee38965068
<ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-operator.md <ide> dashedName: comparison-with-the-greater-than-operator <ide> <ide> The greater than operator (`>`) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns `true`. Otherwise, it returns `false`. <ide> <del>Like the equality operator, greater than operator will convert data types of values while comparing. <add>Like the equality operator, the greater than operator will convert data types of values while comparing. <ide> <ide> **Examples** <ide> <ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.md <ide> dashedName: comparison-with-the-greater-than-or-equal-to-operator <ide> <ide> The greater than or equal to operator (`>=`) compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns `true`. Otherwise, it returns `false`. <ide> <del>Like the equality operator, the `>=` will convert data types while comparing. <add>Like the equality operator, the greater than or equal to operator will convert data types while comparing. <ide> <ide> **Examples** <ide> <ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.md <ide> dashedName: comparison-with-the-less-than-operator <ide> <ide> # --description-- <ide> <del>The <dfn>less than</dfn> operator (`<`) compares the values of two numbers. If the number to the left is less than the number to the right, it returns `true`. Otherwise, it returns `false`. Like the equality operator, <dfn>less than</dfn> operator converts data types while comparing. <add>The less than operator (`<`) compares the values of two numbers. If the number to the left is less than the number to the right, it returns `true`. Otherwise, it returns `false`. Like the equality operator, the less than operator converts data types while comparing. <ide> <ide> **Examples** <ide> <ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.md <ide> dashedName: comparison-with-the-less-than-or-equal-to-operator <ide> <ide> # --description-- <ide> <del>The less than or equal to operator (`<=`) compares the values of two numbers. If the number to the left is less than or equal to the number to the right, it returns `true`. If the number on the left is greater than the number on the right, it returns `false`. Like the equality operator, `less than or equal to` converts data types. <add>The less than or equal to operator (`<=`) compares the values of two numbers. If the number to the left is less than or equal to the number to the right, it returns `true`. If the number on the left is greater than the number on the right, it returns `false`. Like the equality operator, the less than or equal to operator converts data types. <ide> <ide> **Examples** <ide> <ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md <ide> dashedName: comparison-with-the-strict-inequality-operator <ide> <ide> # --description-- <ide> <del>The strict inequality operator (`!==`) is the logical opposite of the strict equality operator. It means "Strictly Not Equal" and returns `false` where strict equality would return `true` and *vice versa*. Strict inequality will not convert data types. <add>The strict inequality operator (`!==`) is the logical opposite of the strict equality operator. It means "Strictly Not Equal" and returns `false` where strict equality would return `true` and *vice versa*. The strict inequality operator will not convert data types. <ide> <ide> **Examples** <ide>
5
PHP
PHP
add withoutexceptionhandling method for testing
a171f44594c248afe066fee74fad640765b12da0
<ide><path>src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php <add><?php <add> <add>namespace Illuminate\Foundation\Testing\Concerns; <add> <add>use Exception; <add>use Illuminate\Contracts\Debug\ExceptionHandler; <add>use Symfony\Component\Console\Application as ConsoleApplication; <add> <add>trait InteractsWithExceptionHandling <add>{ <add> /** <add> * The previous exception handler. <add> * <add> * @var ExceptionHandler|null <add> */ <add> protected $previousExceptionHandler; <add> <add> /** <add> * Restore exception handling. <add> * <add> * @return $this <add> */ <add> protected function withExceptionHandling() <add> { <add> if ($this->previousExceptionHandler) { <add> $this->app->instance(ExceptionHandler::class, $this->previousExceptionHandler); <add> } <add> <add> return $this; <add> } <add> <add> /** <add> * Disable exception handling for the test. <add> * <add> * @return $this <add> */ <add> protected function withoutExceptionHandling() <add> { <add> $this->previousExceptionHandler = app(ExceptionHandler::class); <add> <add> $this->app->instance(ExceptionHandler::class, new class implements ExceptionHandler { <add> public function __construct() {} <add> public function report(Exception $e) {} <add> public function render($request, Exception $e) { <add> throw $e; <add> } <add> public function renderForConsole($output, Exception $e) { <add> (new ConsoleApplication)->renderException($e, $output); <add> } <add> }); <add> <add> return $this; <add> } <add>} <ide><path>src/Illuminate/Foundation/Testing/TestCase.php <ide> abstract class TestCase extends BaseTestCase <ide> Concerns\InteractsWithAuthentication, <ide> Concerns\InteractsWithConsole, <ide> Concerns\InteractsWithDatabase, <add> Concerns\InteractsWithExceptionHandling, <ide> Concerns\InteractsWithSession, <ide> Concerns\MocksApplicationServices; <ide>
2
Javascript
Javascript
remove final traces of examples from the tree
1293cc88cd3d2e72c55fa8b8d268fab246e79fed
<ide><path>angularFiles.js <ide> angularFiles = { <ide> '@angularSrcModules', <ide> '@angularScenario', <ide> '@angularTest', <del> 'example/personalLog/*.js', <del> 'example/personalLog/test/*.js' <ide> ], <ide> <ide> 'karmaExclude': [ <ide> angularFiles = { <ide> '@angularSrcModules', <ide> '@angularScenario', <ide> '@angularTest', <del> 'example/personalLog/*.js', <del> <del> 'example/personalLog/test/*.js' <ide> ], <ide> <ide> 'karmaJqueryExclude': [
1
Python
Python
avoid 500 on dag redirect
c550bbf7ffe36cafae75f01f1a6f60b169ceb111
<ide><path>airflow/www/views.py <ide> def success(self): <ide> @action_logging <ide> def dag(self, dag_id): <ide> """Redirect to default DAG view.""" <del> return redirect(url_for('Airflow.grid', dag_id=dag_id, **request.args)) <add> kwargs = {**request.args, "dag_id": dag_id} <add> return redirect(url_for('Airflow.grid', **kwargs)) <ide> <ide> @expose('/legacy_tree') <ide> @auth.has_access(
1
Python
Python
upgrade version to 3.2.0
78053c7e6c258f9ff64e418ef5cfde932ecdeabb
<ide><path>rest_framework/__init__.py <ide> """ <ide> <ide> __title__ = 'Django REST framework' <del>__version__ = '3.1.3' <add>__version__ = '3.2.0' <ide> __author__ = 'Tom Christie' <ide> __license__ = 'BSD 2-Clause' <ide> __copyright__ = 'Copyright 2011-2015 Tom Christie'
1
Python
Python
use default_algorithm constant
5e1522c98df9d4c199a88f26aed636ad48bb75d8
<ide><path>libcloud/loadbalancer/drivers/gogrid.py <ide> def ex_create_balancer_nowait(self, name, members, protocol='http', port=80, <ide> return self._to_balancers(resp.object)[0] <ide> <ide> def create_balancer(self, name, members, protocol='http', port=80, <del> algorithm=Algorithm.ROUND_ROBIN): <add> algorithm=DEFAULT_ALGORITHM): <ide> balancer = self.ex_create_balancer_nowait(name, members, protocol, <ide> port, algorithm) <ide>
1
Ruby
Ruby
install bundler gems
1182440f80ff665566e965e90d195195ebba6e8a
<ide><path>Library/Homebrew/livecheck/strategy/sparkle.rb <ide> def self.match?(url) <ide> <ide> sig { params(content: String).returns(T.nilable(Item)) } <ide> def self.item_from_content(content) <add> Homebrew.install_bundler_gems! <ide> require "nokogiri" <ide> <ide> xml = Nokogiri::XML(content)
1
Ruby
Ruby
simplify accessibility access disable warnings
3c31e29d5c46720ed51b7a75a863e2ff4577439f
<ide><path>Library/Homebrew/cask/lib/hbc/installer.rb <ide> def enable_accessibility_access <ide> <ide> def disable_accessibility_access <ide> return unless @cask.accessibility_access <del> if MacOS.version <= :mountain_lion <del> opoo <<-EOS.undent <del> Accessibility access was enabled for #{@cask}, but it is not safe to disable <del> automatically on this version of macOS. See System Preferences. <del> EOS <del> elsif MacOS.version <= :el_capitan <add> if MacOS.version >= :mavericks && MacOS.version <= :el_capitan <ide> ohai "Disabling accessibility access" <ide> @command.run!("/usr/bin/sqlite3", <ide> args: [
1
Python
Python
remove main clause
c7db85e5baf133a55adbd668dd9d963a4e73c6a8
<ide><path>numpy/core/getlimits.py <ide> def __repr__(self): <ide> return "%s(min=%s, max=%s, dtype=%s)" % (self.__class__.__name__, <ide> self.min, self.max, self.dtype) <ide> <del>if __name__ == '__main__': <del> f = finfo(ntypes.single) <del> print('single epsilon:', f.eps) <del> print('single tiny:', f.tiny) <del> f = finfo(ntypes.float) <del> print('float epsilon:', f.eps) <del> print('float tiny:', f.tiny) <del> f = finfo(ntypes.longfloat) <del> print('longfloat epsilon:', f.eps) <del> print('longfloat tiny:', f.tiny)
1
Javascript
Javascript
add type checks to once
d1b4dcd6acb1d1c66e423f7992dc6eec8a35c544
<ide><path>lib/events.js <ide> EventEmitter.prototype.addListener = function(type, listener) { <ide> EventEmitter.prototype.on = EventEmitter.prototype.addListener; <ide> <ide> EventEmitter.prototype.once = function(type, listener) { <del> if ('function' !== typeof listener) { <del> throw TypeError('.once only takes instances of Function'); <del> } <add> if (typeof type !== 'string') <add> throw TypeError('type must be a string'); <add> if (typeof listener !== 'function') <add> throw TypeError('listener must be a function'); <ide> <del> var self = this; <ide> function g() { <del> self.removeListener(type, g); <add> this.removeListener(type, g); <ide> listener.apply(this, arguments); <del> }; <add> } <ide> <ide> g.listener = listener; <del> self.on(type, g); <add> this.on(type, g); <ide> <ide> return this; <ide> };
1
Text
Text
fix typo in documentation
41def26c1b762b89d3dd0cb3339435f1144320ce
<ide><path>docs/reference/logging/index.md <ide> a `syslog-tag` option <ide> <ide> ## Specify journald options <ide> <del>The `journald` logging driver sotres the container id in the journal's `CONTAINER_ID` field. For detailed information on <add>The `journald` logging driver stores the container id in the journal's `CONTAINER_ID` field. For detailed information on <ide> working with this logging driver, see [the journald logging driver](/reference/logging/journald/) <ide> reference documentation. <ide>
1
Ruby
Ruby
add some os cop comments/exceptions
ebc4cce4569acc946a5078e672021c05bcad6e4c
<ide><path>Library/Homebrew/rubocops/lines.rb <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> block_node = offending_node.parent <ide> next if block_node.type != :block <ide> <add> # TODO: could fix corrector to handle this but punting for now. <add> next if block_node.single_line? <add> <ide> source_range = offending_node.source_range.join(offending_node.parent.loc.begin) <ide> corrector.replace(source_range, if_method_and_class) <ide> end <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> block_node = offending_node.parent <ide> next if block_node.type != :block <ide> <add> # TODO: could fix corrector to handle this but punting for now. <add> next if block_node.single_line? <add> <ide> source_range = offending_node.source_range.join(offending_node.parent.loc.begin) <ide> corrector.replace(source_range, if_method_and_class) <ide> end <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> problem "Don't use '#{if_method_and_class}', use '#{on_method_name} do' instead." do |corrector| <ide> if_node = method.parent <ide> next if if_node.type != :if <add> <add> # TODO: could fix corrector to handle this but punting for now. <ide> next if if_node.unless? <ide> <ide> corrector.replace(if_node.source_range, "#{on_method_name} do\n#{if_node.body.source}\nend")
1
PHP
PHP
create schema with constraints disabled
13d287aa29875d73dc806eb9ba828b391950cbe6
<ide><path>src/TestSuite/Schema/SchemaGenerator.php <ide> public function reload(?array $tables = null): void <ide> throw new RuntimeException("The `{$this->connection}` connection is not a Cake\Database\Connection"); <ide> } <ide> <del> foreach ($config as $metadata) { <del> $table = new TableSchema($metadata['table'], $metadata['columns']); <del> if (isset($metadata['indexes'])) { <del> foreach ($metadata['indexes'] as $key => $index) { <del> $table->addIndex($key, $index); <add> $connection->disableConstraints(function ($connection) use ($config) { <add> foreach ($config as $metadata) { <add> $table = new TableSchema($metadata['table'], $metadata['columns']); <add> if (isset($metadata['indexes'])) { <add> foreach ($metadata['indexes'] as $key => $index) { <add> $table->addIndex($key, $index); <add> } <ide> } <del> } <del> if (isset($metadata['constraints'])) { <del> foreach ($metadata['constraints'] as $key => $index) { <del> $table->addConstraint($key, $index); <add> if (isset($metadata['constraints'])) { <add> foreach ($metadata['constraints'] as $key => $index) { <add> $table->addConstraint($key, $index); <add> } <add> } <add> // Generate SQL for each table. <add> $stmts = $table->createSql($connection); <add> foreach ($stmts as $stmt) { <add> $connection->execute($stmt); <ide> } <ide> } <del> // Generate SQL for each table. <del> $stmts = $table->createSql($connection); <del> foreach ($stmts as $stmt) { <del> $connection->execute($stmt); <del> } <del> } <add> }); <ide> } <ide> }
1
Text
Text
add v3.23.0-beta.5 to changelog
70fffeaa6320cc84455a1367fd1c84f89d30151b
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### v3.23.0-beta.5 (November 9, 2020) <add> <add>- [#19249](https://github.com/emberjs/ember.js/pull/19249) [BUGFIX] Fix bugs in query params with intermediate transitions <add> <ide> ### v3.23.0-beta.4 (November 2, 2020) <ide> <ide> - [#19142](https://github.com/emberjs/ember.js/pull/19142) [BUGFIX] Fix App booting before DOM ready without jQuery
1
Javascript
Javascript
add more info about transform function
49128cc1005f0bea6074107c1098b6866eed74f5
<ide><path>src/ng/http.js <ide> function $HttpProvider() { <ide> * - if XSRF prefix is detected, strip it (see Security Considerations section below) <ide> * - if json response is detected, deserialize it using a JSON parser <ide> * <del> * To override these transformation locally, specify transform functions as `transformRequest` <del> * and/or `transformResponse` properties of the config object. To globally override the default <del> * transforms, override the `$httpProvider.defaults.transformRequest` and <del> * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. <add> * To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and <add> * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. These properties are by default an <add> * array of transform functions, which allows you to `push` or `unshift` a new transformation function into the <add> * transformation chain. You can also decide to completely override any default transformations by assigning your <add> * transformation functions to these properties directly without the array wrapper. <add> * <add> * Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or <add> * `transformResponse` properties of the config object passed into `$http`. <ide> * <ide> * <ide> * # Caching
1
Ruby
Ruby
convert translation key to string as necessary
2c555c8d60e2f33a71fbfb416a45beafc6f2b54f
<ide><path>actionview/lib/action_view/helpers/translation_helper.rb <ide> module TranslationHelper <ide> # <ide> def translate(key, **options) <ide> return key.map { |k| translate(k, **options) } if key.is_a?(Array) <add> key = key.to_s unless key.is_a?(Symbol) <ide> <ide> alternatives = if options.key?(:default) <ide> options[:default].is_a?(Array) ? options.delete(:default).compact : [options.delete(:default)] <ide><path>actionview/test/template/translation_helper_test.rb <ide> def test_delegates_localize_to_i18n <ide> assert_equal "Tue, 08 Jul 2008 12:18:38 +0000", localize(@time, locale: "en") <ide> end <ide> <add> def test_converts_key_to_string_as_necessary <add> key = Struct.new(:to_s).new("translations.foo") <add> assert_equal "Foo", translate(key) <add> assert_equal key, translate(:"translations.missing", default: key) <add> end <add> <ide> def test_returns_missing_translation_message_without_span_wrap <ide> old_value = ActionView::Base.debug_missing_translation <ide> ActionView::Base.debug_missing_translation = false
2
Java
Java
add exception message in singlefromcallable
0b038babbabc6ec8a7e2c654ab6832680fa49420
<ide><path>src/main/java/io/reactivex/internal/operators/single/SingleFromCallable.java <ide> protected void subscribeActual(SingleObserver<? super T> s) { <ide> if (v != null) { <ide> s.onSuccess(v); <ide> } else { <del> s.onError(new NullPointerException()); <add> s.onError(new NullPointerException("The callable returned a null value")); <ide> } <ide> } catch (Throwable e) { <ide> Exceptions.throwIfFatal(e);
1
Javascript
Javascript
fix bad merge
3ec4af941390800bd317579bd0ae34d3fc309569
<ide><path>test/ng/parseSpec.js <ide> describe('parser', function() { <ide> })); <ide> <ide> <add> it('should NOT allow access to the Window or DOM returned from a function', inject(function($window, $document) { <add> scope.getWin = valueFn($window); <add> scope.getDoc = valueFn($document); <add> <ide> expect(function() { <ide> scope.$eval('getWin()', scope); <ide> }).toThrowMinErr(
1
Go
Go
use monotonic clock for reaping networkdb entries
0a2537eea383472768fd66b91f190e0fb6c1cb97
<ide><path>libnetwork/networkdb/cluster.go <ide> func (nDB *NetworkDB) reconnectNode() { <ide> nDB.bulkSync([]string{node.Name}, true) <ide> } <ide> <add>// For timing the entry deletion in the repaer APIs that doesn't use monotonic clock <add>// source (time.Now, Sub etc.) should be avoided. Hence we use reapTime in every <add>// entry which is set initially to reapInterval and decremented by reapPeriod every time <add>// the reaper runs. NOTE nDB.reapTableEntries updates the reapTime with a readlock. This <add>// is safe as long as no other concurrent path touches the reapTime field. <ide> func (nDB *NetworkDB) reapState() { <ide> nDB.reapNetworks() <ide> nDB.reapTableEntries() <ide> } <ide> <ide> func (nDB *NetworkDB) reapNetworks() { <del> now := time.Now() <ide> nDB.Lock() <ide> for name, nn := range nDB.networks { <ide> for id, n := range nn { <del> if n.leaving && now.Sub(n.leaveTime) > reapInterval { <del> delete(nn, id) <del> nDB.deleteNetworkNode(id, name) <add> if n.leaving { <add> if n.reapTime <= 0 { <add> delete(nn, id) <add> nDB.deleteNetworkNode(id, name) <add> continue <add> } <add> n.reapTime -= reapPeriod <ide> } <ide> } <ide> } <ide> func (nDB *NetworkDB) reapNetworks() { <ide> func (nDB *NetworkDB) reapTableEntries() { <ide> var paths []string <ide> <del> now := time.Now() <del> <ide> nDB.RLock() <ide> nDB.indexes[byTable].Walk(func(path string, v interface{}) bool { <ide> entry, ok := v.(*entry) <ide> if !ok { <ide> return false <ide> } <ide> <del> if !entry.deleting || now.Sub(entry.deleteTime) <= reapInterval { <add> if !entry.deleting { <add> return false <add> } <add> if entry.reapTime > 0 { <add> entry.reapTime -= reapPeriod <ide> return false <ide> } <del> <ide> paths = append(paths, path) <ide> return false <ide> }) <ide><path>libnetwork/networkdb/delegate.go <ide> import ( <ide> "fmt" <ide> "net" <ide> "strings" <del> "time" <ide> <ide> "github.com/Sirupsen/logrus" <ide> "github.com/gogo/protobuf/proto" <ide> func (nDB *NetworkDB) handleNetworkEvent(nEvent *NetworkEvent) bool { <ide> n.ltime = nEvent.LTime <ide> n.leaving = nEvent.Type == NetworkEventTypeLeave <ide> if n.leaving { <del> n.leaveTime = time.Now() <add> n.reapTime = reapInterval <ide> } <ide> <ide> nDB.addNetworkNode(nEvent.NetworkID, nEvent.NodeName) <ide> func (nDB *NetworkDB) handleTableEvent(tEvent *TableEvent) bool { <ide> } <ide> <ide> if e.deleting { <del> e.deleteTime = time.Now() <add> e.reapTime = reapInterval <ide> } <ide> <ide> nDB.Lock() <ide><path>libnetwork/networkdb/networkdb.go <ide> type network struct { <ide> // Node leave is in progress. <ide> leaving bool <ide> <del> // The time this node knew about the node's network leave. <del> leaveTime time.Time <add> // Number of seconds still left before a deleted network entry gets <add> // removed from networkDB <add> reapTime time.Duration <ide> <ide> // The broadcast queue for table event gossip. This is only <ide> // initialized for this node's network attachment entries. <ide> type entry struct { <ide> // the cluster for certain amount of time after deletion. <ide> deleting bool <ide> <del> // The wall clock time when this node learned about this deletion. <del> deleteTime time.Time <add> // Number of seconds still left before a deleted table entry gets <add> // removed from networkDB <add> reapTime time.Duration <ide> } <ide> <ide> // New creates a new instance of NetworkDB using the Config passed by <ide> func (nDB *NetworkDB) DeleteEntry(tname, nid, key string) error { <ide> } <ide> <ide> entry := &entry{ <del> ltime: nDB.tableClock.Increment(), <del> node: nDB.config.NodeName, <del> value: value, <del> deleting: true, <del> deleteTime: time.Now(), <add> ltime: nDB.tableClock.Increment(), <add> node: nDB.config.NodeName, <add> value: value, <add> deleting: true, <add> reapTime: reapInterval, <ide> } <ide> <ide> if err := nDB.sendTableEvent(TableEventTypeDelete, nid, tname, key, entry); err != nil { <ide> func (nDB *NetworkDB) deleteNodeTableEntries(node string) { <ide> key := params[2] <ide> <ide> entry := &entry{ <del> ltime: oldEntry.ltime, <del> node: node, <del> value: oldEntry.value, <del> deleting: true, <del> deleteTime: time.Now(), <add> ltime: oldEntry.ltime, <add> node: node, <add> value: oldEntry.value, <add> deleting: true, <add> reapTime: reapInterval, <ide> } <ide> <ide> nDB.indexes[byTable].Insert(fmt.Sprintf("/%s/%s/%s", tname, nid, key), entry)
3
Ruby
Ruby
add brew pull for easy integration of user patches
7933bd4e657ee82207914683d0e689c48465d83a
<ide><path>Library/Contributions/examples/brew-pull.rb <add># Gets a patch from a GitHub commit or pull request and applies it to Homebrew. <add># Optionally, installs it too. <add> <add>require 'utils.rb' <add> <add>if ARGV.empty? <add> puts 'This command requires at least one URL argument' <add> exit 1 <add>end <add> <add>if ARGV.include? '--install' <add> ARGV.delete '--install' <add> install = true <add>end <add> <add>HOMEBREW_REPOSITORY.cd do <add> ARGV.each do|arg| <add> # This regex should work, if it's too precise, feel free to fix it. <add> if !arg.match 'https:\/\/github.com\/\w+\/homebrew\/(pull\/\d+|commit\/\w{40})' <add> ohai 'Ignoring URL:', "Not a GitHub pull request or commit: #{arg}" <add> next <add> end <add> <add> # GitHub provides commits'/pull-requests' raw patches using this URL. <add> url = arg + '.patch' <add> <add> # The cache directory seems like a good place to put patches. <add> patchpath = (HOMEBREW_CACHE+File.basename(url)) <add> curl url, '-o', patchpath <add> <add> # Makes sense to squash whitespace errors, we don't want them. <add> ohai 'Applying patch' <add> safe_system 'git', 'am', '--signoff', '--whitespace=fix', patchpath <add> <add> ohai 'Patch changed:' <add> safe_system 'git', 'diff', 'HEAD~1', '--stat' <add> <add> if install <add> status, filename = `git diff HEAD~1 --name-status`.split() <add> # Don't try and do anything to removed files. <add> if status == 'A' or status == 'M' <add> formula = File.basename(filename, '.rb') <add> ohai "Installing #{formula}" <add> # Not sure if this is the best way to install? <add> safe_system 'brew', 'install', '--force', formula <add> end <add> end <add> end <add>end <ide>\ No newline at end of file
1
Text
Text
use const instead of var (es6 best practices)
a0c32cb629f88deb50fca5f8a8650ab133172e55
<ide><path>docs/docs/05-reusable-components.it-IT.md <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> Oppure usando la nuova sintassi freccia di ES6: <ide> <ide> ```javascript <del>var HelloMessage = (props) => <div>Ciao {props.name}</div>; <add>const HelloMessage = (props) => <div>Ciao {props.name}</div>; <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> ``` <ide> <ide><path>docs/docs/05-reusable-components.ko-KR.md <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> 아니면 ES6의 화살표 문법을 사용할 수 있습니다. <ide> <ide> ```javascript <del>var HelloMessage = (props) => <div>Hello {props.name}</div>; <add>const HelloMessage = (props) => <div>Hello {props.name}</div>; <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> ``` <ide> <ide><path>docs/docs/05-reusable-components.md <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> Or using the new ES6 arrow syntax: <ide> <ide> ```javascript <del>var HelloMessage = (props) => <div>Hello {props.name}</div>; <add>const HelloMessage = (props) => <div>Hello {props.name}</div>; <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> ``` <ide> <ide><path>docs/docs/05-reusable-components.zh-CN.md <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> 或者使用新的ES6箭头函数: <ide> <ide> ```javascript <del>var HelloMessage = (props) => <div>Hello {props.name}</div>; <add>const HelloMessage = (props) => <div>Hello {props.name}</div>; <ide> ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode); <ide> ``` <ide>
4
Text
Text
add slack community to support options
5c57cea8049bad5939807e6b849ee303ec8e1526
<ide><path>README.md <ide> search these unofficial resources: <ide> * [Questions tagged 'node.js' on StackOverflow][] <ide> * [#node.js channel on chat.freenode.net][]. See <http://nodeirc.info/> for more <ide> information. <add>* [Node.js Slack Community](https://node-js.slack.com/): Visit <add> [nodeslackers.com](http://www.nodeslackers.com/) to register. <ide> <ide> GitHub issues are meant for tracking enhancements and bugs, not general support. <ide>
1
PHP
PHP
add tapeach() method to lazycollection
c02cd1e04f73b76b5e059a7b5b18fa5b8ba679b7
<ide><path>src/Illuminate/Support/LazyCollection.php <ide> public function take($limit) <ide> return new static(function () use ($original, $limit) { <ide> $iterator = $original->getIterator(); <ide> <del> for (; $iterator->valid() && $limit--; $iterator->next()) { <add> while ($limit--) { <add> if (! $iterator->valid()) { <add> break; <add> } <add> <ide> yield $iterator->key() => $iterator->current(); <add> <add> if ($limit) { <add> $iterator->next(); <add> } <add> } <add> }); <add> } <add> <add> /** <add> * Pass each item in the collection to the given callback, lazily. <add> * <add> * @param callable $callback <add> * @return static <add> */ <add> public function tapEach(callable $callback) <add> { <add> $original = clone $this; <add> <add> return new static(function () use ($original, $callback) { <add> foreach ($original as $key => $value) { <add> $callback($value, $key); <add> <add> yield $key => $value; <ide> } <ide> }); <ide> } <ide><path>tests/Support/SupportLazyCollectionTest.php <add><?php <add> <add>namespace Illuminate\Tests\Support; <add> <add>use PHPUnit\Framework\TestCase; <add>use Illuminate\Support\LazyCollection; <add> <add>class SupportLazyCollectionTest extends TestCase <add>{ <add> public function testTapEach() <add> { <add> $data = LazyCollection::times(10); <add> <add> $tapped = []; <add> <add> $data = $data->tapEach(function ($value, $key) use (&$tapped) { <add> $tapped[$key] = $value; <add> }); <add> <add> $this->assertEmpty($tapped); <add> <add> $data = $data->take(5)->all(); <add> <add> $this->assertSame([1, 2, 3, 4, 5], $data); <add> $this->assertSame([1, 2, 3, 4, 5], $tapped); <add> } <add>}
2
Ruby
Ruby
test actiontext on rails 6.0
67a9a86b1d69367a3270240dad43bc9825ca80a5
<ide><path>actionmailbox/test/dummy/db/migrate/20180212164506_create_active_storage_tables.active_storage.rb <ide> def change <ide> t.datetime :created_at, null: false <ide> <ide> t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true <add> t.foreign_key :active_storage_blobs, column: :blob_id <ide> end <ide> end <ide> end <ide><path>actiontext/test/dummy/config/application.rb <ide> module Dummy <ide> class Application < Rails::Application <ide> # Initialize configuration defaults for originally generated Rails version. <del> config.load_defaults 5.2 <add> config.load_defaults 6.0 <ide> <ide> # Settings in config/environments/* take precedence over those specified here. <ide> # Application configuration can go into files in config/initializers <ide><path>actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb <del>class CreateMessages < ActiveRecord::Migration[5.2] <add>class CreateMessages < ActiveRecord::Migration[6.0] <ide> def change <ide> create_table :messages do |t| <ide> t.string :subject <ide><path>actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb <ide> def change <ide> t.datetime :created_at, null: false <ide> <ide> t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true <add> t.foreign_key :active_storage_blobs, column: :blob_id <ide> end <ide> end <ide> end <ide><path>actiontext/test/dummy/db/migrate/20181003185713_create_people.rb <del>class CreatePeople < ActiveRecord::Migration[5.2] <add>class CreatePeople < ActiveRecord::Migration[6.0] <ide> def change <ide> create_table :people do |t| <ide> t.string :name <ide><path>actiontext/test/template/form_helper_test.rb <ide> class ActionText::FormHelperTest < ActionView::TestCase <ide> <ide> assert_dom_equal \ <ide> '<form action="/messages" accept-charset="UTF-8" data-remote="true" method="post">' \ <del> '<input name="utf8" type="hidden" value="&#x2713;" />' \ <ide> '<input type="hidden" name="message[content]" id="message_content_trix_input_message" />' \ <ide> '<trix-editor id="message_content" input="message_content_trix_input_message" class="trix-content" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">' \ <ide> "</trix-editor>" \ <ide> class ActionText::FormHelperTest < ActionView::TestCase <ide> <ide> assert_dom_equal \ <ide> '<form action="/messages" accept-charset="UTF-8" data-remote="true" method="post">' \ <del> '<input name="utf8" type="hidden" value="&#x2713;" />' \ <ide> '<input type="hidden" name="message[content]" id="message_content_trix_input_message" />' \ <ide> '<trix-editor id="message_content" input="message_content_trix_input_message" class="custom-class" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">' \ <ide> "</trix-editor>" \ <ide> class ActionText::FormHelperTest < ActionView::TestCase <ide> <ide> assert_dom_equal \ <ide> '<form action="/messages" accept-charset="UTF-8" data-remote="true" method="post">' \ <del> '<input name="utf8" type="hidden" value="&#x2713;" />' \ <ide> '<input type="hidden" name="message[not_an_attribute]" id="message_not_an_attribute_trix_input_message" />' \ <ide> '<trix-editor id="message_not_an_attribute" input="message_not_an_attribute_trix_input_message" class="trix-content" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">' \ <ide> "</trix-editor>" \ <ide> class ActionText::FormHelperTest < ActionView::TestCase <ide> <ide> assert_dom_equal \ <ide> '<form action="/messages" accept-charset="UTF-8" data-remote="true" method="post">' \ <del> '<input name="utf8" type="hidden" value="&#x2713;" />' \ <ide> '<input type="hidden" name="message[content]" id="trix_input_1" />' \ <ide> '<trix-editor id="message_content" input="trix_input_1" class="trix-content" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">' \ <ide> "</trix-editor>" \
6
Ruby
Ruby
improve ppc arch detection
ab633864d5db641d27fdce49c7c66074b931b19d
<ide><path>Library/Homebrew/hardware.rb <ide> class Hardware <ide> module CPU extend self <add> INTEL_32BIT_ARCHS = [:i386].freeze <add> INTEL_64BIT_ARCHS = [:x86_64].freeze <add> PPC_32BIT_ARCHS = [:ppc, :ppc7400, :ppc7450, :ppc970].freeze <add> PPC_64BIT_ARCHS = [:ppc64].freeze <add> <ide> def type <ide> @type || :dunno <ide> end <ide><path>Library/Homebrew/mach.rb <ide> module ArchitectureListExtension <add> def fat? <add> length > 1 <add> end <add> <add> def intel_universal? <add> intersects_all?(Hardware::CPU::INTEL_32BIT_ARCHS, Hardware::CPU::INTEL_64BIT_ARCHS) <add> end <add> <add> def ppc_universal? <add> intersects_all?(Hardware::CPU::PPC_32BIT_ARCHS, Hardware::CPU::PPC_64BIT_ARCHS) <add> end <add> <add> # Old-style 32-bit PPC/Intel universal, e.g. ppc7400 and i386 <add> def cross_universal? <add> intersects_all?(Hardware::CPU::PPC_32BIT_ARCHS, Hardware::CPU::INTEL_32BIT_ARCHS) <add> end <add> <ide> def universal? <del> self.include? :i386 and self.include? :x86_64 <add> intel_universal? || ppc_universal? || cross_universal? <ide> end <ide> <ide> def ppc? <del> self.include? :ppc7400 or self.include? :ppc64 <add> (PPC_32BIT_ARCHS+PPC_64BIT_ARCHS).any? {|a| self.include? a} <ide> end <ide> <ide> def remove_ppc! <del> self.delete :ppc7400 <del> self.delete :ppc64 <add> (Hardware::CPU::PPC_32BIT_ARCHS+Hardware::CPU::PPC_64BIT_ARCHS).each {|a| self.delete a} <ide> end <ide> <ide> def as_arch_flags <ide> self.collect{ |a| "-arch #{a}" }.join(' ') <ide> end <add> <add> protected <add> <add> def intersects_all?(*set) <add> set.all? do |archset| <add> archset.any? {|a| self.include? a} <add> end <add> end <ide> end <ide> <ide> module MachO
2
Text
Text
add gitter.im badge
1ed365f68a0b05d23c86a71e4a267f3714c38190
<ide><path>README.md <ide> <ide> [![NPM version](https://badge.fury.io/js/webpack.png)](http://badge.fury.io/js/webpack) <ide> <add>[![Gitter chat](https://badges.gitter.im/webpack/webpack.png)](https://gitter.im/webpack/webpack) <add> <ide> [documentation](http://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=top) <ide> <ide> # Introduction
1
Python
Python
add macos tf version
024cd19bb7c188a0e4aa681d248ad9f47587ddab
<ide><path>src/transformers/file_utils.py <ide> "tf-nightly-gpu", <ide> "intel-tensorflow", <ide> "tensorflow-rocm", <add> "tensorflow-macos", <ide> ) <ide> _tf_version = None <ide> # For the metadata, we have to look for both tensorflow and tensorflow-cpu
1
Text
Text
start unorded lists at start of line
27a57d3a3449e4d6b9c07ef3bb56c4b0b43c133d
<ide><path>doc/api/addons.md <ide> for more information on N-API. <ide> When not using N-API, implementing Addons is complicated, <ide> involving knowledge of several components and APIs: <ide> <del> - V8: the C++ library Node.js currently uses to provide the <del> JavaScript implementation. V8 provides the mechanisms for creating objects, <del> calling functions, etc. V8's API is documented mostly in the <del> `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source <del> tree), which is also available [online][v8-docs]. <del> <del> - [libuv][]: The C library that implements the Node.js event loop, its worker <del> threads and all of the asynchronous behaviors of the platform. It also <del> serves as a cross-platform abstraction library, giving easy, POSIX-like <del> access across all major operating systems to many common system tasks, such <del> as interacting with the filesystem, sockets, timers, and system events. libuv <del> also provides a pthreads-like threading abstraction that may be used to <del> power more sophisticated asynchronous Addons that need to move beyond the <del> standard event loop. Addon authors are encouraged to think about how to <del> avoid blocking the event loop with I/O or other time-intensive tasks by <del> off-loading work via libuv to non-blocking system operations, worker threads <del> or a custom use of libuv's threads. <del> <del> - Internal Node.js libraries. Node.js itself exports a number of C++ APIs <del> that Addons can use &mdash; the most important of which is the <del> `node::ObjectWrap` class. <del> <del> - Node.js includes a number of other statically linked libraries including <del> OpenSSL. These other libraries are located in the `deps/` directory in the <del> Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are <del> purposefully re-exported by Node.js and may be used to various extents by <del> Addons. <del> See [Linking to Node.js' own dependencies][] for additional information. <add>- V8: the C++ library Node.js currently uses to provide the <add> JavaScript implementation. V8 provides the mechanisms for creating objects, <add> calling functions, etc. V8's API is documented mostly in the <add> `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source <add> tree), which is also available [online][v8-docs]. <add> <add>- [libuv][]: The C library that implements the Node.js event loop, its worker <add> threads and all of the asynchronous behaviors of the platform. It also <add> serves as a cross-platform abstraction library, giving easy, POSIX-like <add> access across all major operating systems to many common system tasks, such <add> as interacting with the filesystem, sockets, timers, and system events. libuv <add> also provides a pthreads-like threading abstraction that may be used to <add> power more sophisticated asynchronous Addons that need to move beyond the <add> standard event loop. Addon authors are encouraged to think about how to <add> avoid blocking the event loop with I/O or other time-intensive tasks by <add> off-loading work via libuv to non-blocking system operations, worker threads <add> or a custom use of libuv's threads. <add> <add>- Internal Node.js libraries. Node.js itself exports a number of C++ APIs <add> that Addons can use &mdash; the most important of which is the <add> `node::ObjectWrap` class. <add> <add>- Node.js includes a number of other statically linked libraries including <add> OpenSSL. These other libraries are located in the `deps/` directory in the <add> Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are <add> purposefully re-exported by Node.js and may be used to various extents by <add> Addons. <add> See [Linking to Node.js' own dependencies][] for additional information. <ide> <ide> All of the following examples are available for [download][] and may <ide> be used as the starting-point for an Addon. <ide><path>doc/api/buffer.md <ide> changes: <ide> <ide> If `value` is: <ide> <del> * a string, `value` is interpreted according to the character encoding in <del> `encoding`. <del> * a `Buffer` or [`Uint8Array`][], `value` will be used in its entirety. <del> To compare a partial `Buffer`, use [`buf.slice()`][]. <del> * a number, `value` will be interpreted as an unsigned 8-bit integer <add>* a string, `value` is interpreted according to the character encoding in <add> `encoding`. <add>* a `Buffer` or [`Uint8Array`][], `value` will be used in its entirety. <add> To compare a partial `Buffer`, use [`buf.slice()`][]. <add>* a number, `value` will be interpreted as an unsigned 8-bit integer <ide> value between `0` and `255`. <ide> <ide> ```js <ide><path>doc/api/child_process.md <ide> and asynchronous alternatives to [`child_process.spawn()`][] and <ide> [`child_process.spawnSync()`][]. Each of these alternatives are implemented on <ide> top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][]. <ide> <del> * [`child_process.exec()`][]: spawns a shell and runs a command within that <del> shell, passing the `stdout` and `stderr` to a callback function when <del> complete. <del> * [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except <del> that it spawns the command directly without first spawning a shell by <del> default. <del> * [`child_process.fork()`][]: spawns a new Node.js process and invokes a <del> specified module with an IPC communication channel established that allows <del> sending messages between parent and child. <del> * [`child_process.execSync()`][]: a synchronous version of <del> [`child_process.exec()`][] that will block the Node.js event loop. <del> * [`child_process.execFileSync()`][]: a synchronous version of <del> [`child_process.execFile()`][] that will block the Node.js event loop. <add>* [`child_process.exec()`][]: spawns a shell and runs a command within that <add> shell, passing the `stdout` and `stderr` to a callback function when <add> complete. <add>* [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except <add> that it spawns the command directly without first spawning a shell by <add> default. <add>* [`child_process.fork()`][]: spawns a new Node.js process and invokes a <add> specified module with an IPC communication channel established that allows <add> sending messages between parent and child. <add>* [`child_process.execSync()`][]: a synchronous version of <add> [`child_process.exec()`][] that will block the Node.js event loop. <add>* [`child_process.execFileSync()`][]: a synchronous version of <add> [`child_process.execFile()`][] that will block the Node.js event loop. <ide> <ide> For certain use cases, such as automating shell scripts, the <ide> [synchronous counterparts][] may be more convenient. In many cases, however, <ide><path>doc/api/n-api.md <ide> napi_status napi_define_class(napi_env env, <ide> napi_value* result); <ide> ``` <ide> <del> - `[in] env`: The environment that the API is invoked under. <del> - `[in] utf8name`: Name of the JavaScript constructor function; this is <del> not required to be the same as the C++ class name, though it is recommended <del> for clarity. <del> - `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH` <del>if it is null-terminated. <del> - `[in] constructor`: Callback function that handles constructing instances <del> of the class. (This should be a static method on the class, not an actual <del> C++ constructor function.) <del> - `[in] data`: Optional data to be passed to the constructor callback as <del> the `data` property of the callback info. <del> - `[in] property_count`: Number of items in the `properties` array argument. <del> - `[in] properties`: Array of property descriptors describing static and <del> instance data properties, accessors, and methods on the class <del> See `napi_property_descriptor`. <del> - `[out] result`: A `napi_value` representing the constructor function for <del> the class. <add>- `[in] env`: The environment that the API is invoked under. <add>- `[in] utf8name`: Name of the JavaScript constructor function; this is <add> not required to be the same as the C++ class name, though it is recommended <add> for clarity. <add>- `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH` <add> if it is null-terminated. <add>- `[in] constructor`: Callback function that handles constructing instances <add> of the class. (This should be a static method on the class, not an actual <add> C++ constructor function.) <add>- `[in] data`: Optional data to be passed to the constructor callback as <add> the `data` property of the callback info. <add>- `[in] property_count`: Number of items in the `properties` array argument. <add>- `[in] properties`: Array of property descriptors describing static and <add> instance data properties, accessors, and methods on the class <add> See `napi_property_descriptor`. <add>- `[out] result`: A `napi_value` representing the constructor function for <add> the class. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> <ide> Defines a JavaScript class that corresponds to a C++ class, including: <del> - A JavaScript constructor function that has the class name and invokes the <del> provided C++ constructor callback. <del> - Properties on the constructor function corresponding to _static_ data <del> properties, accessors, and methods of the C++ class (defined by <del> property descriptors with the `napi_static` attribute). <del> - Properties on the constructor function's `prototype` object corresponding to <del> _non-static_ data properties, accessors, and methods of the C++ class <del> (defined by property descriptors without the `napi_static` attribute). <add> <add>- A JavaScript constructor function that has the class name and invokes the <add> provided C++ constructor callback. <add>- Properties on the constructor function corresponding to _static_ data <add> properties, accessors, and methods of the C++ class (defined by <add> property descriptors with the `napi_static` attribute). <add>- Properties on the constructor function's `prototype` object corresponding to <add> _non-static_ data properties, accessors, and methods of the C++ class <add> (defined by property descriptors without the `napi_static` attribute). <ide> <ide> The C++ constructor callback should be a static method on the class that calls <ide> the actual class constructor, then wraps the new C++ instance in a JavaScript <ide> napi_status napi_wrap(napi_env env, <ide> napi_ref* result); <ide> ``` <ide> <del> - `[in] env`: The environment that the API is invoked under. <del> - `[in] js_object`: The JavaScript object that will be the wrapper for the <del> native object. <del> - `[in] native_object`: The native instance that will be wrapped in the <del> JavaScript object. <del> - `[in] finalize_cb`: Optional native callback that can be used to free the <del> native instance when the JavaScript object is ready for garbage-collection. <del> - `[in] finalize_hint`: Optional contextual hint that is passed to the <del> finalize callback. <del> - `[out] result`: Optional reference to the wrapped object. <add>- `[in] env`: The environment that the API is invoked under. <add>- `[in] js_object`: The JavaScript object that will be the wrapper for the <add> native object. <add>- `[in] native_object`: The native instance that will be wrapped in the <add> JavaScript object. <add>- `[in] finalize_cb`: Optional native callback that can be used to free the <add> native instance when the JavaScript object is ready for garbage-collection. <add>- `[in] finalize_hint`: Optional contextual hint that is passed to the <add> finalize callback. <add>- `[out] result`: Optional reference to the wrapped object. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> <ide> napi_status napi_unwrap(napi_env env, <ide> void** result); <ide> ``` <ide> <del> - `[in] env`: The environment that the API is invoked under. <del> - `[in] js_object`: The object associated with the native instance. <del> - `[out] result`: Pointer to the wrapped native instance. <add>- `[in] env`: The environment that the API is invoked under. <add>- `[in] js_object`: The object associated with the native instance. <add>- `[out] result`: Pointer to the wrapped native instance. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> <ide> napi_status napi_remove_wrap(napi_env env, <ide> void** result); <ide> ``` <ide> <del> - `[in] env`: The environment that the API is invoked under. <del> - `[in] js_object`: The object associated with the native instance. <del> - `[out] result`: Pointer to the wrapped native instance. <add>- `[in] env`: The environment that the API is invoked under. <add>- `[in] js_object`: The object associated with the native instance. <add>- `[out] result`: Pointer to the wrapped native instance. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> <ide> napi_status napi_add_finalizer(napi_env env, <ide> napi_ref* result); <ide> ``` <ide> <del> - `[in] env`: The environment that the API is invoked under. <del> - `[in] js_object`: The JavaScript object to which the native data will be <del> attached. <del> - `[in] native_object`: The native data that will be attached to the JavaScript <del> object. <del> - `[in] finalize_cb`: Native callback that will be used to free the <del> native data when the JavaScript object is ready for garbage-collection. <del> - `[in] finalize_hint`: Optional contextual hint that is passed to the <del> finalize callback. <del> - `[out] result`: Optional reference to the JavaScript object. <add>- `[in] env`: The environment that the API is invoked under. <add>- `[in] js_object`: The JavaScript object to which the native data will be <add> attached. <add>- `[in] native_object`: The native data that will be attached to the JavaScript <add> object. <add>- `[in] finalize_cb`: Native callback that will be used to free the <add> native data when the JavaScript object is ready for garbage-collection. <add>- `[in] finalize_hint`: Optional contextual hint that is passed to the <add> finalize callback. <add>- `[out] result`: Optional reference to the JavaScript object. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> <ide><path>doc/api/repl.md <ide> undefined <ide> Various behaviors of the Node.js REPL can be customized using the following <ide> environment variables: <ide> <del> - `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history <del> will be saved to the specified file rather than `.node_repl_history` in the <del> user's home directory. Setting this value to `''` (an empty string) will <del> disable persistent REPL history. Whitespace will be trimmed from the value. <del> On Windows platforms environment variables with empty values are invalid so <del> set this variable to one or more spaces to disable persistent REPL history. <del> - `NODE_REPL_HISTORY_SIZE` - Controls how many lines of history will be <del> persisted if history is available. Must be a positive number. <del> **Default:** `1000`. <del> - `NODE_REPL_MODE` - May be either `'sloppy'` or `'strict'`. **Default:** <del> `'sloppy'`, which will allow non-strict mode code to be run. <add>- `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history <add> will be saved to the specified file rather than `.node_repl_history` in the <add> user's home directory. Setting this value to `''` (an empty string) will <add> disable persistent REPL history. Whitespace will be trimmed from the value. <add> On Windows platforms environment variables with empty values are invalid so <add> set this variable to one or more spaces to disable persistent REPL history. <add>- `NODE_REPL_HISTORY_SIZE` - Controls how many lines of history will be <add> persisted if history is available. Must be a positive number. <add> **Default:** `1000`. <add>- `NODE_REPL_MODE` - May be either `'sloppy'` or `'strict'`. **Default:** <add> `'sloppy'`, which will allow non-strict mode code to be run. <ide> <ide> ### Persistent History <ide> <ide><path>doc/changelogs/CHANGELOG_ARCHIVE.md <ide> https://github.com/nodejs/node/commit/f711d5343b29d1e72e87107315708e40951a7826 <ide> <ide> https://github.com/nodejs/node/commit/557ba6bd97bad3afe0f9bd3ac07efac0a39978c1 <ide> <del> * Fixed no 'end' event on long chunked HTTP messages <del> https://github.com/joyent/node/issues/77 <add>* Fixed no 'end' event on long chunked HTTP messages <add> https://github.com/joyent/node/issues/77 <ide> <del> * Remove legacy modules http_old and tcp_old <del> * Support DNS MX queries (Jérémy Lal) <add>* Remove legacy modules http_old and tcp_old <add>* Support DNS MX queries (Jérémy Lal) <ide> <del> * Fix large socket write (tlb@tlb.org) <del> * Fix child process exit codes (Felix Geisendörfer) <add>* Fix large socket write (tlb@tlb.org) <add>* Fix child process exit codes (Felix Geisendörfer) <ide> <del> * Allow callers to disable PHP/Rails style parameter munging in <del> querystring.stringify (Thomas Lee) <add>* Allow callers to disable PHP/Rails style parameter munging in <add> querystring.stringify (Thomas Lee) <ide> <del> * Upgrade V8 to 2.2.6 <add>* Upgrade V8 to 2.2.6 <ide> <ide> <a id="0.1.92"></a> <ide> ## 2010.04.23, Version 0.1.92 <ide> <ide> https://github.com/nodejs/node/commit/caa828a242f39b6158084ef4376355161c14fe34 <ide> <del> * OpenSSL support. Still undocumented (see tests). (Rhys Jones) <del> * API: Unhandled 'error' events throw. <add>* OpenSSL support. Still undocumented (see tests). (Rhys Jones) <add>* API: Unhandled 'error' events throw. <ide> <del> * Script class with eval-function-family in binding('evals') plus tests. <del> (Herbert Vojcik) <add>* Script class with eval-function-family in binding('evals') plus tests. <add> (Herbert Vojcik) <ide> <del> * stream.setKeepAlive (Julian Lamb) <del> * Bugfix: Force no body on http 204 and 304 <add>* stream.setKeepAlive (Julian Lamb) <add>* Bugfix: Force no body on http 204 and 304 <ide> <del> * Upgrade Waf to 1.5.16, V8 to 2.2.4.2 <add>* Upgrade Waf to 1.5.16, V8 to 2.2.4.2 <ide> <ide> <a id="0.1.91"></a> <ide> ## 2010.04.15, Version 0.1.91 <ide> <ide> https://github.com/nodejs/node/commit/311d7dee19034ff1c6bc9098c36973b8d687eaba <ide> <del> * Add incoming.httpVersion <del> * Object.prototype problem with C-Ares binding <add>* Add incoming.httpVersion <add>* Object.prototype problem with C-Ares binding <ide> <del> * REPL can be run from multiple different streams. (Matt Ranney) <del> * After V8 heap is compact, don't use a timer every 2 seconds. <add>* REPL can be run from multiple different streams. (Matt Ranney) <add>* After V8 heap is compact, don't use a timer every 2 seconds. <ide> <del> * Improve nextTick implementation. <del> * Add primitive support for Upgrading HTTP connections. <del> (See commit log for docs 760bba5) <add>* Improve nextTick implementation. <add>* Add primitive support for Upgrading HTTP connections. <add> (See commit log for docs 760bba5) <ide> <del> * Add timeout and maxBuffer options to child_process.exec <del> * Fix bugs. <add>* Add timeout and maxBuffer options to child_process.exec <add>* Fix bugs. <ide> <del> * Upgrade V8 to 2.2.3.1 <add>* Upgrade V8 to 2.2.3.1 <ide> <ide> <a id="0.1.90"></a> <ide> ## 2010.04.09, Version 0.1.90 <ide> <ide> https://github.com/nodejs/node/commit/07e64d45ffa1856e824c4fa6afd0442ba61d6fd8 <ide> <del> * Merge writing of networking system (net2) <del> - New Buffer object for binary data. <del> - Support UNIX sockets, Pipes <del> - Uniform stream API <del> - Currently no SSL <del> - Legacy modules can be accessed at 'http_old' and 'tcp_old' <add>* Merge writing of networking system (net2) <add> - New Buffer object for binary data. <add> - Support UNIX sockets, Pipes <add> - Uniform stream API <add> - Currently no SSL <add> - Legacy modules can be accessed at 'http_old' and 'tcp_old' <ide> <del> * Replace udns with c-ares. (Krishna Rajendran) <del> * New documentation system using Markdown and Ronn <del> (Tim Caswell, Micheil Smith) <add>* Replace udns with c-ares. (Krishna Rajendran) <add>* New documentation system using Markdown and Ronn <add> (Tim Caswell, Micheil Smith) <ide> <del> * Better idle-time GC <del> * Countless small bug fixes. <add>* Better idle-time GC <add>* Countless small bug fixes. <ide> <del> * Upgrade V8 to 2.2.X, WAF 1.5.15 <add>* Upgrade V8 to 2.2.X, WAF 1.5.15 <ide> <ide> <a id="0.1.33"></a> <ide> ## 2010.03.19, Version 0.1.33 <ide> <ide> https://github.com/nodejs/node/commit/618296ef571e873976f608d91a3d6b9e65fe8284 <ide> <del> * Include lib/ directory in node executable. Compile on demand. <del> * evalcx clean ups (Isaac Z. Schlueter, Tim-Smart) <add>* Include lib/ directory in node executable. Compile on demand. <add>* evalcx clean ups (Isaac Z. Schlueter, Tim-Smart) <ide> <del> * Various fixes, clean ups <del> * V8 upgraded to 2.1.5 <add>* Various fixes, clean ups <add>* V8 upgraded to 2.1.5 <ide> <ide> <a id="0.1.32"></a> <ide> ## 2010.03.12, Version 0.1.32 <ide> <ide> https://github.com/nodejs/node/commit/61c801413544a50000faa7f58376e9b33ba6254f <ide> <del> * Optimize event emitter for single listener <del> * Add process.evalcx, require.registerExtension (Tim Smart) <add>* Optimize event emitter for single listener <add>* Add process.evalcx, require.registerExtension (Tim Smart) <ide> <del> * Replace --cflags with --vars <del> * Fix bugs in fs.create*Stream (Felix Geisendörfer) <add>* Replace --cflags with --vars <add>* Fix bugs in fs.create*Stream (Felix Geisendörfer) <ide> <del> * Deprecate process.mixin, process.unloop <del> * Remove the 'Error: (no message)' exceptions, print stack <del> trace instead <add>* Deprecate process.mixin, process.unloop <add>* Remove the 'Error: (no message)' exceptions, print stack <add> trace instead <ide> <del> * INI parser bug fixes (Isaac Schlueter) <del> * FreeBSD fixes (Vanilla Hsu) <add>* INI parser bug fixes (Isaac Schlueter) <add>* FreeBSD fixes (Vanilla Hsu) <ide> <del> * Upgrade to V8 2.1.3, WAF 1.5.14a, libev <add>* Upgrade to V8 2.1.3, WAF 1.5.14a, libev <ide> <ide> <a id="0.1.31"></a> <ide> ## 2010.03.05, Version 0.1.31 <ide> <ide> https://github.com/nodejs/node/commit/39b63dfe1737d46a8c8818c92773ef181fd174b3 <ide> <del> * API: <del> - Move process.watchFile into fs module <del> - Move process.inherits to sys <add>* API: <add> - Move process.watchFile into fs module <add> - Move process.inherits to sys <ide> <del> * Improve Solaris port <del> * tcp.Connection.prototype.write now returns boolean to indicate if <del> argument was flushed to the kernel buffer. <add>* Improve Solaris port <add>* tcp.Connection.prototype.write now returns boolean to indicate if <add> argument was flushed to the kernel buffer. <ide> <del> * Added fs.link, fs.symlink, fs.readlink, fs.realpath <del> (Rasmus Andersson) <add>* Added fs.link, fs.symlink, fs.readlink, fs.realpath <add> (Rasmus Andersson) <ide> <del> * Add setgid,getgid (James Duncan) <del> * Improve sys.inspect (Benjamin Thomas) <add>* Add setgid,getgid (James Duncan) <add>* Improve sys.inspect (Benjamin Thomas) <ide> <del> * Allow passing env to child process (Isaac Schlueter) <del> * fs.createWriteStream, fs.createReadStream (Felix Geisendörfer) <add>* Allow passing env to child process (Isaac Schlueter) <add>* fs.createWriteStream, fs.createReadStream (Felix Geisendörfer) <ide> <del> * Add INI parser (Rob Ellis) <del> * Bugfix: fs.readFile handling encoding (Jacek Becela) <add>* Add INI parser (Rob Ellis) <add>* Bugfix: fs.readFile handling encoding (Jacek Becela) <ide> <del> * Upgrade V8 to 2.1.2 <add>* Upgrade V8 to 2.1.2 <ide> <ide> <a id="0.1.30"></a> <ide> ## 2010.02.22, Version 0.1.30 <ide> <ide> https://github.com/nodejs/node/commit/bb0d1e65e1671aaeb21fac186b066701da0bc33b <ide> <del> * Major API Changes <del> - Promises removed. See <del> http://groups.google.com/group/nodejs/msg/426f3071f3eec16b <del> http://groups.google.com/group/nodejs/msg/df199d233ff17efa <del> The API for fs was <del> fs.readdir("/usr").addCallback(function (files) { <del> puts("/usr files: " + files); <del> }); <del> It is now <del> fs.readdir("/usr", function (err, files) { <del> if (err) throw err; <del> puts("/usr files: " + files); <del> }); <del> - Synchronous fs operations exposed, use with care. <del> - tcp.Connection.prototype.readPause() and readResume() <del> renamed to pause() and resume() <del> - http.ServerResponse.prototype.sendHeader() renamed to <del> writeHeader(). Now accepts reasonPhrase. <del> <del> * Compact garbage on idle. <del> * Configurable debug ports, and --debug-brk (Zoran Tomicic) <del> <del> * Better command line option parsing (Jeremy Ashkenas) <del> * Add fs.chmod (Micheil Smith), fs.lstat (Isaac Z. Schlueter) <del> <del> * Fixes to process.mixin (Rasmus Andersson, Benjamin Thomas) <del> * Upgrade V8 to 2.1.1 <add>* Major API Changes <add> - Promises removed. See <add> http://groups.google.com/group/nodejs/msg/426f3071f3eec16b <add> http://groups.google.com/group/nodejs/msg/df199d233ff17efa <add> The API for fs was <add> fs.readdir("/usr").addCallback(function (files) { <add> puts("/usr files: " + files); <add> }); <add> It is now <add> fs.readdir("/usr", function (err, files) { <add> if (err) throw err; <add> puts("/usr files: " + files); <add> }); <add> - Synchronous fs operations exposed, use with care. <add> - tcp.Connection.prototype.readPause() and readResume() <add> renamed to pause() and resume() <add> - http.ServerResponse.prototype.sendHeader() renamed to <add> writeHeader(). Now accepts reasonPhrase. <add> <add>* Compact garbage on idle. <add>* Configurable debug ports, and --debug-brk (Zoran Tomicic) <add> <add>* Better command line option parsing (Jeremy Ashkenas) <add>* Add fs.chmod (Micheil Smith), fs.lstat (Isaac Z. Schlueter) <add> <add>* Fixes to process.mixin (Rasmus Andersson, Benjamin Thomas) <add>* Upgrade V8 to 2.1.1 <ide> <ide> <a id="0.1.29"></a> <ide> ## 2010.02.17, Version 0.1.29 <ide> <ide> https://github.com/nodejs/node/commit/87d5e5b316a4276bcf881f176971c1a237dcdc7a <ide> <del> * Major API Changes <del> - Remove 'file' module <del> - require('posix') -----------------> require('fs') <del> - fs.cat ---------------------------> fs.readFile <del> - file.write -----------------------> fs.writeFile <del> - TCP 'receive' event --------------> 'data' <del> - TCP 'eof' event ------------------> 'end' <del> - TCP send() -----------------------> write() <del> - HTTP sendBody() ------------------> write() <del> - HTTP finish() --------------------> close() <del> - HTTP 'body' event ----------------> 'data' <del> - HTTP 'complete' event ------------> 'end' <del> - http.Client.prototype.close() (formerly finish()) no longer <del> takes an argument. Add the 'response' listener manually. <del> - Allow strings for the flag argument to fs.open <del> ("r", "r+", "w", "w+", "a", "a+") <del> <del> * Added multiple arg support for sys.puts(), print(), etc. <del> (tj@vision-media.ca) <del> <del> * sys.inspect(Date) now shows the date value (Mark Hansen) <del> * Calculate page size with getpagesize for armel (Jérémy Lal) <del> <del> * Bugfix: stderr flushing. <del> * Bugfix: Promise late chain (Yuichiro MASUI) <del> <del> * Bugfix: wait() on fired promises <del> (Felix Geisendörfer, Jonas Pfenniger) <del> <del> * Bugfix: Use InstanceTemplate() instead of PrototypeTemplate() for <del> accessor methods. Was causing a crash with Eclipse debugger. <del> (Zoran Tomicic) <del> <del> * Bugfix: Throw from connection.connect if resolving. <del> (Reported by James Golick) <add>* Major API Changes <add> - Remove 'file' module <add> - require('posix') -----------------> require('fs') <add> - fs.cat ---------------------------> fs.readFile <add> - file.write -----------------------> fs.writeFile <add> - TCP 'receive' event --------------> 'data' <add> - TCP 'eof' event ------------------> 'end' <add> - TCP send() -----------------------> write() <add> - HTTP sendBody() ------------------> write() <add> - HTTP finish() --------------------> close() <add> - HTTP 'body' event ----------------> 'data' <add> - HTTP 'complete' event ------------> 'end' <add> - http.Client.prototype.close() (formerly finish()) no longer <add> takes an argument. Add the 'response' listener manually. <add> - Allow strings for the flag argument to fs.open <add> ("r", "r+", "w", "w+", "a", "a+") <add> <add>* Added multiple arg support for sys.puts(), print(), etc. <add> (tj@vision-media.ca) <add> <add>* sys.inspect(Date) now shows the date value (Mark Hansen) <add>* Calculate page size with getpagesize for armel (Jérémy Lal) <add> <add>* Bugfix: stderr flushing. <add>* Bugfix: Promise late chain (Yuichiro MASUI) <add> <add>* Bugfix: wait() on fired promises <add> (Felix Geisendörfer, Jonas Pfenniger) <add> <add>* Bugfix: Use InstanceTemplate() instead of PrototypeTemplate() for <add> accessor methods. Was causing a crash with Eclipse debugger. <add> (Zoran Tomicic) <add> <add>* Bugfix: Throw from connection.connect if resolving. <add> (Reported by James Golick) <ide> <ide> <a id="0.1.28"></a> <ide> ## 2010.02.09, Version 0.1.28 <ide> <ide> https://github.com/nodejs/node/commit/49de41ef463292988ddacfb01a20543b963d9669 <ide> <del> * Use Google's jsmin.py which can be used for evil. <del> * Add posix.truncate() <add>* Use Google's jsmin.py which can be used for evil. <add>* Add posix.truncate() <ide> <del> * Throw errors from server.listen() <del> * stdio bugfix (test by Mikeal Rogers) <add>* Throw errors from server.listen() <add>* stdio bugfix (test by Mikeal Rogers) <ide> <del> * Module system refactor (Felix Geisendörfer, Blaine Cook) <del> * Add process.setuid(), getuid() (Michael Carter) <add>* Module system refactor (Felix Geisendörfer, Blaine Cook) <add>* Add process.setuid(), getuid() (Michael Carter) <ide> <del> * sys.inspect refactor (Tim Caswell) <del> * Multipart library rewrite (isaacs) <add>* sys.inspect refactor (Tim Caswell) <add>* Multipart library rewrite (isaacs) <ide> <ide> <a id="0.1.27"></a> <ide> ## 2010.02.03, Version 0.1.27 <ide> <ide> https://github.com/nodejs/node/commit/0cfa789cc530848725a8cb5595224e78ae7b9dd0 <ide> <del> * Implemented __dirname (Felix Geisendörfer) <del> * Downcase process.ARGV, process.ENV, GLOBAL <del> (now process.argv, process.env, global) <add>* Implemented __dirname (Felix Geisendörfer) <add>* Downcase process.ARGV, process.ENV, GLOBAL <add> (now process.argv, process.env, global) <ide> <del> * Bug Fix: Late promise promise callbacks firing <del> (Felix Geisendörfer, Jonas Pfenniger) <add>* Bug Fix: Late promise promise callbacks firing <add> (Felix Geisendörfer, Jonas Pfenniger) <ide> <del> * Make assert.AssertionError instance of Error <del> * Removed inline require call for querystring <del> (self@cloudhead.net) <add>* Make assert.AssertionError instance of Error <add>* Removed inline require call for querystring <add> (self@cloudhead.net) <ide> <del> * Add support for MX, TXT, and SRV records in DNS module. <del> (Blaine Cook) <add>* Add support for MX, TXT, and SRV records in DNS module. <add> (Blaine Cook) <ide> <del> * Bugfix: HTTP client automatically reconnecting <del> * Adding OS X .dmg build scripts. (Standa Opichal) <add>* Bugfix: HTTP client automatically reconnecting <add>* Adding OS X .dmg build scripts. (Standa Opichal) <ide> <del> * Bugfix: ObjectWrap memory leak <del> * Bugfix: Multipart handle Content-Type headers with charset <del> (Felix Geisendörfer) <add>* Bugfix: ObjectWrap memory leak <add>* Bugfix: Multipart handle Content-Type headers with charset <add> (Felix Geisendörfer) <ide> <del> * Upgrade http-parser to fix header overflow attack. <del> * Upgrade V8 to 2.1.0 <add>* Upgrade http-parser to fix header overflow attack. <add>* Upgrade V8 to 2.1.0 <ide> <del> * Various other bug fixes, performance improvements. <add>* Various other bug fixes, performance improvements. <ide> <ide> <a id="0.1.26"></a> <ide> ## 2010.01.20, Version 0.1.26 <ide> <ide> https://github.com/nodejs/node/commit/da00413196e432247346d9e587f8c78ce5ceb087 <ide> <del> * Bugfix, HTTP eof causing crash (Ben Williamson) <del> * Better error message on SyntaxError <add>* Bugfix, HTTP eof causing crash (Ben Williamson) <add>* Better error message on SyntaxError <ide> <del> * API: Move Promise and EventEmitter into 'events' module <del> * API: Add process.nextTick() <add>* API: Move Promise and EventEmitter into 'events' module <add>* API: Add process.nextTick() <ide> <del> * Allow optional params to setTimeout, setInterval <del> (Micheil Smith) <add>* Allow optional params to setTimeout, setInterval <add> (Micheil Smith) <ide> <del> * API: change some Promise behavior (Felix Geisendörfer) <del> - Removed Promise.cancel() <del> - Support late callback binding <del> - Make unhandled Promise errors throw an exception <add>* API: change some Promise behavior (Felix Geisendörfer) <add> - Removed Promise.cancel() <add> - Support late callback binding <add> - Make unhandled Promise errors throw an exception <ide> <del> * Upgrade V8 to 2.0.6.1 <del> * Solaris port (Erich Ocean) <add>* Upgrade V8 to 2.0.6.1 <add>* Solaris port (Erich Ocean) <ide> <ide> <a id="0.1.25"></a> <ide> ## 2010.01.09, Version 0.1.25 <ide> <ide> https://github.com/nodejs/node/commit/39ca93549af91575ca9d4cbafd1e170fbcef3dfa <ide> <del> * sys.inspect() improvements (Tim Caswell) <del> * path module improvements (isaacs, Benjamin Thomas) <add>* sys.inspect() improvements (Tim Caswell) <add>* path module improvements (isaacs, Benjamin Thomas) <ide> <del> * API: request.uri -> request.url <del> It is no longer an object, but a string. The 'url' module <del> was added to parse that string. That is, node no longer <del> parses the request URL automatically. <del> require('url').parse(request.url) <del> is roughly equivalent to the old request.uri object. <del> (isaacs) <add>* API: request.uri -> request.url <add> It is no longer an object, but a string. The 'url' module <add> was added to parse that string. That is, node no longer <add> parses the request URL automatically. <add> require('url').parse(request.url) <add> is roughly equivalent to the old request.uri object. <add> (isaacs) <ide> <del> * Bugfix: Several libeio related race conditions. <del> * Better errors for multipart library (Felix Geisendörfer) <add>* Bugfix: Several libeio related race conditions. <add>* Better errors for multipart library (Felix Geisendörfer) <ide> <del> * Bugfix: Update node-waf version to 1.5.10 <del> * getmem for freebsd (Vanilla Hsu) <add>* Bugfix: Update node-waf version to 1.5.10 <add>* getmem for freebsd (Vanilla Hsu) <ide> <ide> <a id="0.1.24"></a> <ide> ## 2009.12.31, Version 0.1.24 <ide> <ide> https://github.com/nodejs/node/commit/642c2773a7eb2034f597af1cd404b9e086b59632 <ide> <del> * Bugfix: don't chunk responses to HTTP/1.0 clients, even if <del> they send Connection: Keep-Alive (e.g. wget) <add>* Bugfix: don't chunk responses to HTTP/1.0 clients, even if <add> they send Connection: Keep-Alive (e.g. wget) <ide> <del> * Bugfix: libeio race condition <del> * Bugfix: Don't segfault on unknown http method <add>* Bugfix: libeio race condition <add>* Bugfix: Don't segfault on unknown http method <ide> <del> * Simplify exception reporting <del> * Upgrade V8 to 2.0.5.4 <add>* Simplify exception reporting <add>* Upgrade V8 to 2.0.5.4 <ide> <ide> <a id="0.1.23"></a> <ide> ## 2009.12.22, Version 0.1.23 <ide> <ide> https://github.com/nodejs/node/commit/f91e347eeeeac1a8bd6a7b462df0321b60f3affc <ide> <del> * Bugfix: require("../blah") issues (isaacs) <del> * Bugfix: posix.cat (Jonas Pfenniger) <add>* Bugfix: require("../blah") issues (isaacs) <add>* Bugfix: posix.cat (Jonas Pfenniger) <ide> <del> * Do not pause request for multipart parsing (Felix Geisendörfer) <add>* Do not pause request for multipart parsing (Felix Geisendörfer) <ide> <ide> <a id="0.1.22"></a> <ide> ## 2009.12.19, Version 0.1.22 <ide> <ide> https://github.com/nodejs/node/commit/a2d809fe902f6c4102dba8f2e3e9551aad137c0f <ide> <del> * Bugfix: child modules get wrong id with "index.js" (isaacs) <del> * Bugfix: require("../foo") cycles (isaacs) <add>* Bugfix: child modules get wrong id with "index.js" (isaacs) <add>* Bugfix: require("../foo") cycles (isaacs) <ide> <del> * Bugfix: require() should throw error if module does. <del> * New URI parser stolen from Narwhal (isaacs) <add>* Bugfix: require() should throw error if module does. <add>* New URI parser stolen from Narwhal (isaacs) <ide> <del> * Bugfix: correctly check kqueue and epoll. (Rasmus Andersson) <del> * Upgrade WAF to 1.5.10 <add>* Bugfix: correctly check kqueue and epoll. (Rasmus Andersson) <add>* Upgrade WAF to 1.5.10 <ide> <del> * Bugfix: posix.statSync() was crashing <del> * Statically define string symbols for performance improvement <add>* Bugfix: posix.statSync() was crashing <add>* Statically define string symbols for performance improvement <ide> <del> * Bugfix: ARGV[0] weirdness <del> * Added superCtor to ctor.super_ instead superCtor.prototype. <del> (Johan Dahlberg) <add>* Bugfix: ARGV[0] weirdness <add>* Added superCtor to ctor.super_ instead superCtor.prototype. <add> (Johan Dahlberg) <ide> <del> * http-parser supports webdav methods <del> * API: http.Client.prototype.request() (Christopher Lenz) <add>* http-parser supports webdav methods <add>* API: http.Client.prototype.request() (Christopher Lenz) <ide> <ide> <a id="0.1.21"></a> <ide> ## 2009.12.06, Version 0.1.21 <ide> <ide> https://github.com/nodejs/node/commit/c6affb64f96a403a14d20035e7fbd6d0ce089db5 <ide> <del> * Feature: Add HTTP client TLS support (Rhys Jones) <del> * Bugfix: use --jobs=1 with WAF <add>* Feature: Add HTTP client TLS support (Rhys Jones) <add>* Bugfix: use --jobs=1 with WAF <ide> <del> * Bugfix: Don't use chunked encoding for 1.0 requests <del> * Bugfix: Duplicated header weren't handled correctly <add>* Bugfix: Don't use chunked encoding for 1.0 requests <add>* Bugfix: Duplicated header weren't handled correctly <ide> <del> * Improve sys.inspect (Xavier Shay) <del> * Upgrade v8 to 2.0.3 <add>* Improve sys.inspect (Xavier Shay) <add>* Upgrade v8 to 2.0.3 <ide> <del> * Use CommonJS assert API (Felix Geisendörfer, Karl Guertin) <add>* Use CommonJS assert API (Felix Geisendörfer, Karl Guertin) <ide> <ide> <a id="0.1.20"></a> <ide> ## 2009.11.28, Version 0.1.20 <ide> <ide> https://github.com/nodejs/node/commit/aa42c6790da8ed2cd2b72051c07f6251fe1724d8 <ide> <del> * Add gnutls version to configure script <del> * Add V8 heap info to process.memoryUsage() <add>* Add gnutls version to configure script <add>* Add V8 heap info to process.memoryUsage() <ide> <del> * process.watchFile callback has 2 arguments with the stat object <del> (choonkeat@gmail.com) <add>* process.watchFile callback has 2 arguments with the stat object <add> (choonkeat@gmail.com) <ide> <ide> <a id="0.1.19"></a> <ide> ## 2009.11.28, Version 0.1.19 <ide> <ide> https://github.com/nodejs/node/commit/633d6be328708055897b72327b88ac88e158935f <ide> <del> * Feature: Initial TLS support for TCP servers and clients. <del> (Rhys Jones) <add>* Feature: Initial TLS support for TCP servers and clients. <add> (Rhys Jones) <ide> <del> * Add options to process.watchFile() <del> * Add process.umask() (Friedemann Altrock) <add>* Add options to process.watchFile() <add>* Add process.umask() (Friedemann Altrock) <ide> <del> * Bugfix: only detach timers when active. <del> * Bugfix: lib/file.js write(), shouldn't always emit errors or success <del> (onne@onnlucky.com) <add>* Bugfix: only detach timers when active. <add>* Bugfix: lib/file.js write(), shouldn't always emit errors or success <add> (onne@onnlucky.com) <ide> <del> * Bugfix: Memory leak in fs.write <del> (Reported by onne@onnlucky.com) <add>* Bugfix: Memory leak in fs.write <add> (Reported by onne@onnlucky.com) <ide> <del> * Bugfix: Fix regular expressions detecting outgoing message headers. <del> (Reported by Elliott Cable) <add>* Bugfix: Fix regular expressions detecting outgoing message headers. <add> (Reported by Elliott Cable) <ide> <del> * Improvements to Multipart parser (Felix Geisendörfer) <del> * New HTTP parser <add>* Improvements to Multipart parser (Felix Geisendörfer) <add>* New HTTP parser <ide> <del> * Upgrade v8 to 2.0.2 <add>* Upgrade v8 to 2.0.2 <ide> <ide> <a id="0.1.18"></a> <ide> ## 2009.11.17, Version 0.1.18 <ide> <ide> https://github.com/nodejs/node/commit/027829d2853a14490e6de9fc5f7094652d045ab8 <ide> <del> * Feature: process.watchFile() process.unwatchFile() <del> * Feature: "uncaughtException" event on process <del> (Felix Geisendörfer) <add>* Feature: process.watchFile() process.unwatchFile() <add>* Feature: "uncaughtException" event on process <add> (Felix Geisendörfer) <ide> <del> * Feature: 'drain' event to tcp.Connection <del> * Bugfix: Promise.timeout() blocked the event loop <del> (Felix Geisendörfer) <add>* Feature: 'drain' event to tcp.Connection <add>* Bugfix: Promise.timeout() blocked the event loop <add> (Felix Geisendörfer) <ide> <del> * Bugfix: sendBody() and chunked utf8 strings <del> (Felix Geisendörfer) <add>* Bugfix: sendBody() and chunked utf8 strings <add> (Felix Geisendörfer) <ide> <del> * Supply the strerror as a second arg to the tcp.Connection close <del> event (Johan Sørensen) <add>* Supply the strerror as a second arg to the tcp.Connection close <add> event (Johan Sørensen) <ide> <del> * Add EventEmitter.removeListener (frodenius@gmail.com) <del> * Format JSON for inspecting objects (Felix Geisendörfer) <add>* Add EventEmitter.removeListener (frodenius@gmail.com) <add>* Format JSON for inspecting objects (Felix Geisendörfer) <ide> <del> * Upgrade libev to latest CVS <add>* Upgrade libev to latest CVS <ide> <ide> <a id="0.1.17"></a> <ide> ## 2009.11.07, Version 0.1.17 <ide> <ide> https://github.com/nodejs/node/commit/d1f69ef35dac810530df8249d523add168e09f03 <ide> <del> * Feature: process.chdir() (Brandon Beacher) <del> * Revert http parser upgrade. (b893859c34f05db5c45f416949ebc0eee665cca6) <del> Broke keep-alive. <add>* Feature: process.chdir() (Brandon Beacher) <add>* Revert http parser upgrade. (b893859c34f05db5c45f416949ebc0eee665cca6) <add> Broke keep-alive. <ide> <del> * API: rename process.inherits to sys.inherits <add>* API: rename process.inherits to sys.inherits <ide> <ide> <a id="0.1.16"></a> <ide> ## 2009.11.03, Version 0.1.16 <ide> <ide> https://github.com/nodejs/node/commit/726865af7bbafe58435986f4a193ff11c84e4bfe <ide> <del> * API: Use CommonJS-style module requiring <del> - require("/sys.js") becomes require("sys") <del> - require("circle.js") becomes require("./circle") <del> - process.path.join() becomes require("path").join() <del> - __module becomes module <add>* API: Use CommonJS-style module requiring <add> - require("/sys.js") becomes require("sys") <add> - require("circle.js") becomes require("./circle") <add> - process.path.join() becomes require("path").join() <add> - __module becomes module <ide> <del> * API: Many namespacing changes <del> - Move node.\* into process.\* <del> - Move node.dns into module "dns" <del> - Move node.fs into module "posix" <del> - process is no longer the global object. GLOBAL is. <del> For more information on the API changes see: <del> http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/6 <del> http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/14 <add>* API: Many namespacing changes <add> - Move node.\* into process.\* <add> - Move node.dns into module "dns" <add> - Move node.fs into module "posix" <add> - process is no longer the global object. GLOBAL is. <add>For more information on the API changes see: <add> http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/6 <add> http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/14 <ide> <del> * Feature: process.platform, process.memoryUsage() <del> * Feature: promise.cancel() (Felix Geisendörfer) <add>* Feature: process.platform, process.memoryUsage() <add>* Feature: promise.cancel() (Felix Geisendörfer) <ide> <del> * Upgrade V8 to 1.3.18 <add>* Upgrade V8 to 1.3.18 <ide> <ide> <a id="0.1.15"></a> <ide> ## 2009.10.28, Version 0.1.15 <ide> <ide> https://github.com/nodejs/node/commit/eca2de73ed786b935507fd1c6faccd8df9938fd3 <ide> <del> * Many build system fixes (esp. for OSX users) <del> * Feature: promise.timeout() (Felix Geisendörfer) <add>* Many build system fixes (esp. for OSX users) <add>* Feature: promise.timeout() (Felix Geisendörfer) <ide> <del> * Feature: Added external interface for signal handlers, process.pid, and <del> process.kill() (Brandon Beacher) <add>* Feature: Added external interface for signal handlers, process.pid, and <add> process.kill() (Brandon Beacher) <ide> <del> * API: Rename node.libraryPaths to require.paths <del> * Bugfix: 'data' event for stdio should emit a string <add>* API: Rename node.libraryPaths to require.paths <add>* Bugfix: 'data' event for stdio should emit a string <ide> <del> * Large file support <del> * Upgrade http_parser <add>* Large file support <add>* Upgrade http_parser <ide> <del> * Upgrade v8 to 1.3.16 <add>* Upgrade v8 to 1.3.16 <ide> <ide> <a id="0.1.14"></a> <ide> ## 2009.10.09, Version 0.1.14 <ide> <ide> https://github.com/nodejs/node/commit/d79b6e9f7ffad4c6aabbe5bd89108e2005366469 <ide> <del> * Feature: Improved addon builds with node-waf <del> * Feature: node.SignalHandler (Brandon Beacher) <add>* Feature: Improved addon builds with node-waf <add>* Feature: node.SignalHandler (Brandon Beacher) <ide> <del> * Feature: Enable V8 debugging (but still need to make a debugger) <del> * API: Rename library /utils.js to /sys.js <add>* Feature: Enable V8 debugging (but still need to make a debugger) <add>* API: Rename library /utils.js to /sys.js <ide> <del> * Clean up Node's build system <del> * Don't use parseUri for HTTP server <add>* Clean up Node's build system <add>* Don't use parseUri for HTTP server <ide> <del> * Remove node.pc <del> * Don't use /bin/sh to create child process except with exec() <add>* Remove node.pc <add>* Don't use /bin/sh to create child process except with exec() <ide> <del> * API: Add __module to reference current module <del> * API: Remove include() add node.mixin() <add>* API: Add __module to reference current module <add>* API: Remove include() add node.mixin() <ide> <del> * Normalize http headers; "Content-Length" becomes "content-length" <del> * Upgrade V8 to 1.3.15 <add>* Normalize http headers; "Content-Length" becomes "content-length" <add>* Upgrade V8 to 1.3.15 <ide> <ide> <a id="0.1.13"></a> <ide> ## 2009.09.30, Version 0.1.13 <ide> <ide> https://github.com/nodejs/node/commit/9c9d67eb6ce1162c8da05ff59624f6c3ade19bf7 <ide> <del> * Feature: Multipart stream parser (Felix Geisendörfer) <del> * API: Move node.puts(), node.exec() and others to /utils.js <add>* Feature: Multipart stream parser (Felix Geisendörfer) <add>* API: Move node.puts(), node.exec() and others to /utils.js <ide> <del> * API: Move http, tcp libraries to /http.js and /tcp.js <del> * API: Rename node.exit() to process.exit() <add>* API: Move http, tcp libraries to /http.js and /tcp.js <add>* API: Rename node.exit() to process.exit() <ide> <del> * Bugfix: require() and include() should work in callbacks. <del> * Pass the Host header in http.cat calls <add>* Bugfix: require() and include() should work in callbacks. <add>* Pass the Host header in http.cat calls <ide> <del> * Add warning when coroutine stack size grows too large. <del> * Enhance repl library (Ray Morgan) <add>* Add warning when coroutine stack size grows too large. <add>* Enhance repl library (Ray Morgan) <ide> <del> * Bugfix: build script for <del> GCC 4.4 (removed -Werror in V8), <del> on Linux 2.4, <del> and with Python 2.4.4. <add>* Bugfix: build script for <add> GCC 4.4 (removed -Werror in V8), <add> on Linux 2.4, <add> and with Python 2.4.4. <ide> <del> * Add read() and write() to /file.js to read and write <del> whole files at once. <add>* Add read() and write() to /file.js to read and write <add> whole files at once. <ide> <ide> <a id="0.1.12"></a> <ide> ## 2009.09.24, Version 0.1.12 <ide> <ide> https://github.com/nodejs/node/commit/2f56ccb45e87510de712f56705598b3b4e3548ec <ide> <del> * Feature: System modules, node.libraryPaths <del> * API: Remove "raw" encoding, rename "raws" to "binary". <add>* Feature: System modules, node.libraryPaths <add>* API: Remove "raw" encoding, rename "raws" to "binary". <ide> <del> * API: Added connection.setNoDElay() to disable Nagle algo. <del> * Decrease default TCP server backlog to 128 <add>* API: Added connection.setNoDElay() to disable Nagle algo. <add>* Decrease default TCP server backlog to 128 <ide> <del> * Bugfix: memory leak involving node.fs.* methods. <del> * Upgrade v8 to 1.3.13 <add>* Bugfix: memory leak involving node.fs.* methods. <add>* Upgrade v8 to 1.3.13 <ide> <ide> <a id="0.1.11"></a> <ide> ## 2009.09.18, Version 0.1.11 <ide> <ide> https://github.com/nodejs/node/commit/5ddc4f5d0c002bac0ae3d62fc0dc58f0d2d83ec4 <ide> <del> * API: default to utf8 encoding for node.fs.cat() <del> * API: add node.exec() <add>* API: default to utf8 encoding for node.fs.cat() <add>* API: add node.exec() <ide> <del> * API: node.fs.read() takes a normal encoding parameter. <del> * API: Change arguments of emit(), emitSuccess(), emitError() <add>* API: node.fs.read() takes a normal encoding parameter. <add>* API: Change arguments of emit(), emitSuccess(), emitError() <ide> <del> * Bugfix: node.fs.write() was stack allocating buffer. <del> * Bugfix: ReportException shouldn't forget the top frame. <add>* Bugfix: node.fs.write() was stack allocating buffer. <add>* Bugfix: ReportException shouldn't forget the top frame. <ide> <del> * Improve buffering for HTTP outgoing messages <del> * Fix and reenable x64 macintosh build. <add>* Improve buffering for HTTP outgoing messages <add>* Fix and reenable x64 macintosh build. <ide> <del> * Upgrade v8 to 1.3.11 <add>* Upgrade v8 to 1.3.11 <ide> <ide> <a id="0.1.10"></a> <ide> ## 2009.09.11, Version 0.1.10 <ide> <ide> https://github.com/nodejs/node/commit/12bb0d46ce761e3d00a27170e63b40408c15b558 <ide> <del> * Feature: raw string encoding "raws" <del> * Feature: access to environ through "ENV" <add>* Feature: raw string encoding "raws" <add>* Feature: access to environ through "ENV" <ide> <del> * Feature: add isDirectory, isFile, isSocket, ... methods <del> to stats object. <add>* Feature: add isDirectory, isFile, isSocket, ... methods <add> to stats object. <ide> <del> * Bugfix: Internally use full paths when loading modules <del> this fixes a shebang loading problem. <add>* Bugfix: Internally use full paths when loading modules <add> this fixes a shebang loading problem. <ide> <del> * Bugfix: Add '--' command line argument for separating v8 <del> args from program args. <add>* Bugfix: Add '--' command line argument for separating v8 <add> args from program args. <ide> <del> * Add man page. <del> * Add node-repl <add>* Add man page. <add>* Add node-repl <ide> <del> * Upgrade v8 to 1.3.10 <add>* Upgrade v8 to 1.3.10 <ide> <ide> <a id="0.1.9"></a> <ide> ## 2009.09.05, Version 0.1.9 <ide> <ide> https://github.com/nodejs/node/commit/ba6c5e38d54de30adfce69a21bafc81c35b07a03 <ide> <del> * Bugfix: Compile on Snow Leopard. <del> * Bugfix: Malformed URIs raising exceptions. <add>* Bugfix: Compile on Snow Leopard. <add>* Bugfix: Malformed URIs raising exceptions. <ide> <ide> <a id="0.1.8"></a> <ide> ## 2009.09.04, Version 0.1.8 <ide> <ide> https://github.com/nodejs/node/commit/734e86b9e568de5f694ae290a2b5c9395b70937c <ide> <del> * Feature: External modules <del> * Feature: setTimeout() for node.tcp.Connection <add>* Feature: External modules <add>* Feature: setTimeout() for node.tcp.Connection <ide> <del> * Feature: add node.cwd(), node.fs.readdir(), node.fs.mkdir() <del> * Bugfix: promise.wait() releasing out of order. <add>* Feature: add node.cwd(), node.fs.readdir(), node.fs.mkdir() <add>* Bugfix: promise.wait() releasing out of order. <ide> <del> * Bugfix: Asyncly do getaddrinfo() on Apple. <del> * Disable useless evcom error messages. <add>* Bugfix: Asyncly do getaddrinfo() on Apple. <add>* Disable useless evcom error messages. <ide> <del> * Better stack traces. <del> * Built natively on x64. <add>* Better stack traces. <add>* Built natively on x64. <ide> <del> * Upgrade v8 to 1.3.9 <add>* Upgrade v8 to 1.3.9 <ide> <ide> <a id="0.1.7"></a> <ide> ## 2009.08.27, Version 0.1.7 <ide> <ide> https://github.com/nodejs/node/commit/31db4f1ed837f3835937f60d31368bdb31998386 <ide> <del> * Feature: global 'process' object. Emits "exit". <del> * Feature: promise.wait() <add>* Feature: global 'process' object. Emits "exit". <add>* Feature: promise.wait() <ide> <del> * Feature: node.stdio <del> * Feature: EventEmitters emit "newListener" when listeners are <del> added <add>* Feature: node.stdio <add>* Feature: EventEmitters emit "newListener" when listeners are <add> added <ide> <del> * API: Use flat object instead of array-of-arrays for HTTP <del> headers. <add>* API: Use flat object instead of array-of-arrays for HTTP <add> headers. <ide> <del> * API: Remove buffered file object (node.File) <del> * API: require(), include() are synchronous. (Uses <del> continuations.) <add>* API: Remove buffered file object (node.File) <add>* API: require(), include() are synchronous. (Uses <add> continuations.) <ide> <del> * API: Deprecate onLoad and onExit. <del> * API: Rename node.Process to node.ChildProcess <add>* API: Deprecate onLoad and onExit. <add>* API: Rename node.Process to node.ChildProcess <ide> <del> * Refactor node.Process to take advantage of evcom_reader/writer. <del> * Upgrade v8 to 1.3.7 <add>* Refactor node.Process to take advantage of evcom_reader/writer. <add>* Upgrade v8 to 1.3.7 <ide> <ide> <a id="0.1.6"></a> <ide> ## 2009.08.22, Version 0.1.6 <ide> <ide> https://github.com/nodejs/node/commit/9c97b1db3099d61cd292aa59ec2227a619f3a7ab <ide> <del> * Bugfix: Ignore SIGPIPE. <add>* Bugfix: Ignore SIGPIPE. <ide> <ide> <a id="0.1.5"></a> <ide> ## 2009.08.21, Version 0.1.5 <ide> <ide> https://github.com/nodejs/node/commit/a73998d6f491227e595524dc70589369fb458224 <ide> <del> * Bugfix: Buggy connections could crash node.js. Now check <del> connection before sending data every time (Kevin van Zonneveld) <add>* Bugfix: Buggy connections could crash node.js. Now check <add> connection before sending data every time (Kevin van Zonneveld) <ide> <del> * Bugfix: stdin fd (0) being ignored by node.File. (Abe Fettig) <del> * API: Remove connection.fullClose() <add>* Bugfix: stdin fd (0) being ignored by node.File. (Abe Fettig) <add>* API: Remove connection.fullClose() <ide> <del> * API: Return the EventEmitter from addListener for chaining. <del> * API: tcp.Connection "disconnect" event renamed to "close" <add>* API: Return the EventEmitter from addListener for chaining. <add>* API: tcp.Connection "disconnect" event renamed to "close" <ide> <del> * Upgrade evcom <del> Upgrade v8 to 1.3.6 <add>* Upgrade evcom <add> Upgrade v8 to 1.3.6 <ide> <ide> <a id="0.1.4"></a> <ide> ## 2009.08.13, Version 0.1.4 <ide> <ide> https://github.com/nodejs/node/commit/0f888ed6de153f68c17005211d7e0f960a5e34f3 <ide> <del> * Major refactor to evcom. <del> * Enable test-tcp-many-clients. <add>* Major refactor to evcom. <add>* Enable test-tcp-many-clients. <ide> <del> * Add -m32 gcc flag to udns. <del> * Add connection.readPause() and connection.readResume() <del> Add IncomingMessage.prototype.pause() and resume(). <add>* Add -m32 gcc flag to udns. <add>* Add connection.readPause() and connection.readResume() <add> Add IncomingMessage.prototype.pause() and resume(). <ide> <del> * Fix http benchmark. Wasn't correctly dispatching. <del> * Bugfix: response.setBodyEncoding("ascii") not working. <add>* Fix http benchmark. Wasn't correctly dispatching. <add>* Bugfix: response.setBodyEncoding("ascii") not working. <ide> <del> * Bugfix: Negative ints in HTTP's on_body and node.fs.read() <del> * Upgrade v8 to 1.3.4 <del> Upgrade libev to 3.8 <del> Upgrade http_parser to v0.2 <add>* Bugfix: Negative ints in HTTP's on_body and node.fs.read() <add>* Upgrade v8 to 1.3.4 <add> Upgrade libev to 3.8 <add> Upgrade http_parser to v0.2 <ide> <ide> <a id="0.1.3"></a> <ide> ## 2009.08.06, Version 0.1.3 <ide> <ide> https://github.com/nodejs/node/commit/7464d423103b96c400d6875d390c19b637532ebf <ide> <del> * Upgrade v8 to 1.3.2 <del> * Bugfix: node.http.ServerRequest.setBodyEncoding('ascii') not <del> working <add>* Upgrade v8 to 1.3.2 <add>* Bugfix: node.http.ServerRequest.setBodyEncoding('ascii') not <add> working <ide> <del> * Bugfix: node.encodeUtf8 was broken. (Connor Dunn) <del> * Add ranlib to udns Makefile. <add>* Bugfix: node.encodeUtf8 was broken. (Connor Dunn) <add>* Add ranlib to udns Makefile. <ide> <del> * Upgrade evcom - fix accepting too many connections issue. <del> * Initial support for shebang <add>* Upgrade evcom - fix accepting too many connections issue. <add>* Initial support for shebang <ide> <del> * Add simple command line switches <del> * Add node.version API <add>* Add simple command line switches <add>* Add node.version API <ide> <ide> <a id="0.1.2"></a> <ide> ## 2009.08.01, Version 0.1.2 <ide> <ide> https://github.com/nodejs/node/commit/e10fbab00fd8325a7d05d1f854292143b8361e1f <ide> <del> * Add DNS API <del> * node.tcp.Server's backlog option is now an argument to listen() <add>* Add DNS API <add>* node.tcp.Server's backlog option is now an argument to listen() <ide> <del> * Upgrade V8 to 1.3.1 <del> * Bugfix: Default to chunked for client requests without <del> Content-Length. <add>* Upgrade V8 to 1.3.1 <add>* Bugfix: Default to chunked for client requests without <add> Content-Length. <ide> <del> * Bugfix: Line numbers in stack traces. <del> * Bugfix: negative integers in raw encoding stream <add>* Bugfix: Line numbers in stack traces. <add>* Bugfix: negative integers in raw encoding stream <ide> <del> * Bugfix: node.fs.File was not passing args to promise callbacks. <add>* Bugfix: node.fs.File was not passing args to promise callbacks. <ide> <ide> <a id="0.1.1"></a> <ide> ## 2009.07.27, Version 0.1.1 <ide> <ide> https://github.com/nodejs/node/commit/77d407df2826b20e9177c26c0d2bb4481e497937 <ide> <del> * Simplify and clean up ObjectWrap. <del> * Upgrade liboi (which is now called evcom) <del> Upgrade libev to 3.7 <del> Upgrade V8 to 1.2.14 <add>* Simplify and clean up ObjectWrap. <add>* Upgrade liboi (which is now called evcom) <add> Upgrade libev to 3.7 <add> Upgrade V8 to 1.2.14 <ide> <del> * Array.prototype.encodeUtf8 renamed to node.encodeUtf8(array) <del> * Move EventEmitter.prototype.emit() completely into C++. <add>* Array.prototype.encodeUtf8 renamed to node.encodeUtf8(array) <add>* Move EventEmitter.prototype.emit() completely into C++. <ide> <del> * Bugfix: Fix memory leak in event emitters. <del> http://groups.google.com/group/nodejs/browse_thread/thread/a8d1dfc2fd57a6d1 <add>* Bugfix: Fix memory leak in event emitters. <add> http://groups.google.com/group/nodejs/browse_thread/thread/a8d1dfc2fd57a6d1 <ide> <del> * Bugfix: Had problems reading scripts with non-ascii characters. <del> * Bugfix: Fix Detach() in node::Server <add>* Bugfix: Had problems reading scripts with non-ascii characters. <add>* Bugfix: Fix Detach() in node::Server <ide> <del> * Bugfix: Sockets not properly reattached if reconnected during <del> disconnect event. <add>* Bugfix: Sockets not properly reattached if reconnected during <add> disconnect event. <ide> <del> * Bugfix: Server-side clients not attached between creation and <del> on_connect. <add>* Bugfix: Server-side clients not attached between creation and <add> on_connect. <ide> <del> * Add 'close' event to node.tcp.Server <del> * Simplify and clean up http.js. (Takes more advantage of event <del> infrastructure.) <add>* Add 'close' event to node.tcp.Server <add>* Simplify and clean up http.js. (Takes more advantage of event <add> infrastructure.) <ide> <del> * Add benchmark scripts. Run with "make benchmark". <add>* Add benchmark scripts. Run with "make benchmark". <ide> <ide> <a id="0.1.0"></a> <ide> ## 2009.06.30, Version 0.1.0 <ide> <ide> https://github.com/nodejs/node/commit/813b53938b40484f63e7324c030e33711f26a149 <ide> <del> * Update documentation, use asciidoc. <del> * EventEmitter and Promise interfaces. (Breaks previous API.) <add>* Update documentation, use asciidoc. <add>* EventEmitter and Promise interfaces. (Breaks previous API.) <ide> <del> * Remove node.Process constructor in favor of node.createProcess <del> * Add -m32 flags for compiling on x64 platforms. <del> (Thanks to András Bártházi) <add>* Remove node.Process constructor in favor of node.createProcess <add>* Add -m32 flags for compiling on x64 platforms. <add> (Thanks to András Bártházi) <ide> <del> * Upgrade v8 to 1.2.10 and libev to 3.6 <del> * Bugfix: Timer::RepeatSetter wasn't working. <add>* Upgrade v8 to 1.2.10 and libev to 3.6 <add>* Bugfix: Timer::RepeatSetter wasn't working. <ide> <del> * Bugfix: Spawning many processes in a loop <del> (reported by Felix Geisendörfer) <add>* Bugfix: Spawning many processes in a loop <add> (reported by Felix Geisendörfer) <ide> <ide> <a id="0.0.6"></a> <ide> ## 2009.06.24, Version 0.0.6 <ide> <ide> https://github.com/nodejs/node/commit/fbe0be19ebfb422d8fa20ea5204c1713e9214d5f <ide> <del> * Load modules via HTTP URLs (Urban Hafner) <del> * Bugfix: Add HTTPConnection->size() and HTTPServer->size() <add>* Load modules via HTTP URLs (Urban Hafner) <add>* Bugfix: Add HTTPConnection->size() and HTTPServer->size() <ide> <del> * New node.Process API <del> * Clean up build tools, use v8's test runner. <add>* New node.Process API <add>* Clean up build tools, use v8's test runner. <ide> <del> * Use ev_unref() instead of starting/stopping the eio thread <del> pool watcher. <add>* Use ev_unref() instead of starting/stopping the eio thread <add> pool watcher. <ide> <ide> <a id="0.0.5"></a> <ide> ## 2009.06.18, Version 0.0.5 <ide> <ide> https://github.com/nodejs/node/commit/ec5f3dbae11ed121d24744861a8fce55636ecd66 <ide> <del> * Support for IPv6 <del> * Remove namespace node.constants <add>* Support for IPv6 <add>* Remove namespace node.constants <ide> <del> * Upgrade v8 to 1.2.8.1 <del> * Accept ports as strings in the TCP client and server. <add>* Upgrade v8 to 1.2.8.1 <add>* Accept ports as strings in the TCP client and server. <ide> <del> * Bugfix: HTTP Client race <del> * Bugfix: freeaddrinfo() wasn't getting called after <del> getaddrinfo() for TCP servers <add>* Bugfix: HTTP Client race <add>* Bugfix: freeaddrinfo() wasn't getting called after <add> getaddrinfo() for TCP servers <ide> <del> * Add "opening" to TCP client readyState <del> * Add remoteAddress to TCP client <add>* Add "opening" to TCP client readyState <add>* Add remoteAddress to TCP client <ide> <del> * Add global print() function. <add>* Add global print() function. <ide> <ide> <a id="0.0.4"></a> <ide> ## 2009.06.13, Version 0.0.4 <ide> <ide> https://github.com/nodejs/node/commit/916b9ca715b229b0703f0ed6c2fc065410fb189c <ide> <del> * Add interrupt() method to server-side HTTP requests. <del> * Bugfix: onBodyComplete was not getting called on server-side <del> HTTP <add>* Add interrupt() method to server-side HTTP requests. <add>* Bugfix: onBodyComplete was not getting called on server-side <add> HTTP <ide> <ide> <a id="0.0.3"></a> <ide> ## 2009.06.11, Version 0.0.3 <ide> <ide> https://github.com/nodejs/node/commit/4cfc982c776475eb65fb1080e6b575a86505a347 <ide> <del> * Many bug fixes including the problem with http.Client on <del> macintosh <add>* Many bug fixes including the problem with http.Client on <add> macintosh <ide> <del> * Upgrades v8 to 1.2.7 <del> * Adds onExit hook <add>* Upgrades v8 to 1.2.7 <add>* Adds onExit hook <ide> <del> * Guard against buffer overflow in http parser <del> * require() and include() now need the ".js" extension <add>* Guard against buffer overflow in http parser <add>* require() and include() now need the ".js" extension <ide> <del> * http.Client uses identity transfer encoding by default. <add>* http.Client uses identity transfer encoding by default. <ide><path>doc/changelogs/CHANGELOG_V10.md <ide> for details on patched vulnerabilities. <ide> <ide> A fix for the following CVE is included in this release: <ide> <del> * Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <add>* Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <del> * Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <del> * Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <del> * OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <del> * OpenSSL: Timing vulnerability in ECDSA signature generation (CVE-2019-0735) <add>* Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <add>* Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <add>* Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <add>* OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <add>* OpenSSL: Timing vulnerability in ECDSA signature generation (CVE-2019-0735) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * CVE-2018-0732 (OpenSSL) <del> * CVE-2018-7166 (Node.js) <del> * CVE-2018-12115 (Node.js) <add>* CVE-2018-0732 (OpenSSL) <add>* CVE-2018-7166 (Node.js) <add>* CVE-2018-12115 (Node.js) <ide> <ide> ### Notable Changes <ide> <ide><path>doc/changelogs/CHANGELOG_V11.md <ide> for details on patched vulnerabilities. <ide> <ide> A fix for the following CVE is included in this release: <ide> <del> * Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <add>* Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <ide> <ide> ### Notable Changes <ide> <ide> A fix for the following CVE is included in this release: <ide> * add inspection getter option (Ruben Bridgewater) [#24852](https://github.com/nodejs/node/pull/24852) <ide> <ide> ### Commits <del> * [[`bf4faf3ffc`](https://github.com/nodejs/node/commit/bf4faf3ffc)] - **assert,util**: harden comparison (Ruben Bridgewater) [#24831](https://github.com/nodejs/node/pull/24831) <del> * [[`302081bafc`](https://github.com/nodejs/node/commit/302081bafc)] - **build**: make lint-addon-docs run only if needed (Daniel Bevenius) [#24993](https://github.com/nodejs/node/pull/24993) <del> * [[`cc8a805e31`](https://github.com/nodejs/node/commit/cc8a805e31)] - **build**: fix compiler version detection (Richard Lau) [#24879](https://github.com/nodejs/node/pull/24879) <del> * [[`bde5df20d6`](https://github.com/nodejs/node/commit/bde5df20d6)] - **doc**: fix node.1 --http-parser sort order (cjihrig) [#25045](https://github.com/nodejs/node/pull/25045) <del> * [[`a9f239fb60`](https://github.com/nodejs/node/commit/a9f239fb60)] - **doc**: add EventTarget link to worker\_threads (Azard) [#25058](https://github.com/nodejs/node/pull/25058) <del> * [[`00ce972305`](https://github.com/nodejs/node/commit/00ce972305)] - **doc**: make README formatting more consistent (wenjun ye) [#25003](https://github.com/nodejs/node/pull/25003) <del> * [[`dbdea36190`](https://github.com/nodejs/node/commit/dbdea36190)] - **doc**: add codebytere's info to release team (Shelley Vohr) [#25022](https://github.com/nodejs/node/pull/25022) <del> * [[`877f8a0094`](https://github.com/nodejs/node/commit/877f8a0094)] - **doc**: revise internal vs. public API in Collaborator Guide (Rich Trott) [#24975](https://github.com/nodejs/node/pull/24975) <del> * [[`f0bcacdcc6`](https://github.com/nodejs/node/commit/f0bcacdcc6)] - **doc**: update a link of npm repository (Daijiro Wachi) [#24969](https://github.com/nodejs/node/pull/24969) <del> * [[`1e096291d6`](https://github.com/nodejs/node/commit/1e096291d6)] - **doc**: fix author-ready conflict (Ruben Bridgewater) [#25015](https://github.com/nodejs/node/pull/25015) <del> * [[`b2e6cbddd8`](https://github.com/nodejs/node/commit/b2e6cbddd8)] - **doc**: update Useful CI Jobs section of Collaborator Guide (Rich Trott) [#24916](https://github.com/nodejs/node/pull/24916) <del> * [[`9bfbb6822b`](https://github.com/nodejs/node/commit/9bfbb6822b)] - **doc**: add class worker documentation (yoshimoto koki) [#24849](https://github.com/nodejs/node/pull/24849) <del> * [[`0220cd3260`](https://github.com/nodejs/node/commit/0220cd3260)] - **doc**: remove bad link to irc info (Richard Lau) [#24967](https://github.com/nodejs/node/pull/24967) <del> * [[`a6a3829962`](https://github.com/nodejs/node/commit/a6a3829962)] - **doc**: simplify author ready (Ruben Bridgewater) [#24893](https://github.com/nodejs/node/pull/24893) <del> * [[`cda1da9200`](https://github.com/nodejs/node/commit/cda1da9200)] - **doc**: update "Testing and CI" in Collaborator Guide (Rich Trott) [#24884](https://github.com/nodejs/node/pull/24884) <del> * [[`81dce68a9d`](https://github.com/nodejs/node/commit/81dce68a9d)] - **doc**: update http doc for new Agent()/support options in socket.connect() (Beni von Cheni) [#24846](https://github.com/nodejs/node/pull/24846) <del> * [[`643ca14d2c`](https://github.com/nodejs/node/commit/643ca14d2c)] - **doc**: fix order of events when request is aborted (Luigi Pinca) [#24779](https://github.com/nodejs/node/pull/24779) <del> * [[`c300aaa208`](https://github.com/nodejs/node/commit/c300aaa208)] - **doc**: update LICENSE file (Anna Henningsen) [#24898](https://github.com/nodejs/node/pull/24898) <del> * [[`c4f3cf9759`](https://github.com/nodejs/node/commit/c4f3cf9759)] - **doc**: revise Waiting for Approvals documentation (Rich Trott) [#24845](https://github.com/nodejs/node/pull/24845) <del> * [[`56b2a7274c`](https://github.com/nodejs/node/commit/56b2a7274c)] - **inspector**: split the HostPort being used and the one parsed from CLI (Joyee Cheung) [#24772](https://github.com/nodejs/node/pull/24772) <del> * [[`2456a545a6`](https://github.com/nodejs/node/commit/2456a545a6)] - **lib**: ensure readable stream flows to end (Mikko Rantanen) [#24918](https://github.com/nodejs/node/pull/24918) <del> * [[`79c52a9f88`](https://github.com/nodejs/node/commit/79c52a9f88)] - **lib**: improve error creation performance (Ruben Bridgewater) [#24747](https://github.com/nodejs/node/pull/24747) <del> * [[`25dae6cffd`](https://github.com/nodejs/node/commit/25dae6cffd)] - **module**: use validateString in modules/esm (ZYSzys) [#24868](https://github.com/nodejs/node/pull/24868) <del> * [[`2a11e6aaf3`](https://github.com/nodejs/node/commit/2a11e6aaf3)] - **module**: use validateString in modules/cjs (ZYSzys) [#24863](https://github.com/nodejs/node/pull/24863) <del> * [[`f4d5c358d9`](https://github.com/nodejs/node/commit/f4d5c358d9)] - **net**: use strict comparisons for fd (cjihrig) [#25014](https://github.com/nodejs/node/pull/25014) <del> * [[`5f60ed7647`](https://github.com/nodejs/node/commit/5f60ed7647)] - **path**: replace assertPath() with validator (cjihrig) [#24840](https://github.com/nodejs/node/pull/24840) <del> * [[`f43f45a26c`](https://github.com/nodejs/node/commit/f43f45a26c)] - **process**: properly close file descriptor on exit (Ruben Bridgewater) [#24972](https://github.com/nodejs/node/pull/24972) <del> * [[`8b109f05d9`](https://github.com/nodejs/node/commit/8b109f05d9)] - **process**: simplify check in previousValueIsValid() (cjihrig) [#24836](https://github.com/nodejs/node/pull/24836) <del> * [[`2e94f3b798`](https://github.com/nodejs/node/commit/2e94f3b798)] - **querystring**: remove eslint-disable (cjihrig) [#24995](https://github.com/nodejs/node/pull/24995) <del> * [[`5f8950b652`](https://github.com/nodejs/node/commit/5f8950b652)] - **src**: emit 'params' instead of 'data' for NodeTracing.dataCollected (Kelvin Jin) [#24949](https://github.com/nodejs/node/pull/24949) <del> * [[`d0270f3a5c`](https://github.com/nodejs/node/commit/d0270f3a5c)] - **src**: add GetLoadedLibraries routine (Gireesh Punathil) [#24825](https://github.com/nodejs/node/pull/24825) <del> * [[`f8547019c7`](https://github.com/nodejs/node/commit/f8547019c7)] - **src**: include node\_internals.h in node\_metadata.cc (Daniel Bevenius) [#24933](https://github.com/nodejs/node/pull/24933) <del> * [[`5a1289d128`](https://github.com/nodejs/node/commit/5a1289d128)] - **src**: create env-\>inspector\_console\_api\_object earlier (Joyee Cheung) [#24906](https://github.com/nodejs/node/pull/24906) <del> * [[`d7605725df`](https://github.com/nodejs/node/commit/d7605725df)] - **src**: remove use of CallOnForegroundThread() (cjihrig) [#24925](https://github.com/nodejs/node/pull/24925) <del> * [[`08c6b2126c`](https://github.com/nodejs/node/commit/08c6b2126c)] - **src**: use Local version of ToBoolean() (cjihrig) [#24924](https://github.com/nodejs/node/pull/24924) <del> * [[`5206f3add5`](https://github.com/nodejs/node/commit/5206f3add5)] - **src**: do not alias new and old signal masks (Sam Roberts) [#24810](https://github.com/nodejs/node/pull/24810) <del> * [[`94d02cabb9`](https://github.com/nodejs/node/commit/94d02cabb9)] - **src**: fix warning for potential snprintf truncation (Sam Roberts) [#24810](https://github.com/nodejs/node/pull/24810) <del> * [[`9b000e5088`](https://github.com/nodejs/node/commit/9b000e5088)] - **src**: remove finalized\_ member from Hash class (Daniel Bevenius) [#24822](https://github.com/nodejs/node/pull/24822) <del> * [[`90d481ea45`](https://github.com/nodejs/node/commit/90d481ea45)] - **src**: remove unused env variables in node\_util (Daniel Bevenius) [#24820](https://github.com/nodejs/node/pull/24820) <del> * [[`d449c36500`](https://github.com/nodejs/node/commit/d449c36500)] - **stream**: re-use existing `once()` implementation (Anna Henningsen) [#24991](https://github.com/nodejs/node/pull/24991) <del> * [[`39af61faa2`](https://github.com/nodejs/node/commit/39af61faa2)] - **stream**: fix end-of-stream for HTTP/2 (Anna Henningsen) [#24926](https://github.com/nodejs/node/pull/24926) <del> * [[`4f0d17b019`](https://github.com/nodejs/node/commit/4f0d17b019)] - **test**: remove unnecessary linter comment (cjihrig) [#25013](https://github.com/nodejs/node/pull/25013) <del> * [[`ab1801b8ad`](https://github.com/nodejs/node/commit/ab1801b8ad)] - **test**: use global.gc() instead of gc() (cjihrig) [#25012](https://github.com/nodejs/node/pull/25012) <del> * [[`ddff644172`](https://github.com/nodejs/node/commit/ddff644172)] - **test**: run eslint on test file and fix errors (Ruben Bridgewater) [#25009](https://github.com/nodejs/node/pull/25009) <del> * [[`110fd39dfe`](https://github.com/nodejs/node/commit/110fd39dfe)] - **test**: remove dead code (Ruben Bridgewater) [#25009](https://github.com/nodejs/node/pull/25009) <del> * [[`e04e85460f`](https://github.com/nodejs/node/commit/e04e85460f)] - **test**: use blocks instead of async IIFE (Anna Henningsen) [#24989](https://github.com/nodejs/node/pull/24989) <del> * [[`eb9e6e6576`](https://github.com/nodejs/node/commit/eb9e6e6576)] - **test**: adding history regression test case (Anto Aravinth) [#24843](https://github.com/nodejs/node/pull/24843) <del> * [[`ac919efbaf`](https://github.com/nodejs/node/commit/ac919efbaf)] - **test**: mark test-child-process-execfile flaky (Rich Trott) [#25051](https://github.com/nodejs/node/pull/25051) <del> * [[`1e3fb0ae03`](https://github.com/nodejs/node/commit/1e3fb0ae03)] - **test**: mark test-child-process-exit-code flaky (Rich Trott) [#25050](https://github.com/nodejs/node/pull/25050) <del> * [[`7e0dbc6e01`](https://github.com/nodejs/node/commit/7e0dbc6e01)] - **test**: improve WPT runner name matching (Joyee Cheung) [#24826](https://github.com/nodejs/node/pull/24826) <del> * [[`da984be0a3`](https://github.com/nodejs/node/commit/da984be0a3)] - **test**: remove reference to whatwg in file names under test/wpt (Joyee Cheung) [#24826](https://github.com/nodejs/node/pull/24826) <del> * [[`282589456c`](https://github.com/nodejs/node/commit/282589456c)] - **test**: mark test-worker-memory flaky on Windows CI (Rich Trott) [#25042](https://github.com/nodejs/node/pull/25042) <del> * [[`9bd42671c9`](https://github.com/nodejs/node/commit/9bd42671c9)] - **test**: mark test-cli-node-options flaky on arm (Rich Trott) [#25032](https://github.com/nodejs/node/pull/25032) <del> * [[`a4ef54a0a6`](https://github.com/nodejs/node/commit/a4ef54a0a6)] - **test**: mark test-child-process-execsync flaky on AIX (Rich Trott) [#25031](https://github.com/nodejs/node/pull/25031) <del> * [[`900a412f3f`](https://github.com/nodejs/node/commit/900a412f3f)] - **test**: increase error information in test-cli-syntax-\* (Rich Trott) [#25021](https://github.com/nodejs/node/pull/25021) <del> * [[`d5b0ce15d3`](https://github.com/nodejs/node/commit/d5b0ce15d3)] - **test**: refactor test-enable-in-init (Mitch Hankins) [#24976](https://github.com/nodejs/node/pull/24976) <del> * [[`649a7289dc`](https://github.com/nodejs/node/commit/649a7289dc)] - **test**: from functools import reduce in test/testpy/\_\_init\_\_.py (cclauss) [#24954](https://github.com/nodejs/node/pull/24954) <del> * [[`d366676cc5`](https://github.com/nodejs/node/commit/d366676cc5)] - **test**: split test-cli-syntax into multiple tests (Rich Trott) [#24922](https://github.com/nodejs/node/pull/24922) <del> * [[`e61bbda85d`](https://github.com/nodejs/node/commit/e61bbda85d)] - **test**: improve internet/test-dns (Ilarion Halushka) [#24927](https://github.com/nodejs/node/pull/24927) <del> * [[`016e35210c`](https://github.com/nodejs/node/commit/016e35210c)] - **(SEMVER-MINOR)** **test**: test TLS client authentication (Sam Roberts) [#24733](https://github.com/nodejs/node/pull/24733) <del> * [[`e050a5756f`](https://github.com/nodejs/node/commit/e050a5756f)] - **test**: replace callback with arrows (Shubham Urkade) [#24866](https://github.com/nodejs/node/pull/24866) <del> * [[`22b6befa14`](https://github.com/nodejs/node/commit/22b6befa14)] - **test**: mark test-cli-syntax as flaky/unreliable (Rich Trott) [#24957](https://github.com/nodejs/node/pull/24957) <del> * [[`56fd127ef0`](https://github.com/nodejs/node/commit/56fd127ef0)] - **test**: do not lint macros files (again) (cclauss) [#24886](https://github.com/nodejs/node/pull/24886) <del> * [[`bc71e9e0d6`](https://github.com/nodejs/node/commit/bc71e9e0d6)] - **test**: prepare test/pseudo-tty/testcfg.py Python 3 (cclauss) [#24887](https://github.com/nodejs/node/pull/24887) <del> * [[`f41443cc5c`](https://github.com/nodejs/node/commit/f41443cc5c)] - **test**: move test-cli-syntax to sequential (Rich Trott) [#24907](https://github.com/nodejs/node/pull/24907) <del> * [[`592bad1b0b`](https://github.com/nodejs/node/commit/592bad1b0b)] - **test**: move http2 test to parallel (Rich Trott) [#24877](https://github.com/nodejs/node/pull/24877) <del> * [[`91ce957037`](https://github.com/nodejs/node/commit/91ce957037)] - **test**: make http2 timeout test robust (Rich Trott) [#24877](https://github.com/nodejs/node/pull/24877) <del> * [[`3d87688fba`](https://github.com/nodejs/node/commit/3d87688fba)] - **test**: fix wrong parameter (zhmushan) [#24844](https://github.com/nodejs/node/pull/24844) <del> * [[`6db760c231`](https://github.com/nodejs/node/commit/6db760c231)] - **test**: improve test-net-socket-timeout (Rich Trott) [#24859](https://github.com/nodejs/node/pull/24859) <del> * [[`526ff1d1d2`](https://github.com/nodejs/node/commit/526ff1d1d2)] - **test**: prepare test/pseudo-tty/testcfg.py for Python 3 (cclauss) [#24791](https://github.com/nodejs/node/pull/24791) <del> * [[`a5c57861a9`](https://github.com/nodejs/node/commit/a5c57861a9)] - **test**: refactor test-fs-write-file-sync.js (cjihrig) [#24834](https://github.com/nodejs/node/pull/24834) <del> * [[`a5c8af7af4`](https://github.com/nodejs/node/commit/a5c8af7af4)] - **test**: prepare test/message/testcfg.py for Python 3 (cclauss) [#24793](https://github.com/nodejs/node/pull/24793) <del> * [[`390e050ae0`](https://github.com/nodejs/node/commit/390e050ae0)] - **(SEMVER-MINOR)** **tls**: support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts) [#24733](https://github.com/nodejs/node/pull/24733) <del> * [[`16a75beffc`](https://github.com/nodejs/node/commit/16a75beffc)] - **tools**: prepare ./tools/compress\_json.py for Python 3 (cclauss) [#24889](https://github.com/nodejs/node/pull/24889) <del> * [[`b60808a2da`](https://github.com/nodejs/node/commit/b60808a2da)] - **tools**: prepare tools/testp.py for Python 3 (cclauss) [#24890](https://github.com/nodejs/node/pull/24890) <del> * [[`1f61c89a7f`](https://github.com/nodejs/node/commit/1f61c89a7f)] - **tools**: prepare tools/icu/icutrim.py for Python 3 (cclauss) [#24888](https://github.com/nodejs/node/pull/24888) <del> * [[`e140d41789`](https://github.com/nodejs/node/commit/e140d41789)] - **tools**: capitalize sentences (Ruben Bridgewater) [#24808](https://github.com/nodejs/node/pull/24808) <del> * [[`ad6104dbac`](https://github.com/nodejs/node/commit/ad6104dbac)] - **tools**: update ESLint to 5.10.0 (cjihrig) [#24903](https://github.com/nodejs/node/pull/24903) <del> * [[`ac46e27714`](https://github.com/nodejs/node/commit/ac46e27714)] - **tools**: do not lint tools/inspector\_protocol or tools/markupsafe (cclauss) [#24882](https://github.com/nodejs/node/pull/24882) <del> * [[`c3dda00e48`](https://github.com/nodejs/node/commit/c3dda00e48)] - **tools**: prepare tools/js2c.py for Python 3 (cclauss) [#24798](https://github.com/nodejs/node/pull/24798) <del> * [[`7cac76cdd5`](https://github.com/nodejs/node/commit/7cac76cdd5)] - **tools**: prepare tools/specialize\_node\_d.py for Python 3 (cclauss) [#24797](https://github.com/nodejs/node/pull/24797) <del> * [[`15632c3867`](https://github.com/nodejs/node/commit/15632c3867)] - **tools**: prepare tools/test.py for Python 3 (cclauss) [#24799](https://github.com/nodejs/node/pull/24799) <del> * [[`022599c0e1`](https://github.com/nodejs/node/commit/022599c0e1)] - **tools**: prepare tools/genv8constants.py for Python 3 (cclauss) [#24801](https://github.com/nodejs/node/pull/24801) <del> * [[`e7b77ead74`](https://github.com/nodejs/node/commit/e7b77ead74)] - **url**: remove an eslint-disable comment (cjihrig) [#24995](https://github.com/nodejs/node/pull/24995) <del> * [[`59317470e3`](https://github.com/nodejs/node/commit/59317470e3)] - **util**: inspect all prototypes (Ruben Bridgewater) [#24974](https://github.com/nodejs/node/pull/24974) <del> * [[`a1f0da1d40`](https://github.com/nodejs/node/commit/a1f0da1d40)] - **util**: remove todo (Ruben Bridgewater) [#24982](https://github.com/nodejs/node/pull/24982) <del> * [[`117e99121c`](https://github.com/nodejs/node/commit/117e99121c)] - **(SEMVER-MINOR)** **util**: add inspection getter option (Ruben Bridgewater) [#24852](https://github.com/nodejs/node/pull/24852) <del> * [[`331f6044b9`](https://github.com/nodejs/node/commit/331f6044b9)] - **worker**: drain messages from internal message port (Yael Hermon) [#24932](https://github.com/nodejs/node/pull/24932) <add> <add>* [[`bf4faf3ffc`](https://github.com/nodejs/node/commit/bf4faf3ffc)] - **assert,util**: harden comparison (Ruben Bridgewater) [#24831](https://github.com/nodejs/node/pull/24831) <add>* [[`302081bafc`](https://github.com/nodejs/node/commit/302081bafc)] - **build**: make lint-addon-docs run only if needed (Daniel Bevenius) [#24993](https://github.com/nodejs/node/pull/24993) <add>* [[`cc8a805e31`](https://github.com/nodejs/node/commit/cc8a805e31)] - **build**: fix compiler version detection (Richard Lau) [#24879](https://github.com/nodejs/node/pull/24879) <add>* [[`bde5df20d6`](https://github.com/nodejs/node/commit/bde5df20d6)] - **doc**: fix node.1 --http-parser sort order (cjihrig) [#25045](https://github.com/nodejs/node/pull/25045) <add>* [[`a9f239fb60`](https://github.com/nodejs/node/commit/a9f239fb60)] - **doc**: add EventTarget link to worker\_threads (Azard) [#25058](https://github.com/nodejs/node/pull/25058) <add>* [[`00ce972305`](https://github.com/nodejs/node/commit/00ce972305)] - **doc**: make README formatting more consistent (wenjun ye) [#25003](https://github.com/nodejs/node/pull/25003) <add>* [[`dbdea36190`](https://github.com/nodejs/node/commit/dbdea36190)] - **doc**: add codebytere's info to release team (Shelley Vohr) [#25022](https://github.com/nodejs/node/pull/25022) <add>* [[`877f8a0094`](https://github.com/nodejs/node/commit/877f8a0094)] - **doc**: revise internal vs. public API in Collaborator Guide (Rich Trott) [#24975](https://github.com/nodejs/node/pull/24975) <add>* [[`f0bcacdcc6`](https://github.com/nodejs/node/commit/f0bcacdcc6)] - **doc**: update a link of npm repository (Daijiro Wachi) [#24969](https://github.com/nodejs/node/pull/24969) <add>* [[`1e096291d6`](https://github.com/nodejs/node/commit/1e096291d6)] - **doc**: fix author-ready conflict (Ruben Bridgewater) [#25015](https://github.com/nodejs/node/pull/25015) <add>* [[`b2e6cbddd8`](https://github.com/nodejs/node/commit/b2e6cbddd8)] - **doc**: update Useful CI Jobs section of Collaborator Guide (Rich Trott) [#24916](https://github.com/nodejs/node/pull/24916) <add>* [[`9bfbb6822b`](https://github.com/nodejs/node/commit/9bfbb6822b)] - **doc**: add class worker documentation (yoshimoto koki) [#24849](https://github.com/nodejs/node/pull/24849) <add>* [[`0220cd3260`](https://github.com/nodejs/node/commit/0220cd3260)] - **doc**: remove bad link to irc info (Richard Lau) [#24967](https://github.com/nodejs/node/pull/24967) <add>* [[`a6a3829962`](https://github.com/nodejs/node/commit/a6a3829962)] - **doc**: simplify author ready (Ruben Bridgewater) [#24893](https://github.com/nodejs/node/pull/24893) <add>* [[`cda1da9200`](https://github.com/nodejs/node/commit/cda1da9200)] - **doc**: update "Testing and CI" in Collaborator Guide (Rich Trott) [#24884](https://github.com/nodejs/node/pull/24884) <add>* [[`81dce68a9d`](https://github.com/nodejs/node/commit/81dce68a9d)] - **doc**: update http doc for new Agent()/support options in socket.connect() (Beni von Cheni) [#24846](https://github.com/nodejs/node/pull/24846) <add>* [[`643ca14d2c`](https://github.com/nodejs/node/commit/643ca14d2c)] - **doc**: fix order of events when request is aborted (Luigi Pinca) [#24779](https://github.com/nodejs/node/pull/24779) <add>* [[`c300aaa208`](https://github.com/nodejs/node/commit/c300aaa208)] - **doc**: update LICENSE file (Anna Henningsen) [#24898](https://github.com/nodejs/node/pull/24898) <add>* [[`c4f3cf9759`](https://github.com/nodejs/node/commit/c4f3cf9759)] - **doc**: revise Waiting for Approvals documentation (Rich Trott) [#24845](https://github.com/nodejs/node/pull/24845) <add>* [[`56b2a7274c`](https://github.com/nodejs/node/commit/56b2a7274c)] - **inspector**: split the HostPort being used and the one parsed from CLI (Joyee Cheung) [#24772](https://github.com/nodejs/node/pull/24772) <add>* [[`2456a545a6`](https://github.com/nodejs/node/commit/2456a545a6)] - **lib**: ensure readable stream flows to end (Mikko Rantanen) [#24918](https://github.com/nodejs/node/pull/24918) <add>* [[`79c52a9f88`](https://github.com/nodejs/node/commit/79c52a9f88)] - **lib**: improve error creation performance (Ruben Bridgewater) [#24747](https://github.com/nodejs/node/pull/24747) <add>* [[`25dae6cffd`](https://github.com/nodejs/node/commit/25dae6cffd)] - **module**: use validateString in modules/esm (ZYSzys) [#24868](https://github.com/nodejs/node/pull/24868) <add>* [[`2a11e6aaf3`](https://github.com/nodejs/node/commit/2a11e6aaf3)] - **module**: use validateString in modules/cjs (ZYSzys) [#24863](https://github.com/nodejs/node/pull/24863) <add>* [[`f4d5c358d9`](https://github.com/nodejs/node/commit/f4d5c358d9)] - **net**: use strict comparisons for fd (cjihrig) [#25014](https://github.com/nodejs/node/pull/25014) <add>* [[`5f60ed7647`](https://github.com/nodejs/node/commit/5f60ed7647)] - **path**: replace assertPath() with validator (cjihrig) [#24840](https://github.com/nodejs/node/pull/24840) <add>* [[`f43f45a26c`](https://github.com/nodejs/node/commit/f43f45a26c)] - **process**: properly close file descriptor on exit (Ruben Bridgewater) [#24972](https://github.com/nodejs/node/pull/24972) <add>* [[`8b109f05d9`](https://github.com/nodejs/node/commit/8b109f05d9)] - **process**: simplify check in previousValueIsValid() (cjihrig) [#24836](https://github.com/nodejs/node/pull/24836) <add>* [[`2e94f3b798`](https://github.com/nodejs/node/commit/2e94f3b798)] - **querystring**: remove eslint-disable (cjihrig) [#24995](https://github.com/nodejs/node/pull/24995) <add>* [[`5f8950b652`](https://github.com/nodejs/node/commit/5f8950b652)] - **src**: emit 'params' instead of 'data' for NodeTracing.dataCollected (Kelvin Jin) [#24949](https://github.com/nodejs/node/pull/24949) <add>* [[`d0270f3a5c`](https://github.com/nodejs/node/commit/d0270f3a5c)] - **src**: add GetLoadedLibraries routine (Gireesh Punathil) [#24825](https://github.com/nodejs/node/pull/24825) <add>* [[`f8547019c7`](https://github.com/nodejs/node/commit/f8547019c7)] - **src**: include node\_internals.h in node\_metadata.cc (Daniel Bevenius) [#24933](https://github.com/nodejs/node/pull/24933) <add>* [[`5a1289d128`](https://github.com/nodejs/node/commit/5a1289d128)] - **src**: create env-\>inspector\_console\_api\_object earlier (Joyee Cheung) [#24906](https://github.com/nodejs/node/pull/24906) <add>* [[`d7605725df`](https://github.com/nodejs/node/commit/d7605725df)] - **src**: remove use of CallOnForegroundThread() (cjihrig) [#24925](https://github.com/nodejs/node/pull/24925) <add>* [[`08c6b2126c`](https://github.com/nodejs/node/commit/08c6b2126c)] - **src**: use Local version of ToBoolean() (cjihrig) [#24924](https://github.com/nodejs/node/pull/24924) <add>* [[`5206f3add5`](https://github.com/nodejs/node/commit/5206f3add5)] - **src**: do not alias new and old signal masks (Sam Roberts) [#24810](https://github.com/nodejs/node/pull/24810) <add>* [[`94d02cabb9`](https://github.com/nodejs/node/commit/94d02cabb9)] - **src**: fix warning for potential snprintf truncation (Sam Roberts) [#24810](https://github.com/nodejs/node/pull/24810) <add>* [[`9b000e5088`](https://github.com/nodejs/node/commit/9b000e5088)] - **src**: remove finalized\_ member from Hash class (Daniel Bevenius) [#24822](https://github.com/nodejs/node/pull/24822) <add>* [[`90d481ea45`](https://github.com/nodejs/node/commit/90d481ea45)] - **src**: remove unused env variables in node\_util (Daniel Bevenius) [#24820](https://github.com/nodejs/node/pull/24820) <add>* [[`d449c36500`](https://github.com/nodejs/node/commit/d449c36500)] - **stream**: re-use existing `once()` implementation (Anna Henningsen) [#24991](https://github.com/nodejs/node/pull/24991) <add>* [[`39af61faa2`](https://github.com/nodejs/node/commit/39af61faa2)] - **stream**: fix end-of-stream for HTTP/2 (Anna Henningsen) [#24926](https://github.com/nodejs/node/pull/24926) <add>* [[`4f0d17b019`](https://github.com/nodejs/node/commit/4f0d17b019)] - **test**: remove unnecessary linter comment (cjihrig) [#25013](https://github.com/nodejs/node/pull/25013) <add>* [[`ab1801b8ad`](https://github.com/nodejs/node/commit/ab1801b8ad)] - **test**: use global.gc() instead of gc() (cjihrig) [#25012](https://github.com/nodejs/node/pull/25012) <add>* [[`ddff644172`](https://github.com/nodejs/node/commit/ddff644172)] - **test**: run eslint on test file and fix errors (Ruben Bridgewater) [#25009](https://github.com/nodejs/node/pull/25009) <add>* [[`110fd39dfe`](https://github.com/nodejs/node/commit/110fd39dfe)] - **test**: remove dead code (Ruben Bridgewater) [#25009](https://github.com/nodejs/node/pull/25009) <add>* [[`e04e85460f`](https://github.com/nodejs/node/commit/e04e85460f)] - **test**: use blocks instead of async IIFE (Anna Henningsen) [#24989](https://github.com/nodejs/node/pull/24989) <add>* [[`eb9e6e6576`](https://github.com/nodejs/node/commit/eb9e6e6576)] - **test**: adding history regression test case (Anto Aravinth) [#24843](https://github.com/nodejs/node/pull/24843) <add>* [[`ac919efbaf`](https://github.com/nodejs/node/commit/ac919efbaf)] - **test**: mark test-child-process-execfile flaky (Rich Trott) [#25051](https://github.com/nodejs/node/pull/25051) <add>* [[`1e3fb0ae03`](https://github.com/nodejs/node/commit/1e3fb0ae03)] - **test**: mark test-child-process-exit-code flaky (Rich Trott) [#25050](https://github.com/nodejs/node/pull/25050) <add>* [[`7e0dbc6e01`](https://github.com/nodejs/node/commit/7e0dbc6e01)] - **test**: improve WPT runner name matching (Joyee Cheung) [#24826](https://github.com/nodejs/node/pull/24826) <add>* [[`da984be0a3`](https://github.com/nodejs/node/commit/da984be0a3)] - **test**: remove reference to whatwg in file names under test/wpt (Joyee Cheung) [#24826](https://github.com/nodejs/node/pull/24826) <add>* [[`282589456c`](https://github.com/nodejs/node/commit/282589456c)] - **test**: mark test-worker-memory flaky on Windows CI (Rich Trott) [#25042](https://github.com/nodejs/node/pull/25042) <add>* [[`9bd42671c9`](https://github.com/nodejs/node/commit/9bd42671c9)] - **test**: mark test-cli-node-options flaky on arm (Rich Trott) [#25032](https://github.com/nodejs/node/pull/25032) <add>* [[`a4ef54a0a6`](https://github.com/nodejs/node/commit/a4ef54a0a6)] - **test**: mark test-child-process-execsync flaky on AIX (Rich Trott) [#25031](https://github.com/nodejs/node/pull/25031) <add>* [[`900a412f3f`](https://github.com/nodejs/node/commit/900a412f3f)] - **test**: increase error information in test-cli-syntax-\* (Rich Trott) [#25021](https://github.com/nodejs/node/pull/25021) <add>* [[`d5b0ce15d3`](https://github.com/nodejs/node/commit/d5b0ce15d3)] - **test**: refactor test-enable-in-init (Mitch Hankins) [#24976](https://github.com/nodejs/node/pull/24976) <add>* [[`649a7289dc`](https://github.com/nodejs/node/commit/649a7289dc)] - **test**: from functools import reduce in test/testpy/\_\_init\_\_.py (cclauss) [#24954](https://github.com/nodejs/node/pull/24954) <add>* [[`d366676cc5`](https://github.com/nodejs/node/commit/d366676cc5)] - **test**: split test-cli-syntax into multiple tests (Rich Trott) [#24922](https://github.com/nodejs/node/pull/24922) <add>* [[`e61bbda85d`](https://github.com/nodejs/node/commit/e61bbda85d)] - **test**: improve internet/test-dns (Ilarion Halushka) [#24927](https://github.com/nodejs/node/pull/24927) <add>* [[`016e35210c`](https://github.com/nodejs/node/commit/016e35210c)] - **(SEMVER-MINOR)** **test**: test TLS client authentication (Sam Roberts) [#24733](https://github.com/nodejs/node/pull/24733) <add>* [[`e050a5756f`](https://github.com/nodejs/node/commit/e050a5756f)] - **test**: replace callback with arrows (Shubham Urkade) [#24866](https://github.com/nodejs/node/pull/24866) <add>* [[`22b6befa14`](https://github.com/nodejs/node/commit/22b6befa14)] - **test**: mark test-cli-syntax as flaky/unreliable (Rich Trott) [#24957](https://github.com/nodejs/node/pull/24957) <add>* [[`56fd127ef0`](https://github.com/nodejs/node/commit/56fd127ef0)] - **test**: do not lint macros files (again) (cclauss) [#24886](https://github.com/nodejs/node/pull/24886) <add>* [[`bc71e9e0d6`](https://github.com/nodejs/node/commit/bc71e9e0d6)] - **test**: prepare test/pseudo-tty/testcfg.py Python 3 (cclauss) [#24887](https://github.com/nodejs/node/pull/24887) <add>* [[`f41443cc5c`](https://github.com/nodejs/node/commit/f41443cc5c)] - **test**: move test-cli-syntax to sequential (Rich Trott) [#24907](https://github.com/nodejs/node/pull/24907) <add>* [[`592bad1b0b`](https://github.com/nodejs/node/commit/592bad1b0b)] - **test**: move http2 test to parallel (Rich Trott) [#24877](https://github.com/nodejs/node/pull/24877) <add>* [[`91ce957037`](https://github.com/nodejs/node/commit/91ce957037)] - **test**: make http2 timeout test robust (Rich Trott) [#24877](https://github.com/nodejs/node/pull/24877) <add>* [[`3d87688fba`](https://github.com/nodejs/node/commit/3d87688fba)] - **test**: fix wrong parameter (zhmushan) [#24844](https://github.com/nodejs/node/pull/24844) <add>* [[`6db760c231`](https://github.com/nodejs/node/commit/6db760c231)] - **test**: improve test-net-socket-timeout (Rich Trott) [#24859](https://github.com/nodejs/node/pull/24859) <add>* [[`526ff1d1d2`](https://github.com/nodejs/node/commit/526ff1d1d2)] - **test**: prepare test/pseudo-tty/testcfg.py for Python 3 (cclauss) [#24791](https://github.com/nodejs/node/pull/24791) <add>* [[`a5c57861a9`](https://github.com/nodejs/node/commit/a5c57861a9)] - **test**: refactor test-fs-write-file-sync.js (cjihrig) [#24834](https://github.com/nodejs/node/pull/24834) <add>* [[`a5c8af7af4`](https://github.com/nodejs/node/commit/a5c8af7af4)] - **test**: prepare test/message/testcfg.py for Python 3 (cclauss) [#24793](https://github.com/nodejs/node/pull/24793) <add>* [[`390e050ae0`](https://github.com/nodejs/node/commit/390e050ae0)] - **(SEMVER-MINOR)** **tls**: support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts) [#24733](https://github.com/nodejs/node/pull/24733) <add>* [[`16a75beffc`](https://github.com/nodejs/node/commit/16a75beffc)] - **tools**: prepare ./tools/compress\_json.py for Python 3 (cclauss) [#24889](https://github.com/nodejs/node/pull/24889) <add>* [[`b60808a2da`](https://github.com/nodejs/node/commit/b60808a2da)] - **tools**: prepare tools/testp.py for Python 3 (cclauss) [#24890](https://github.com/nodejs/node/pull/24890) <add>* [[`1f61c89a7f`](https://github.com/nodejs/node/commit/1f61c89a7f)] - **tools**: prepare tools/icu/icutrim.py for Python 3 (cclauss) [#24888](https://github.com/nodejs/node/pull/24888) <add>* [[`e140d41789`](https://github.com/nodejs/node/commit/e140d41789)] - **tools**: capitalize sentences (Ruben Bridgewater) [#24808](https://github.com/nodejs/node/pull/24808) <add>* [[`ad6104dbac`](https://github.com/nodejs/node/commit/ad6104dbac)] - **tools**: update ESLint to 5.10.0 (cjihrig) [#24903](https://github.com/nodejs/node/pull/24903) <add>* [[`ac46e27714`](https://github.com/nodejs/node/commit/ac46e27714)] - **tools**: do not lint tools/inspector\_protocol or tools/markupsafe (cclauss) [#24882](https://github.com/nodejs/node/pull/24882) <add>* [[`c3dda00e48`](https://github.com/nodejs/node/commit/c3dda00e48)] - **tools**: prepare tools/js2c.py for Python 3 (cclauss) [#24798](https://github.com/nodejs/node/pull/24798) <add>* [[`7cac76cdd5`](https://github.com/nodejs/node/commit/7cac76cdd5)] - **tools**: prepare tools/specialize\_node\_d.py for Python 3 (cclauss) [#24797](https://github.com/nodejs/node/pull/24797) <add>* [[`15632c3867`](https://github.com/nodejs/node/commit/15632c3867)] - **tools**: prepare tools/test.py for Python 3 (cclauss) [#24799](https://github.com/nodejs/node/pull/24799) <add>* [[`022599c0e1`](https://github.com/nodejs/node/commit/022599c0e1)] - **tools**: prepare tools/genv8constants.py for Python 3 (cclauss) [#24801](https://github.com/nodejs/node/pull/24801) <add>* [[`e7b77ead74`](https://github.com/nodejs/node/commit/e7b77ead74)] - **url**: remove an eslint-disable comment (cjihrig) [#24995](https://github.com/nodejs/node/pull/24995) <add>* [[`59317470e3`](https://github.com/nodejs/node/commit/59317470e3)] - **util**: inspect all prototypes (Ruben Bridgewater) [#24974](https://github.com/nodejs/node/pull/24974) <add>* [[`a1f0da1d40`](https://github.com/nodejs/node/commit/a1f0da1d40)] - **util**: remove todo (Ruben Bridgewater) [#24982](https://github.com/nodejs/node/pull/24982) <add>* [[`117e99121c`](https://github.com/nodejs/node/commit/117e99121c)] - **(SEMVER-MINOR)** **util**: add inspection getter option (Ruben Bridgewater) [#24852](https://github.com/nodejs/node/pull/24852) <add>* [[`331f6044b9`](https://github.com/nodejs/node/commit/331f6044b9)] - **worker**: drain messages from internal message port (Yael Hermon) [#24932](https://github.com/nodejs/node/pull/24932) <ide> <ide> <a id="11.4.0"></a> <ide> ## 2018-12-07, Version 11.4.0 (Current), @BridgeAR <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <del> * Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <del> * Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <del> * OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <del> * OpenSSL: Timing vulnerability in ECDSA signature generation (CVE-2019-0735) <add>* Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <add>* Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <add>* Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <add>* OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <add>* OpenSSL: Timing vulnerability in ECDSA signature generation (CVE-2019-0735) <ide> <ide> ### Notable Changes <ide> <ide><path>doc/changelogs/CHANGELOG_V4.md <ide> This release also includes over 70 fixes to our docs and over 50 fixes to tests. <ide> ### Notable changes <ide> <ide> The SEMVER-MINOR changes include: <del> * **deps**: <del> - An update to v8 that introduces a new flag --perf_basic_prof_only_functions (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) <del> * **http**: <del> - A new feature in http(s) agent that catches errors on *keep alived* connections (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) <del> * **src**: <del> - Better support for Big-Endian systems (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) <del> * **tls**: <del> - A new feature that allows you to pass common SSL options to `tls.createSecurePair` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) <del> * **tools**: <del> - a new flag `--prof-process` which will execute the tick processor on the provided isolate files (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) <add> <add>* **deps**: <add> - An update to v8 that introduces a new flag --perf_basic_prof_only_functions (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) <add>* **http**: <add> - A new feature in http(s) agent that catches errors on *keep alived* connections (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) <add>* **src**: <add> - Better support for Big-Endian systems (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) <add>* **tls**: <add> - A new feature that allows you to pass common SSL options to `tls.createSecurePair` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) <add>* **tools**: <add> - a new flag `--prof-process` which will execute the tick processor on the provided isolate files (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) <ide> <ide> Notable semver patch changes include: <ide> <del> * **buld**: <del> - Support python path that includes spaces. This should be of particular interest to our Windows users who may have python living in `c:/Program Files` (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) <del> * **https**: <del> - A potential fix for [#3692](https://github.com/nodejs/node/issues/3692) HTTP/HTTPS client requests throwing EPROTO (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) <del> * **installer**: <del> - More readable profiling information from isolate tick logs (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) <del> * **npm**: <del> - upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) <del> * **process**: <del> - Add support for symbols in event emitters. Symbols didn't exist when it was written ¯\_(ツ)_/¯ (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) <del> * **querystring**: <del> - querystring.parse() is now 13-22% faster! (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) <del> * **streams**: <del> - performance improvements for moving small buffers that shows a 5% throughput gain. IoT projects have been seen to be as much as 10% faster with this change! (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) <del> * **tools**: <del> - eslint has been updated to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) <add>* **buld**: <add> - Support python path that includes spaces. This should be of particular interest to our Windows users who may have python living in `c:/Program Files` (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) <add>* **https**: <add> - A potential fix for [#3692](https://github.com/nodejs/node/issues/3692) HTTP/HTTPS client requests throwing EPROTO (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) <add>* **installer**: <add> - More readable profiling information from isolate tick logs (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) <add>* **npm**: <add> - upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) <add>* **process**: <add> - Add support for symbols in event emitters. Symbols didn't exist when it was written ¯\_(ツ)_/¯ (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) <add>* **querystring**: <add> - querystring.parse() is now 13-22% faster! (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) <add>* **streams**: <add> - performance improvements for moving small buffers that shows a 5% throughput gain. IoT projects have been seen to be as much as 10% faster with this change! (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) <add>* **tools**: <add> - eslint has been updated to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) <ide> <ide> ### Commits <ide> <ide> This list of changes is relative to the last io.js v3.x branch release, v3.3.0. <ide> * **timers**: Improved timer performance from porting the 0.12 implementation, plus minor fixes (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540), (Julien Gilli) [nodejs/node-v0.x-archive#8751](https://github.com/nodejs/node-v0.x-archive/pull/8751) [nodejs/node-v0.x-archive#8905](https://github.com/nodejs/node-v0.x-archive/pull/8905) <ide> * **util**: The `util.is*()` functions have been deprecated, beginning with deprecation warnings in the documentation for this release, users are encouraged to seek more robust alternatives in the npm registry, (Sakthipriyan Vairamani) [#2447](https://github.com/nodejs/node/pull/2447). <ide> * **v8**: Upgrade to version 4.5.103.30 from 4.4.63.30 (Ali Ijaz Sheikh) [#2632](https://github.com/nodejs/node/pull/2632). <del> - Implement new `TypedArray` prototype methods: `copyWithin()`, `every()`, `fill()`, `filter()`, `find()`, `findIndex()`, `forEach()`, `indexOf()`, `join()`, `lastIndexOf()`, `map()`, `reduce()`, `reduceRight()`, `reverse()`, `slice()`, `some()`, `sort()`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. <del> - Implement new `TypedArray.from()` and `TypedArray.of()` functions. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. <del> - Implement arrow functions, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions for further information. <del> - Full ChangeLog available at https://github.com/v8/v8-git-mirror/blob/4.5.103/ChangeLog <add> - Implement new `TypedArray` prototype methods: `copyWithin()`, `every()`, `fill()`, `filter()`, `find()`, `findIndex()`, `forEach()`, `indexOf()`, `join()`, `lastIndexOf()`, `map()`, `reduce()`, `reduceRight()`, `reverse()`, `slice()`, `some()`, `sort()`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. <add> - Implement new `TypedArray.from()` and `TypedArray.of()` functions. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. <add> - Implement arrow functions, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions for further information. <add> - Full ChangeLog available at https://github.com/v8/v8-git-mirror/blob/4.5.103/ChangeLog <ide> <ide> ### Known issues <ide> <ide><path>doc/changelogs/CHANGELOG_V5.md <ide> This is a security release. All Node.js users should consult the security releas <ide> <ide> ### Notable changes <ide> <del>**http**: <add>* **http**: <ide> * Enclose IPv6 Host header in square brackets. This will enable proper separation of the host address from any port reference (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) <ide> <del>**path**: <add>* **path**: <ide> * Make win32.isAbsolute more consistent (Brian White) [#6028](https://github.com/nodejs/node/pull/6028) <ide> <ide> ### Commits <ide> This is a security release. All Node.js users should consult the security releas <ide> * **contextify**: Fixed a memory consumption issue related to heavy use of `vm.createContext` and `vm.runInNewContext`. (Ali Ijaz Sheikh) <ide> https://github.com/nodejs/node/pull/5392 <ide> * **governance**: The following members have been added as collaborators: <del> - Andreas Madsen (@AndreasMadsen) <del> - Benjamin Gruenbaum (@benjamingr) <del> - Claudio Rodriguez (@claudiorodriguez) <del> - Glen Keane (@thekemkid) <del> - Jeremy Whitlock (@whitlockjc) <del> - Matt Loring (@matthewloring) <del> - Phillip Johnsen (@phillipj) <add> - Andreas Madsen (@AndreasMadsen) <add> - Benjamin Gruenbaum (@benjamingr) <add> - Claudio Rodriguez (@claudiorodriguez) <add> - Glen Keane (@thekemkid) <add> - Jeremy Whitlock (@whitlockjc) <add> - Matt Loring (@matthewloring) <add> - Phillip Johnsen (@phillipj) <ide> * **lib**: copy arguments object instead of leaking it (Nathan Woltman) <ide> https://github.com/nodejs/node/pull/4361 <ide> * **src**: allow both -i and -e flags to be used at the same time (Rich Trott) <ide><path>doc/changelogs/CHANGELOG_V6.md <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Denial of Service with keep-alive HTTP connections (CVE-2019-5739) <del> * Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <del> * OpenSSL: 0-byte record padding oracle (CVE-2019-1559) <add>* Node.js: Denial of Service with keep-alive HTTP connections (CVE-2019-5739) <add>* Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <add>* OpenSSL: 0-byte record padding oracle (CVE-2019-1559) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Debugger port 5858 listens on any interface by default (CVE-2018-12120) <del> * Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <del> * Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <del> * Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <del> * Node.js: HTTP request splitting (CVE-2018-12116) <del> * OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <del> * OpenSSL: Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) <add>* Node.js: Debugger port 5858 listens on any interface by default (CVE-2018-12120) <add>* Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <add>* Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <add>* Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <add>* Node.js: HTTP request splitting (CVE-2018-12116) <add>* OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <add>* OpenSSL: Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * CVE-2018-0732 (OpenSSL) <del> * CVE-2018-12115 (Node.js) <add>* CVE-2018-0732 (OpenSSL) <add>* CVE-2018-12115 (Node.js) <ide> <ide> ### Notable Changes <ide> <ide> This is a special LTS to fix a number of regressions that were found on the 6.10 <ide> <ide> This includes: <ide> <del> * a fix for memory leak in the crypto module that was introduced in 6.10.1 <del> * a fix for a regression introduced to the windows repl in 6.10.0 <del> * a backported fix for V8 to stop a segfault that could occur when using spread syntax <add>* a fix for memory leak in the crypto module that was introduced in 6.10.1 <add>* a fix for a regression introduced to the windows repl in 6.10.0 <add>* a backported fix for V8 to stop a segfault that could occur when using spread syntax <ide> <ide> It also includes an upgrade to zlib 1.2.11 to fix a [number of low severity CVEs](http://seclists.org/oss-sec/2016/q4/602) <ide> that were present in zlib 1.2.8. <ide><path>doc/changelogs/CHANGELOG_V8.md <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <del> * OpenSSL: 0-byte record padding oracle (CVE-2019-1559) <add>* Node.js: Slowloris HTTP Denial of Service with keep-alive (CVE-2019-5737) <add>* OpenSSL: 0-byte record padding oracle (CVE-2019-1559) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <del> * Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <del> * Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <del> * Node.js: HTTP request splitting (CVE-2018-12116) <del> * OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <del> * OpenSSL: Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) <add>* Node.js: Denial of Service with large HTTP headers (CVE-2018-12121) <add>* Node.js: Slowloris HTTP Denial of Service (CVE-2018-12122 / Node.js) <add>* Node.js: Hostname spoofing in URL parser for javascript protocol (CVE-2018-12123) <add>* Node.js: HTTP request splitting (CVE-2018-12116) <add>* OpenSSL: Timing vulnerability in DSA signature generation (CVE-2018-0734) <add>* OpenSSL: Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) <ide> <ide> ### Notable Changes <ide> <ide> for details on patched vulnerabilities. <ide> <ide> Fixes for the following CVEs are included in this release: <ide> <del> * CVE-2018-0732 (OpenSSL) <del> * CVE-2018-12115 (Node.js) <add>* CVE-2018-0732 (OpenSSL) <add>* CVE-2018-12115 (Node.js) <ide> <ide> ### Notable Changes <ide> <ide><path>doc/guides/contributing/pull-requests.md <ide> $ git checkout -b my-branch -t upstream/master <ide> <ide> The vast majority of Pull Requests opened against the `nodejs/node` <ide> repository includes changes to one or more of the following: <del> - the C/C++ code contained in the `src` directory <del> - the JavaScript code contained in the `lib` directory <del> - the documentation in `doc/api` <del> - tests within the `test` directory. <add>- the C/C++ code contained in the `src` directory <add>- the JavaScript code contained in the `lib` directory <add>- the documentation in `doc/api` <add>- tests within the `test` directory. <ide> <ide> If you are modifying code, please be sure to run `make lint` from time to <ide> time to ensure that the changes follow the Node.js code style guide.
13
Text
Text
remove cloudbees and pull request logo
2845e19596cbe6813c898608fd6152364e66ef3d
<ide><path>README.md <ide> Learn more about RxJava on the <a href="https://github.com/ReactiveX/RxJava/wiki <ide> <ide> ## Master Build Status <ide> <del>CloudBees: <a href='https://netflixoss.ci.cloudbees.com/job/RxJava-master/'><img src='https://netflixoss.ci.cloudbees.com/job/RxJava-master/badge/icon'></a> <del> <del>Travis: <a href='https://travis-ci.org/ReactiveX/RxJava/builds'><img src='https://travis-ci.org/ReactiveX/RxJava.svg?branch=1.x'></a> <del> <del>## Pull Request Build Status <del> <del><a href='https://netflixoss.ci.cloudbees.com/job/RxJava-pull-requests/'><img src='https://netflixoss.ci.cloudbees.com/job/RxJava-pull-requests/badge/icon'></a> <add><a href='https://travis-ci.org/ReactiveX/RxJava/builds'><img src='https://travis-ci.org/ReactiveX/RxJava.svg?branch=1.x'></a> <ide> <ide> ## Communication <ide>
1
Python
Python
fix wrong explanation
d5c0e4b0855291fb507eb79e969c6a7c9b89856a
<ide><path>im2txt/im2txt/ops/inputs.py <ide> def batch_with_dynamic_pad(images_and_captions, <ide> Example: <ide> Actual captions in the batch ('-' denotes padded character): <ide> [ <del> [ 1 2 5 4 5 ], <add> [ 1 2 3 4 5 ], <ide> [ 1 2 3 4 - ], <ide> [ 1 2 3 - - ], <ide> ]
1
Javascript
Javascript
improve error logging when rebuild fails
d23e622426662178b6df2488bca89c53e4b0d5c1
<ide><path>packager/react-packager/src/DependencyResolver/DependencyGraph/index.js <ide> class DependencyGraph { <ide> // we are in an error state and we should decide to do a full rebuild. <ide> this._loading = this._loading.finally(() => { <ide> if (this._hasteMapError) { <add> console.warn( <add> 'Rebuilding haste map to recover from error:\n' + <add> this._hasteMapError.stack <add> ); <ide> this._hasteMapError = null; <add> <ide> // Rebuild the entire map if last change resulted in an error. <del> console.warn('Rebuilding haste map to recover from error'); <ide> this._loading = this._hasteMap.build(); <ide> } else { <ide> this._loading = this._hasteMap.processFileChange(type, absPath);
1
Ruby
Ruby
add safety margin to output truncation size
1f8b6cb57677d96228627baf28ce18a394df4c1d
<ide><path>Library/Homebrew/cmd/test-bot.rb <ide> <ide> module Homebrew <ide> BYTES_IN_1_MEGABYTE = 1024*1024 <add> MAX_STEP_OUTPUT_SIZE = BYTES_IN_1_MEGABYTE - (200*1024) # margin of safety <add> <ide> HOMEBREW_TAP_REGEX = %r{^([\w-]+)/homebrew-([\w-]+)$} <ide> <ide> def ruby_has_encoding? <ide> def sanitize_output_for_xml(output) <ide> output = output.delete("\000\a\b\e\f\x2\x1f") <ide> end <ide> <del> # Truncate to 1MB <del> if output.bytesize > BYTES_IN_1_MEGABYTE <add> # Truncate to 1MB to avoid hitting CI limits <add> if output.bytesize > MAX_STEP_OUTPUT_SIZE <ide> if ruby_has_encoding? <ide> binary_output = output.force_encoding("BINARY") <del> output = binary_output.slice(-BYTES_IN_1_MEGABYTE, BYTES_IN_1_MEGABYTE) <add> output = binary_output.slice(-MAX_STEP_OUTPUT_SIZE, MAX_STEP_OUTPUT_SIZE) <ide> fix_encoding!(output) <ide> else <del> output = output.slice(-BYTES_IN_1_MEGABYTE, BYTES_IN_1_MEGABYTE) <add> output = output.slice(-MAX_STEP_OUTPUT_SIZE, MAX_STEP_OUTPUT_SIZE) <ide> end <ide> output = "truncated output to 1MB:\n" + output <ide> end
1
Javascript
Javascript
allow suspending outside a suspense boundary
796fff5483925f90db5fe705af6d8b06fce661a5
<ide><path>packages/react-reconciler/src/ReactFiberThrow.new.js <ide> import { <ide> } from './ReactFiberSuspenseContext.new'; <ide> import { <ide> renderDidError, <add> renderDidSuspendDelayIfPossible, <ide> onUncaughtError, <ide> markLegacyErrorBoundaryAsFailed, <ide> isAlreadyFailedLegacyErrorBoundary, <ide> import { <ide> includesSomeLane, <ide> mergeLanes, <ide> pickArbitraryLane, <add> includesOnlyTransitions, <ide> } from './ReactFiberLane.new'; <ide> import { <ide> getIsHydrating, <ide> function createClassErrorUpdate( <ide> return update; <ide> } <ide> <del>function attachWakeableListeners( <del> suspenseBoundary: Fiber, <del> root: FiberRoot, <del> wakeable: Wakeable, <del> lanes: Lanes, <del>) { <add>function attachPingListener(root: FiberRoot, wakeable: Wakeable, lanes: Lanes) { <ide> // Attach a ping listener <ide> // <ide> // The data might resolve before we have a chance to commit the fallback. Or, <ide> function attachWakeableListeners( <ide> // <ide> // We only need to do this in concurrent mode. Legacy Suspense always <ide> // commits fallbacks synchronously, so there are no pings. <del> if (suspenseBoundary.mode & ConcurrentMode) { <del> let pingCache = root.pingCache; <del> let threadIDs; <del> if (pingCache === null) { <del> pingCache = root.pingCache = new PossiblyWeakMap(); <add> let pingCache = root.pingCache; <add> let threadIDs; <add> if (pingCache === null) { <add> pingCache = root.pingCache = new PossiblyWeakMap(); <add> threadIDs = new Set(); <add> pingCache.set(wakeable, threadIDs); <add> } else { <add> threadIDs = pingCache.get(wakeable); <add> if (threadIDs === undefined) { <ide> threadIDs = new Set(); <ide> pingCache.set(wakeable, threadIDs); <del> } else { <del> threadIDs = pingCache.get(wakeable); <del> if (threadIDs === undefined) { <del> threadIDs = new Set(); <del> pingCache.set(wakeable, threadIDs); <del> } <ide> } <del> if (!threadIDs.has(lanes)) { <del> // Memoize using the thread ID to prevent redundant listeners. <del> threadIDs.add(lanes); <del> const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); <del> if (enableUpdaterTracking) { <del> if (isDevToolsPresent) { <del> // If we have pending work still, restore the original updaters <del> restorePendingUpdaters(root, lanes); <del> } <add> } <add> if (!threadIDs.has(lanes)) { <add> // Memoize using the thread ID to prevent redundant listeners. <add> threadIDs.add(lanes); <add> const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); <add> if (enableUpdaterTracking) { <add> if (isDevToolsPresent) { <add> // If we have pending work still, restore the original updaters <add> restorePendingUpdaters(root, lanes); <ide> } <del> wakeable.then(ping, ping); <ide> } <add> wakeable.then(ping, ping); <ide> } <add>} <ide> <add>function attachRetryListener( <add> suspenseBoundary: Fiber, <add> root: FiberRoot, <add> wakeable: Wakeable, <add> lanes: Lanes, <add>) { <ide> // Retry listener <ide> // <ide> // If the fallback does commit, we need to attach a different type of <ide> function throwException( <ide> root, <ide> rootRenderLanes, <ide> ); <del> attachWakeableListeners( <del> suspenseBoundary, <del> root, <del> wakeable, <del> rootRenderLanes, <del> ); <add> // We only attach ping listeners in concurrent mode. Legacy Suspense always <add> // commits fallbacks synchronously, so there are no pings. <add> if (suspenseBoundary.mode & ConcurrentMode) { <add> attachPingListener(root, wakeable, rootRenderLanes); <add> } <add> attachRetryListener(suspenseBoundary, root, wakeable, rootRenderLanes); <ide> return; <ide> } else { <del> // No boundary was found. Fallthrough to error mode. <add> // No boundary was found. If we're inside startTransition, this is OK. <add> // We can suspend and wait for more data to arrive. <add> <add> if (includesOnlyTransitions(rootRenderLanes)) { <add> // This is a transition. Suspend. Since we're not activating a Suspense <add> // boundary, this will unwind all the way to the root without performing <add> // a second pass to render a fallback. (This is arguably how refresh <add> // transitions should work, too, since we're not going to commit the <add> // fallbacks anyway.) <add> attachPingListener(root, wakeable, rootRenderLanes); <add> renderDidSuspendDelayIfPossible(); <add> return; <add> } <add> <add> // We're not in a transition. We treat this case like an error because <add> // discrete renders are expected to finish synchronously to maintain <add> // consistency with external state. <add> // TODO: This will error during non-transition concurrent renders, too. <add> // But maybe it shouldn't? <add> <ide> // TODO: We should never call getComponentNameFromFiber in production. <ide> // Log a warning or something to prevent us from accidentally bundling it. <del> value = new Error( <add> const uncaughtSuspenseError = new Error( <ide> (getComponentNameFromFiber(sourceFiber) || 'A React component') + <ide> ' suspended while rendering, but no fallback UI was specified.\n' + <ide> '\n' + <ide> 'Add a <Suspense fallback=...> component higher in the tree to ' + <ide> 'provide a loading indicator or placeholder to display.', <ide> ); <add> <add> // If we're outside a transition, fall through to the regular error path. <add> // The error will be caught by the nearest suspense boundary. <add> value = uncaughtSuspenseError; <ide> } <ide> } else { <ide> // This is a regular error, not a Suspense wakeable. <ide><path>packages/react-reconciler/src/ReactFiberThrow.old.js <ide> import { <ide> } from './ReactFiberSuspenseContext.old'; <ide> import { <ide> renderDidError, <add> renderDidSuspendDelayIfPossible, <ide> onUncaughtError, <ide> markLegacyErrorBoundaryAsFailed, <ide> isAlreadyFailedLegacyErrorBoundary, <ide> import { <ide> includesSomeLane, <ide> mergeLanes, <ide> pickArbitraryLane, <add> includesOnlyTransitions, <ide> } from './ReactFiberLane.old'; <ide> import { <ide> getIsHydrating, <ide> function createClassErrorUpdate( <ide> return update; <ide> } <ide> <del>function attachWakeableListeners( <del> suspenseBoundary: Fiber, <del> root: FiberRoot, <del> wakeable: Wakeable, <del> lanes: Lanes, <del>) { <add>function attachPingListener(root: FiberRoot, wakeable: Wakeable, lanes: Lanes) { <ide> // Attach a ping listener <ide> // <ide> // The data might resolve before we have a chance to commit the fallback. Or, <ide> function attachWakeableListeners( <ide> // <ide> // We only need to do this in concurrent mode. Legacy Suspense always <ide> // commits fallbacks synchronously, so there are no pings. <del> if (suspenseBoundary.mode & ConcurrentMode) { <del> let pingCache = root.pingCache; <del> let threadIDs; <del> if (pingCache === null) { <del> pingCache = root.pingCache = new PossiblyWeakMap(); <add> let pingCache = root.pingCache; <add> let threadIDs; <add> if (pingCache === null) { <add> pingCache = root.pingCache = new PossiblyWeakMap(); <add> threadIDs = new Set(); <add> pingCache.set(wakeable, threadIDs); <add> } else { <add> threadIDs = pingCache.get(wakeable); <add> if (threadIDs === undefined) { <ide> threadIDs = new Set(); <ide> pingCache.set(wakeable, threadIDs); <del> } else { <del> threadIDs = pingCache.get(wakeable); <del> if (threadIDs === undefined) { <del> threadIDs = new Set(); <del> pingCache.set(wakeable, threadIDs); <del> } <ide> } <del> if (!threadIDs.has(lanes)) { <del> // Memoize using the thread ID to prevent redundant listeners. <del> threadIDs.add(lanes); <del> const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); <del> if (enableUpdaterTracking) { <del> if (isDevToolsPresent) { <del> // If we have pending work still, restore the original updaters <del> restorePendingUpdaters(root, lanes); <del> } <add> } <add> if (!threadIDs.has(lanes)) { <add> // Memoize using the thread ID to prevent redundant listeners. <add> threadIDs.add(lanes); <add> const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); <add> if (enableUpdaterTracking) { <add> if (isDevToolsPresent) { <add> // If we have pending work still, restore the original updaters <add> restorePendingUpdaters(root, lanes); <ide> } <del> wakeable.then(ping, ping); <ide> } <add> wakeable.then(ping, ping); <ide> } <add>} <ide> <add>function attachRetryListener( <add> suspenseBoundary: Fiber, <add> root: FiberRoot, <add> wakeable: Wakeable, <add> lanes: Lanes, <add>) { <ide> // Retry listener <ide> // <ide> // If the fallback does commit, we need to attach a different type of <ide> function throwException( <ide> root, <ide> rootRenderLanes, <ide> ); <del> attachWakeableListeners( <del> suspenseBoundary, <del> root, <del> wakeable, <del> rootRenderLanes, <del> ); <add> // We only attach ping listeners in concurrent mode. Legacy Suspense always <add> // commits fallbacks synchronously, so there are no pings. <add> if (suspenseBoundary.mode & ConcurrentMode) { <add> attachPingListener(root, wakeable, rootRenderLanes); <add> } <add> attachRetryListener(suspenseBoundary, root, wakeable, rootRenderLanes); <ide> return; <ide> } else { <del> // No boundary was found. Fallthrough to error mode. <add> // No boundary was found. If we're inside startTransition, this is OK. <add> // We can suspend and wait for more data to arrive. <add> <add> if (includesOnlyTransitions(rootRenderLanes)) { <add> // This is a transition. Suspend. Since we're not activating a Suspense <add> // boundary, this will unwind all the way to the root without performing <add> // a second pass to render a fallback. (This is arguably how refresh <add> // transitions should work, too, since we're not going to commit the <add> // fallbacks anyway.) <add> attachPingListener(root, wakeable, rootRenderLanes); <add> renderDidSuspendDelayIfPossible(); <add> return; <add> } <add> <add> // We're not in a transition. We treat this case like an error because <add> // discrete renders are expected to finish synchronously to maintain <add> // consistency with external state. <add> // TODO: This will error during non-transition concurrent renders, too. <add> // But maybe it shouldn't? <add> <ide> // TODO: We should never call getComponentNameFromFiber in production. <ide> // Log a warning or something to prevent us from accidentally bundling it. <del> value = new Error( <add> const uncaughtSuspenseError = new Error( <ide> (getComponentNameFromFiber(sourceFiber) || 'A React component') + <ide> ' suspended while rendering, but no fallback UI was specified.\n' + <ide> '\n' + <ide> 'Add a <Suspense fallback=...> component higher in the tree to ' + <ide> 'provide a loading indicator or placeholder to display.', <ide> ); <add> <add> // If we're outside a transition, fall through to the regular error path. <add> // The error will be caught by the nearest suspense boundary. <add> value = uncaughtSuspenseError; <ide> } <ide> } else { <ide> // This is a regular error, not a Suspense wakeable. <ide><path>packages/react-reconciler/src/ReactFiberUnwindWork.new.js <ide> function unwindWork(workInProgress: Fiber, renderLanes: Lanes) { <ide> popTopLevelLegacyContextObject(workInProgress); <ide> resetMutableSourceWorkInProgressVersions(); <ide> const flags = workInProgress.flags; <del> <del> if ((flags & DidCapture) !== NoFlags) { <del> throw new Error( <del> 'The root failed to unmount after an error. This is likely a bug in ' + <del> 'React. Please file an issue.', <del> ); <add> if ( <add> (flags & ShouldCapture) !== NoFlags && <add> (flags & DidCapture) === NoFlags <add> ) { <add> // There was an error during render that wasn't captured by a suspense <add> // boundary. Do a second pass on the root to unmount the children. <add> workInProgress.flags = (flags & ~ShouldCapture) | DidCapture; <add> return workInProgress; <ide> } <del> <del> workInProgress.flags = (flags & ~ShouldCapture) | DidCapture; <del> return workInProgress; <add> // We unwound to the root without completing it. Exit. <add> return null; <ide> } <ide> case HostComponent: { <ide> // TODO: popHydrationState <ide><path>packages/react-reconciler/src/ReactFiberUnwindWork.old.js <ide> function unwindWork(workInProgress: Fiber, renderLanes: Lanes) { <ide> popTopLevelLegacyContextObject(workInProgress); <ide> resetMutableSourceWorkInProgressVersions(); <ide> const flags = workInProgress.flags; <del> <del> if ((flags & DidCapture) !== NoFlags) { <del> throw new Error( <del> 'The root failed to unmount after an error. This is likely a bug in ' + <del> 'React. Please file an issue.', <del> ); <add> if ( <add> (flags & ShouldCapture) !== NoFlags && <add> (flags & DidCapture) === NoFlags <add> ) { <add> // There was an error during render that wasn't captured by a suspense <add> // boundary. Do a second pass on the root to unmount the children. <add> workInProgress.flags = (flags & ~ShouldCapture) | DidCapture; <add> return workInProgress; <ide> } <del> <del> workInProgress.flags = (flags & ~ShouldCapture) | DidCapture; <del> return workInProgress; <add> // We unwound to the root without completing it. Exit. <add> return null; <ide> } <ide> case HostComponent: { <ide> // TODO: popHydrationState <ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js <ide> const RenderContext = /* */ 0b0010; <ide> const CommitContext = /* */ 0b0100; <ide> export const RetryAfterError = /* */ 0b1000; <ide> <del>type RootExitStatus = 0 | 1 | 2 | 3 | 4 | 5; <del>const RootIncomplete = 0; <add>type RootExitStatus = 0 | 1 | 2 | 3 | 4 | 5 | 6; <add>const RootInProgress = 0; <ide> const RootFatalErrored = 1; <ide> const RootErrored = 2; <ide> const RootSuspended = 3; <ide> const RootSuspendedWithDelay = 4; <ide> const RootCompleted = 5; <add>const RootDidNotComplete = 6; <ide> <ide> // Describes where we are in the React execution stack <ide> let executionContext: ExecutionContext = NoContext; <ide> export let subtreeRenderLanes: Lanes = NoLanes; <ide> const subtreeRenderLanesCursor: StackCursor<Lanes> = createCursor(NoLanes); <ide> <ide> // Whether to root completed, errored, suspended, etc. <del>let workInProgressRootExitStatus: RootExitStatus = RootIncomplete; <add>let workInProgressRootExitStatus: RootExitStatus = RootInProgress; <ide> // A fatal error, if one is thrown <ide> let workInProgressRootFatalError: mixed = null; <ide> // "Included" lanes refer to lanes that were worked on during this render. It's <ide> function performConcurrentWorkOnRoot(root, didTimeout) { <ide> let exitStatus = shouldTimeSlice <ide> ? renderRootConcurrent(root, lanes) <ide> : renderRootSync(root, lanes); <del> if (exitStatus !== RootIncomplete) { <add> if (exitStatus !== RootInProgress) { <ide> if (exitStatus === RootErrored) { <ide> // If something threw an error, try rendering one more time. We'll <ide> // render synchronously to block concurrent data mutations, and we'll <ide> function performConcurrentWorkOnRoot(root, didTimeout) { <ide> throw fatalError; <ide> } <ide> <del> // Check if this render may have yielded to a concurrent event, and if so, <del> // confirm that any newly rendered stores are consistent. <del> // TODO: It's possible that even a concurrent render may never have yielded <del> // to the main thread, if it was fast enough, or if it expired. We could <del> // skip the consistency check in that case, too. <del> const renderWasConcurrent = !includesBlockingLane(root, lanes); <del> const finishedWork: Fiber = (root.current.alternate: any); <del> if ( <del> renderWasConcurrent && <del> !isRenderConsistentWithExternalStores(finishedWork) <del> ) { <del> // A store was mutated in an interleaved event. Render again, <del> // synchronously, to block further mutations. <del> exitStatus = renderRootSync(root, lanes); <del> <del> // We need to check again if something threw <del> if (exitStatus === RootErrored) { <del> const errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); <del> if (errorRetryLanes !== NoLanes) { <del> lanes = errorRetryLanes; <del> exitStatus = recoverFromConcurrentError(root, errorRetryLanes); <del> // We assume the tree is now consistent because we didn't yield to any <del> // concurrent events. <add> if (exitStatus === RootDidNotComplete) { <add> // The render unwound without completing the tree. This happens in special <add> // cases where need to exit the current render without producing a <add> // consistent tree or committing. <add> // <add> // This should only happen during a concurrent render, not a discrete or <add> // synchronous update. We should have already checked for this when we <add> // unwound the stack. <add> markRootSuspended(root, lanes); <add> } else { <add> // The render completed. <add> <add> // Check if this render may have yielded to a concurrent event, and if so, <add> // confirm that any newly rendered stores are consistent. <add> // TODO: It's possible that even a concurrent render may never have yielded <add> // to the main thread, if it was fast enough, or if it expired. We could <add> // skip the consistency check in that case, too. <add> const renderWasConcurrent = !includesBlockingLane(root, lanes); <add> const finishedWork: Fiber = (root.current.alternate: any); <add> if ( <add> renderWasConcurrent && <add> !isRenderConsistentWithExternalStores(finishedWork) <add> ) { <add> // A store was mutated in an interleaved event. Render again, <add> // synchronously, to block further mutations. <add> exitStatus = renderRootSync(root, lanes); <add> <add> // We need to check again if something threw <add> if (exitStatus === RootErrored) { <add> const errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); <add> if (errorRetryLanes !== NoLanes) { <add> lanes = errorRetryLanes; <add> exitStatus = recoverFromConcurrentError(root, errorRetryLanes); <add> // We assume the tree is now consistent because we didn't yield to any <add> // concurrent events. <add> } <add> } <add> if (exitStatus === RootFatalErrored) { <add> const fatalError = workInProgressRootFatalError; <add> prepareFreshStack(root, NoLanes); <add> markRootSuspended(root, lanes); <add> ensureRootIsScheduled(root, now()); <add> throw fatalError; <ide> } <ide> } <del> if (exitStatus === RootFatalErrored) { <del> const fatalError = workInProgressRootFatalError; <del> prepareFreshStack(root, NoLanes); <del> markRootSuspended(root, lanes); <del> ensureRootIsScheduled(root, now()); <del> throw fatalError; <del> } <del> } <ide> <del> // We now have a consistent tree. The next step is either to commit it, <del> // or, if something suspended, wait to commit it after a timeout. <del> root.finishedWork = finishedWork; <del> root.finishedLanes = lanes; <del> finishConcurrentRender(root, exitStatus, lanes); <add> // We now have a consistent tree. The next step is either to commit it, <add> // or, if something suspended, wait to commit it after a timeout. <add> root.finishedWork = finishedWork; <add> root.finishedLanes = lanes; <add> finishConcurrentRender(root, exitStatus, lanes); <add> } <ide> } <ide> <ide> ensureRootIsScheduled(root, now()); <ide> export function queueRecoverableErrors(errors: Array<mixed>) { <ide> <ide> function finishConcurrentRender(root, exitStatus, lanes) { <ide> switch (exitStatus) { <del> case RootIncomplete: <add> case RootInProgress: <ide> case RootFatalErrored: { <ide> throw new Error('Root did not complete. This is a bug in React.'); <ide> } <ide> function performSyncWorkOnRoot(root) { <ide> throw fatalError; <ide> } <ide> <add> if (exitStatus === RootDidNotComplete) { <add> throw new Error('Root did not complete. This is a bug in React.'); <add> } <add> <ide> // We now have a consistent tree. Because this is a sync render, we <ide> // will commit it even if something suspended. <ide> const finishedWork: Fiber = (root.current.alternate: any); <ide> function prepareFreshStack(root: FiberRoot, lanes: Lanes) { <ide> workInProgressRoot = root; <ide> workInProgress = createWorkInProgress(root.current, null); <ide> workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; <del> workInProgressRootExitStatus = RootIncomplete; <add> workInProgressRootExitStatus = RootInProgress; <ide> workInProgressRootFatalError = null; <ide> workInProgressRootSkippedLanes = NoLanes; <ide> workInProgressRootInterleavedUpdatedLanes = NoLanes; <ide> export function markSkippedUpdateLanes(lane: Lane | Lanes): void { <ide> } <ide> <ide> export function renderDidSuspend(): void { <del> if (workInProgressRootExitStatus === RootIncomplete) { <add> if (workInProgressRootExitStatus === RootInProgress) { <ide> workInProgressRootExitStatus = RootSuspended; <ide> } <ide> } <ide> <ide> export function renderDidSuspendDelayIfPossible(): void { <ide> if ( <del> workInProgressRootExitStatus === RootIncomplete || <add> workInProgressRootExitStatus === RootInProgress || <ide> workInProgressRootExitStatus === RootSuspended || <ide> workInProgressRootExitStatus === RootErrored <ide> ) { <ide> export function renderDidError(error: mixed) { <ide> export function renderHasNotSuspendedYet(): boolean { <ide> // If something errored or completed, we can't really be sure, <ide> // so those are false. <del> return workInProgressRootExitStatus === RootIncomplete; <add> return workInProgressRootExitStatus === RootInProgress; <ide> } <ide> <ide> function renderRootSync(root: FiberRoot, lanes: Lanes) { <ide> function renderRootConcurrent(root: FiberRoot, lanes: Lanes) { <ide> if (enableSchedulingProfiler) { <ide> markRenderYielded(); <ide> } <del> return RootIncomplete; <add> return RootInProgress; <ide> } else { <ide> // Completed the tree. <ide> if (enableSchedulingProfiler) { <ide> function completeUnitOfWork(unitOfWork: Fiber): void { <ide> returnFiber.flags |= Incomplete; <ide> returnFiber.subtreeFlags = NoFlags; <ide> returnFiber.deletions = null; <add> } else { <add> // We've unwound all the way to the root. <add> workInProgressRootExitStatus = RootDidNotComplete; <add> workInProgress = null; <add> return; <ide> } <ide> } <ide> <ide> function completeUnitOfWork(unitOfWork: Fiber): void { <ide> } while (completedWork !== null); <ide> <ide> // We've reached the root. <del> if (workInProgressRootExitStatus === RootIncomplete) { <add> if (workInProgressRootExitStatus === RootInProgress) { <ide> workInProgressRootExitStatus = RootCompleted; <ide> } <ide> } <ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.old.js <ide> const RenderContext = /* */ 0b0010; <ide> const CommitContext = /* */ 0b0100; <ide> export const RetryAfterError = /* */ 0b1000; <ide> <del>type RootExitStatus = 0 | 1 | 2 | 3 | 4 | 5; <del>const RootIncomplete = 0; <add>type RootExitStatus = 0 | 1 | 2 | 3 | 4 | 5 | 6; <add>const RootInProgress = 0; <ide> const RootFatalErrored = 1; <ide> const RootErrored = 2; <ide> const RootSuspended = 3; <ide> const RootSuspendedWithDelay = 4; <ide> const RootCompleted = 5; <add>const RootDidNotComplete = 6; <ide> <ide> // Describes where we are in the React execution stack <ide> let executionContext: ExecutionContext = NoContext; <ide> export let subtreeRenderLanes: Lanes = NoLanes; <ide> const subtreeRenderLanesCursor: StackCursor<Lanes> = createCursor(NoLanes); <ide> <ide> // Whether to root completed, errored, suspended, etc. <del>let workInProgressRootExitStatus: RootExitStatus = RootIncomplete; <add>let workInProgressRootExitStatus: RootExitStatus = RootInProgress; <ide> // A fatal error, if one is thrown <ide> let workInProgressRootFatalError: mixed = null; <ide> // "Included" lanes refer to lanes that were worked on during this render. It's <ide> function performConcurrentWorkOnRoot(root, didTimeout) { <ide> let exitStatus = shouldTimeSlice <ide> ? renderRootConcurrent(root, lanes) <ide> : renderRootSync(root, lanes); <del> if (exitStatus !== RootIncomplete) { <add> if (exitStatus !== RootInProgress) { <ide> if (exitStatus === RootErrored) { <ide> // If something threw an error, try rendering one more time. We'll <ide> // render synchronously to block concurrent data mutations, and we'll <ide> function performConcurrentWorkOnRoot(root, didTimeout) { <ide> throw fatalError; <ide> } <ide> <del> // Check if this render may have yielded to a concurrent event, and if so, <del> // confirm that any newly rendered stores are consistent. <del> // TODO: It's possible that even a concurrent render may never have yielded <del> // to the main thread, if it was fast enough, or if it expired. We could <del> // skip the consistency check in that case, too. <del> const renderWasConcurrent = !includesBlockingLane(root, lanes); <del> const finishedWork: Fiber = (root.current.alternate: any); <del> if ( <del> renderWasConcurrent && <del> !isRenderConsistentWithExternalStores(finishedWork) <del> ) { <del> // A store was mutated in an interleaved event. Render again, <del> // synchronously, to block further mutations. <del> exitStatus = renderRootSync(root, lanes); <del> <del> // We need to check again if something threw <del> if (exitStatus === RootErrored) { <del> const errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); <del> if (errorRetryLanes !== NoLanes) { <del> lanes = errorRetryLanes; <del> exitStatus = recoverFromConcurrentError(root, errorRetryLanes); <del> // We assume the tree is now consistent because we didn't yield to any <del> // concurrent events. <add> if (exitStatus === RootDidNotComplete) { <add> // The render unwound without completing the tree. This happens in special <add> // cases where need to exit the current render without producing a <add> // consistent tree or committing. <add> // <add> // This should only happen during a concurrent render, not a discrete or <add> // synchronous update. We should have already checked for this when we <add> // unwound the stack. <add> markRootSuspended(root, lanes); <add> } else { <add> // The render completed. <add> <add> // Check if this render may have yielded to a concurrent event, and if so, <add> // confirm that any newly rendered stores are consistent. <add> // TODO: It's possible that even a concurrent render may never have yielded <add> // to the main thread, if it was fast enough, or if it expired. We could <add> // skip the consistency check in that case, too. <add> const renderWasConcurrent = !includesBlockingLane(root, lanes); <add> const finishedWork: Fiber = (root.current.alternate: any); <add> if ( <add> renderWasConcurrent && <add> !isRenderConsistentWithExternalStores(finishedWork) <add> ) { <add> // A store was mutated in an interleaved event. Render again, <add> // synchronously, to block further mutations. <add> exitStatus = renderRootSync(root, lanes); <add> <add> // We need to check again if something threw <add> if (exitStatus === RootErrored) { <add> const errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); <add> if (errorRetryLanes !== NoLanes) { <add> lanes = errorRetryLanes; <add> exitStatus = recoverFromConcurrentError(root, errorRetryLanes); <add> // We assume the tree is now consistent because we didn't yield to any <add> // concurrent events. <add> } <add> } <add> if (exitStatus === RootFatalErrored) { <add> const fatalError = workInProgressRootFatalError; <add> prepareFreshStack(root, NoLanes); <add> markRootSuspended(root, lanes); <add> ensureRootIsScheduled(root, now()); <add> throw fatalError; <ide> } <ide> } <del> if (exitStatus === RootFatalErrored) { <del> const fatalError = workInProgressRootFatalError; <del> prepareFreshStack(root, NoLanes); <del> markRootSuspended(root, lanes); <del> ensureRootIsScheduled(root, now()); <del> throw fatalError; <del> } <del> } <ide> <del> // We now have a consistent tree. The next step is either to commit it, <del> // or, if something suspended, wait to commit it after a timeout. <del> root.finishedWork = finishedWork; <del> root.finishedLanes = lanes; <del> finishConcurrentRender(root, exitStatus, lanes); <add> // We now have a consistent tree. The next step is either to commit it, <add> // or, if something suspended, wait to commit it after a timeout. <add> root.finishedWork = finishedWork; <add> root.finishedLanes = lanes; <add> finishConcurrentRender(root, exitStatus, lanes); <add> } <ide> } <ide> <ide> ensureRootIsScheduled(root, now()); <ide> export function queueRecoverableErrors(errors: Array<mixed>) { <ide> <ide> function finishConcurrentRender(root, exitStatus, lanes) { <ide> switch (exitStatus) { <del> case RootIncomplete: <add> case RootInProgress: <ide> case RootFatalErrored: { <ide> throw new Error('Root did not complete. This is a bug in React.'); <ide> } <ide> function performSyncWorkOnRoot(root) { <ide> throw fatalError; <ide> } <ide> <add> if (exitStatus === RootDidNotComplete) { <add> throw new Error('Root did not complete. This is a bug in React.'); <add> } <add> <ide> // We now have a consistent tree. Because this is a sync render, we <ide> // will commit it even if something suspended. <ide> const finishedWork: Fiber = (root.current.alternate: any); <ide> function prepareFreshStack(root: FiberRoot, lanes: Lanes) { <ide> workInProgressRoot = root; <ide> workInProgress = createWorkInProgress(root.current, null); <ide> workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; <del> workInProgressRootExitStatus = RootIncomplete; <add> workInProgressRootExitStatus = RootInProgress; <ide> workInProgressRootFatalError = null; <ide> workInProgressRootSkippedLanes = NoLanes; <ide> workInProgressRootInterleavedUpdatedLanes = NoLanes; <ide> export function markSkippedUpdateLanes(lane: Lane | Lanes): void { <ide> } <ide> <ide> export function renderDidSuspend(): void { <del> if (workInProgressRootExitStatus === RootIncomplete) { <add> if (workInProgressRootExitStatus === RootInProgress) { <ide> workInProgressRootExitStatus = RootSuspended; <ide> } <ide> } <ide> <ide> export function renderDidSuspendDelayIfPossible(): void { <ide> if ( <del> workInProgressRootExitStatus === RootIncomplete || <add> workInProgressRootExitStatus === RootInProgress || <ide> workInProgressRootExitStatus === RootSuspended || <ide> workInProgressRootExitStatus === RootErrored <ide> ) { <ide> export function renderDidError(error: mixed) { <ide> export function renderHasNotSuspendedYet(): boolean { <ide> // If something errored or completed, we can't really be sure, <ide> // so those are false. <del> return workInProgressRootExitStatus === RootIncomplete; <add> return workInProgressRootExitStatus === RootInProgress; <ide> } <ide> <ide> function renderRootSync(root: FiberRoot, lanes: Lanes) { <ide> function renderRootConcurrent(root: FiberRoot, lanes: Lanes) { <ide> if (enableSchedulingProfiler) { <ide> markRenderYielded(); <ide> } <del> return RootIncomplete; <add> return RootInProgress; <ide> } else { <ide> // Completed the tree. <ide> if (enableSchedulingProfiler) { <ide> function completeUnitOfWork(unitOfWork: Fiber): void { <ide> returnFiber.flags |= Incomplete; <ide> returnFiber.subtreeFlags = NoFlags; <ide> returnFiber.deletions = null; <add> } else { <add> // We've unwound all the way to the root. <add> workInProgressRootExitStatus = RootDidNotComplete; <add> workInProgress = null; <add> return; <ide> } <ide> } <ide> <ide> function completeUnitOfWork(unitOfWork: Fiber): void { <ide> } while (completedWork !== null); <ide> <ide> // We've reached the root. <del> if (workInProgressRootExitStatus === RootIncomplete) { <add> if (workInProgressRootExitStatus === RootInProgress) { <ide> workInProgressRootExitStatus = RootCompleted; <ide> } <ide> } <ide><path>packages/react-reconciler/src/__tests__/ReactConcurrentErrorRecovery-test.js <ide> describe('ReactConcurrentErrorRecovery', () => { <ide> // Now we can show the error boundary that's wrapped around B. <ide> expect(root).toMatchRenderedOutput('Oops!B2'); <ide> }); <add> <add> // @gate enableCache <add> test('suspending in the shell (outside a Suspense boundary) should not throw, warn, or log during a transition', async () => { <add> class ErrorBoundary extends React.Component { <add> state = {error: null}; <add> static getDerivedStateFromError(error) { <add> return {error}; <add> } <add> render() { <add> if (this.state.error !== null) { <add> return <Text text={this.state.error.message} />; <add> } <add> return this.props.children; <add> } <add> } <add> <add> // The initial render suspends without a Suspense boundary. Since it's <add> // wrapped in startTransition, it suspends instead of erroring. <add> const root = ReactNoop.createRoot(); <add> await act(async () => { <add> startTransition(() => { <add> root.render(<AsyncText text="Async" />); <add> }); <add> }); <add> expect(Scheduler).toHaveYielded(['Suspend! [Async]']); <add> expect(root).toMatchRenderedOutput(null); <add> <add> // This also works if the suspended component is wrapped with an error <add> // boundary. (This is only interesting because when a component suspends <add> // outside of a transition, we throw an error, which can be captured by <add> // an error boundary. <add> await act(async () => { <add> startTransition(() => { <add> root.render( <add> <ErrorBoundary> <add> <AsyncText text="Async" /> <add> </ErrorBoundary>, <add> ); <add> }); <add> }); <add> expect(Scheduler).toHaveYielded(['Suspend! [Async]']); <add> expect(root).toMatchRenderedOutput(null); <add> <add> // Continues rendering once data resolves <add> await act(async () => { <add> resolveText('Async'); <add> }); <add> expect(Scheduler).toHaveYielded(['Async']); <add> expect(root).toMatchRenderedOutput('Async'); <add> }); <add> <add> // @gate enableCache <add> test( <add> 'errors during a suspended transition at the shell should not force ' + <add> 'fallbacks to display (error then suspend)', <add> async () => { <add> // This is similar to the earlier test for errors that occur during <add> // a refresh transition. Suspending in the shell is conceptually the same <add> // as a refresh, but they have slightly different implementation paths. <add> <add> class ErrorBoundary extends React.Component { <add> state = {error: null}; <add> static getDerivedStateFromError(error) { <add> return {error}; <add> } <add> render() { <add> if (this.state.error !== null) { <add> return ( <add> <Text text={'Caught an error: ' + this.state.error.message} /> <add> ); <add> } <add> return this.props.children; <add> } <add> } <add> <add> function Throws() { <add> throw new Error('Oops!'); <add> } <add> <add> // Suspend and throw in the same transition <add> const root = ReactNoop.createRoot(); <add> await act(async () => { <add> startTransition(() => { <add> root.render( <add> <ErrorBoundary> <add> <AsyncText text="Async" /> <add> <Throws /> <add> </ErrorBoundary>, <add> ); <add> }); <add> }); <add> expect(Scheduler).toHaveYielded([ <add> 'Suspend! [Async]', <add> // TODO: Ideally we would skip this second render pass to render the <add> // error UI, since it's not going to commit anyway. The same goes for <add> // Suspense fallbacks during a refresh transition. <add> 'Caught an error: Oops!', <add> ]); <add> // The render suspended without committing or surfacing the error. <add> expect(root).toMatchRenderedOutput(null); <add> <add> // Try the reverse order, too: throw then suspend <add> await act(async () => { <add> startTransition(() => { <add> root.render( <add> <ErrorBoundary> <add> <Throws /> <add> <AsyncText text="Async" /> <add> </ErrorBoundary>, <add> ); <add> }); <add> }); <add> expect(Scheduler).toHaveYielded([ <add> 'Suspend! [Async]', <add> 'Caught an error: Oops!', <add> ]); <add> expect(root).toMatchRenderedOutput(null); <add> <add> await act(async () => { <add> await resolveText('Async'); <add> }); <add> <add> expect(Scheduler).toHaveYielded([ <add> 'Async', <add> 'Caught an error: Oops!', <add> <add> // Try recovering from the error by rendering again synchronously <add> 'Async', <add> 'Caught an error: Oops!', <add> ]); <add> <add> expect(root).toMatchRenderedOutput('Caught an error: Oops!'); <add> }, <add> ); <ide> });
7
Ruby
Ruby
drop lighttpd support from script/server
40c6a8b9701f4e137799cecfc72c64aca7b4004b
<ide><path>railties/lib/commands/server.rb <ide> end <ide> <ide> server = case ARGV.first <del> when "lighttpd", "mongrel", "webrick", "thin" <add> when "mongrel", "webrick", "thin" <ide> ARGV.shift <ide> else <ide> if defined?(Mongrel) <ide> "mongrel" <ide> elsif defined?(Thin) <ide> "thin" <del> elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) <del> "lighttpd" <ide> else <ide> "webrick" <ide> end <ide> case server <ide> when "webrick" <ide> puts "=> Booting WEBrick..." <del> when "lighttpd" <del> puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)" <ide> when "mongrel" <ide> puts "=> Booting Mongrel (use 'script/server webrick' to force WEBrick)" <ide> when "thin" <ide><path>railties/lib/commands/servers/lighttpd.rb <del>require 'rbconfig' <del>require 'commands/servers/base' <del> <del>unless RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? <del> puts "PROBLEM: Lighttpd is not available on your system (or not in your path)" <del> exit 1 <del>end <del> <del>unless defined?(FCGI) <del> puts "PROBLEM: Lighttpd requires that the FCGI Ruby bindings are installed on the system" <del> exit 1 <del>end <del> <del>require 'initializer' <del>configuration = Rails::Initializer.run(:initialize_logger).configuration <del>default_config_file = config_file = Pathname.new("#{RAILS_ROOT}/config/lighttpd.conf").cleanpath <del> <del>require 'optparse' <del> <del>detach = false <del>command_line_port = nil <del> <del>ARGV.options do |opt| <del> opt.on("-p", "--port=port", "Changes the server.port number in the config/lighttpd.conf") { |port| command_line_port = port } <del> opt.on('-c', "--config=#{config_file}", 'Specify a different lighttpd config file.') { |path| config_file = path } <del> opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 } <del> opt.on('-d', '-d', 'Call with -d to detach') { detach = true; puts "=> Configuration in config/lighttpd.conf" } <del> opt.parse! <del>end <del> <del>unless File.exist?(config_file) <del> if config_file != default_config_file <del> puts "=> #{config_file} not found." <del> exit 1 <del> end <del> <del> require 'fileutils' <del> <del> source = File.expand_path(File.join(File.dirname(__FILE__), <del> "..", "..", "..", "configs", "lighttpd.conf")) <del> puts "=> #{config_file} not found, copying from #{source}" <del> <del> FileUtils.cp(source, config_file) <del>end <del> <del># open the config/lighttpd.conf file and add the current user defined port setting to it <del>if command_line_port <del> File.open(config_file, 'r+') do |config| <del> lines = config.readlines <del> <del> lines.each do |line| <del> line.gsub!(/^\s*server.port\s*=\s*(\d+)/, "server.port = #{command_line_port}") <del> end <del> <del> config.rewind <del> config.print(lines) <del> config.truncate(config.pos) <del> end <del>end <del> <del>config = IO.read(config_file) <del>default_port, default_ip = 3000, '0.0.0.0' <del>port = config.scan(/^\s*server.port\s*=\s*(\d+)/).first rescue default_port <del>ip = config.scan(/^\s*server.bind\s*=\s*"([^"]+)"/).first rescue default_ip <del>puts "=> Rails #{Rails.version} application starting on http://#{ip || default_ip}:#{port || default_port}" <del> <del>tail_thread = nil <del> <del>if !detach <del> puts "=> Call with -d to detach" <del> puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)" <del> detach = false <del> tail_thread = tail(configuration.log_path) <del>end <del> <del>trap(:INT) { exit } <del> <del>begin <del> `rake tmp:sockets:clear` # Needed if lighttpd crashes or otherwise leaves FCGI sockets around <del> `lighttpd #{!detach ? "-D " : ""}-f #{config_file}` <del>ensure <del> unless detach <del> tail_thread.kill if tail_thread <del> puts 'Exiting' <del> <del> # Ensure FCGI processes are reaped <del> silence_stream(STDOUT) do <del> ARGV.replace ['-a', 'kill'] <del> require 'commands/process/reaper' <del> end <del> <del> `rake tmp:sockets:clear` # Remove sockets on clean shutdown <del> end <del>end
2
Python
Python
fix regression of `regexfield`.
4655501d51080fbc7733a81fab1a227229a33e3f
<ide><path>rest_framework/fields.py <ide> class SkipField(Exception): <ide> pass <ide> <ide> <add>REGEX_TYPE = type(re.compile('')) <add> <ide> NOT_READ_ONLY_WRITE_ONLY = 'May not set both `read_only` and `write_only`' <ide> NOT_READ_ONLY_REQUIRED = 'May not set both `read_only` and `required`' <ide> NOT_REQUIRED_DEFAULT = 'May not set both `required` and `default`' <ide> def __deepcopy__(self, memo): <ide> When cloning fields we instantiate using the arguments it was <ide> originally created with, rather than copying the complete state. <ide> """ <del> args = copy.deepcopy(self._args) <del> kwargs = dict(self._kwargs) <del> # Bit ugly, but we need to special case 'validators' as Django's <del> # RegexValidator does not support deepcopy. <del> # We treat validator callables as immutable objects. <add> # Treat regexes and validators as immutable. <ide> # See https://github.com/tomchristie/django-rest-framework/issues/1954 <del> validators = kwargs.pop('validators', None) <del> kwargs = copy.deepcopy(kwargs) <del> if validators is not None: <del> kwargs['validators'] = validators <add> # and https://github.com/tomchristie/django-rest-framework/pull/4489 <add> args = [ <add> copy.deepcopy(item) if not isinstance(item, REGEX_TYPE) else item <add> for item in self._args <add> ] <add> kwargs = { <add> key: (copy.deepcopy(value) if (key not in ('validators', 'regex')) else value) <add> for key, value in self._kwargs.items() <add> } <ide> return self.__class__(*args, **kwargs) <ide> <ide> def __repr__(self): <ide><path>tests/test_fields.py <ide> import datetime <ide> import os <add>import re <ide> import uuid <ide> from decimal import Decimal <ide> <ide> class TestRegexField(FieldValues): <ide> field = serializers.RegexField(regex='[a-z][0-9]') <ide> <ide> <add>class TestiCompiledRegexField(FieldValues): <add> """ <add> Valid and invalid values for `RegexField`. <add> """ <add> valid_inputs = { <add> 'a9': 'a9', <add> } <add> invalid_inputs = { <add> 'A9': ["This value does not match the required pattern."] <add> } <add> outputs = {} <add> field = serializers.RegexField(regex=re.compile('[a-z][0-9]')) <add> <add> <ide> class TestSlugField(FieldValues): <ide> """ <ide> Valid and invalid values for `SlugField`. <ide><path>tests/test_serializer.py <ide> from __future__ import unicode_literals <ide> <ide> import pickle <add>import re <ide> <ide> import pytest <ide> <ide> def test_default_should_not_be_included_on_partial_update(self): <ide> assert serializer.is_valid() <ide> assert serializer.validated_data == {'integer': 456} <ide> assert serializer.errors == {} <add> <add> <add>class TestSerializerValidationWithCompiledRegexField: <add> def setup(self): <add> class ExampleSerializer(serializers.Serializer): <add> name = serializers.RegexField(re.compile(r'\d'), required=True) <add> self.Serializer = ExampleSerializer <add> <add> def test_validation_success(self): <add> serializer = self.Serializer(data={'name': '2'}) <add> assert serializer.is_valid() <add> assert serializer.validated_data == {'name': '2'} <add> assert serializer.errors == {}
3
Javascript
Javascript
avoid use of arguments
e36d0d3974d563a3d40b56e9f11c467d51820c89
<ide><path>lib/dns.js <ide> function errnoException(err, syscall, hostname) { <ide> // callback.immediately = true; <ide> // } <ide> function makeAsync(callback) { <del> return function asyncCallback() { <add> return function asyncCallback(...args) { <ide> if (asyncCallback.immediately) { <ide> // The API already returned, we can invoke the callback immediately. <del> callback.apply(null, arguments); <add> callback.apply(null, args); <ide> } else { <del> var args = new Array(arguments.length + 1); <del> args[0] = callback; <del> for (var i = 0; i < arguments.length; ++i) <del> args[i + 1] = arguments[i]; <add> args.unshift(callback); <ide> process.nextTick.apply(null, args); <ide> } <ide> };
1
PHP
PHP
remove unnecessary comments
71a86f35e6d938b8311375cc380279a9e2e93c1c
<ide><path>src/Command/RoutesCommand.php <ide> public function execute(Arguments $args, ConsoleIo $io): ?int <ide> <ide> $output[] = $item; <ide> <del> // Count route templates <ide> if (!isset($duplicateRoutesCounter[$route->template])) { <ide> $duplicateRoutesCounter[$route->template] = 0; <ide> }
1
Text
Text
add react 15 post
75f492507421f243f49ef9cfdcab5c557022eefe
<ide><path>docs/_posts/2016-04-07-react-v15.md <add>--- <add>title: "React v15.0" <add>author: gaearon <add>--- <add> <add>We would like to thank the React community for reporting issues and regressions in the release candidates on our [issue tracker](https://github.com/facebook/react/issues/). Over the last few weeks we fixed those issues, and now, after two release candidates, we are excited to finally release the stable version of React 15. <add> <add>As a reminder, [we’re switching to major versions](/react/blog/2016/02/19/new-versioning-scheme.html) to indicate that we have been using React in production for a long time. This 15.0 release follows our previous 0.14 version and we’ll continue to follow semver like we’ve been doing since 2013. It’s also worth noting that [we no longer actively support Internet Explorer 8](/react/blog/2016/01/12/discontinuing-ie8-support.html). We believe React will work in its current form there but we will not be prioritizing any efforts to fix new issues that only affect IE8. <add> <add>React 15 brings significant improvements to how we interact with the DOM: <add> <add>* We are now using `document.createElement` instead of setting `innerHTML` when mounting components. This allows us to get rid of the `data-reactid` attribute on every node and make the DOM lighter. Using `document.createElement` is also faster in modern browsers and fixes a number of edge cases related to SVG elements and running multiple copies of React on the same page. <add> <add>* Historically our support for SVG has been incomplete, and many tags and attributes were missing. We heard you, and in React 15 we [added support for all the SVG attributes that are recognized by today’s browsers](https://github.com/facebook/react/pull/6243). If we missed any of the attributes you’d like to use, please [let us know](https://github.com/facebook/react/issues/1657). As a bonus, thanks to using `document.createElement`, we no longer need to maintain a list of SVG tags, so any SVG tags that were previously unsupported should work just fine in React 15. <add> <add>* We received some amazing contributions from the community in this release, and we would like to highlight [this pull request](https://github.com/facebook/react/pull/5753) by [Michael Wiencek](https://github.com/mwiencek) in particular. Thanks to Michael’s work, React 15 no longer emits extra `<span>` nodes around the text, making the DOM output much cleaner. This was a longstanding annoyance for React users so it’s exciting to accept this as an outside contribution. <add> <add>While this isn’t directly related to the release, we understand that in order to receive more community contributions like Michael’s, we need to communicate our goals and priorities more openly, and review pull requests more decisively. As a first step towards this, we started publishing [React core team weekly meeting notes](https://github.com/reactjs/core-notes) again. We also intend to introduce an RFC process inspired by [Ember RFCs](https://github.com/emberjs/rfcs) so external contributors can have more insight and influence in the future development of React. We will keep you updated about this on our blog. <add> <add>We are also experimenting with a new changelog format in this post. Every change now links to the corresponding pull request and mentions the author. Let us know whether you find this useful! <add> <add>## Upgrade Guide <add> <add>As usual with major releases, React 15 will remove support for some of the patterns deprecated nine months ago in React 0.14. We know changes can be painful (the Facebook codebase has over 20,000 React components, and that’s not even counting React Native), so we always try to make changes gradually in order to minimize the pain. <add> <add>If your code is free of warnings when running under React 0.14, upgrading should be easy. The bulk of changes in this release are actually behind the scenes, impacting the way that React interacts with the DOM. The other substantial change is that React now supports the full range of SVG elements and attributes. Beyond that we have a large number of incremental improvements and additional warnings aimed to aid developers. We’ve also laid some groundwork in the core to bring you some new capabilities in future releases. <add> <add>See the changelog below for more details. <add> <add>## Installation <add> <add>We recommend using React from `npm` and using a tool like browserify or webpack to build your code into a single bundle. To install the two packages: <add> <add>* `npm install --save react react-dom` <add> <add>Remember that by default, React runs extra checks and provides helpful warnings in development mode. When deploying your app, set the `NODE_ENV` environment variable to `production` to use the production build of React which does not include the development warnings and runs significantly faster. <add> <add>If you can’t use `npm` yet, we provide pre-built browser builds for your convenience, which are also available in the `react` package on bower. <add> <add>* **React** <add> Dev build with warnings: <https://fb.me/react-15.0.0.js> <add> Minified build for production: <https://fb.me/react-15.0.0.min.js> <add>* **React with Add-Ons** <add> Dev build with warnings: <https://fb.me/react-with-addons-15.0.0.js> <add> Minified build for production: <https://fb.me/react-with-addons-15.0.0.min.js> <add>* **React DOM** (include React in the page before React DOM) <add> Dev build with warnings: <https://fb.me/react-dom-15.0.0.js> <add> Minified build for production: <https://fb.me/react-dom-15.0.0.min.js> <add> <add>## Changelog <add> <add>### Major changes <add> <add>- #### `document.createElement` is in and `data-reactid` is out <add> <add> There were a number of large changes to our interactions with the DOM. One of the most noticeable changes is that we no longer set the `data-reactid` attribute for each DOM node. While this will make it more difficult to know if a website is using React, the advantage is that the DOM is much more lightweight. This change was made possible by us switching to use `document.createElement` on initial render. Previously we would generate a large string of HTML and then set `node.innerHTML`. At the time, this was decided to be faster than using `document.createElement` for the majority of cases and browsers that we supported. Browsers have continued to improve and so overwhelmingly this is no longer true. By using `createElement` we can make other parts of React faster. The ids were used to map back from events to the original React component, meaning we had to do a bunch of work on every event, even though we cached this data heavily. As we’ve all experienced, caching and in particularly invalidating caches, can be error prone and we saw many hard to reproduce issues over the years as a result. Now we can build up a direct mapping at render time since we already have a handle on the node. <add> <add> <small>[@spicyj](https://github.com/spicyj) in [#5205](https://github.com/facebook/react/pull/5205)</small> <add> <add>- #### No more extra `<span>`s <add> <add> Another big change with our DOM interaction is how we render text blocks. Previously you may have noticed that React rendered a lot of extra `<span>`s. For example, in our most basic example on the home page we render `<div>Hello {this.props.name}</div>`, resulting in markup that contained 2 `<span>`s. Now we’ll render plain text nodes interspersed with comment nodes that are used for demarcation. This gives us the same ability to update individual pieces of text, without creating extra nested nodes. Very few people have depended on the actual markup generated here so it’s likely you are not impacted. However if you were targeting these `<span>`s in your CSS, you will need to adjust accordingly. You can always render them explicitly in your components. <add> <add> <small>[@mwiencek](https://github.com/mwiencek) in [#5753](https://github.com/facebook/react/pull/5753)</small> <add> <add>- #### Rendering `null` now uses comment nodes <add> <add> We’ve also made use of these comment nodes to change what `null` renders to. Rendering to `null` was a feature we added in React 0.11 and was implemented by rendering `<noscript>` elements. By rendering to comment nodes now, there’s a chance some of your CSS will be targeting the wrong thing, specifically if you are making use of `:nth-child` selectors. This, along with the other changes mentioned above, have always been considered implementation details of how React targets the DOM. We believe they are safe changes to make without going through a release with warnings detailing the subtle differences as they are details that should not be depended upon. Additionally, we have seen that these changes have improved React performance for many typical applications. <add> <add> <small>[@spicyj](https://github.com/spicyj) in [#5451](https://github.com/facebook/react/pull/5451)</small> <add> <add>- #### Functional components can now return `null` too <add> <add> We added support for [defining stateless components as functions](/react/blog/2015/09/10/react-v0.14-rc1.html#stateless-function-components) in React 0.14. However, React 0.14 still allowed you to define a class component without extending `React.Component` or using `React.createClass()`, so [we couldn’t reliably tell if your component is a function or a class](https://github.com/facebook/react/issues/5355), and did not allow returning `null` from it. This issue is solved in React 15, and you can now return `null` from any component, whether it is a class or a function. <add> <add> <small>[@jimfb](https://github.com/jimfb) in [#5884](https://github.com/facebook/react/pull/5884)</small> <add> <add>- #### Improved SVG support <add> <add> All SVG tags are now fully supported. (Uncommon SVG tags are not present on the `React.DOM` element helper, but JSX and `React.createElement` work on all tag names.) All SVG attributes that are implemented by the browsers should be supported too. If you find any attributes that we have missed, please [let us know in this issue](https://github.com/facebook/react/issues/1657). <add> <add> <small>[@zpao](https://github.com/zpao) in [#6243](https://github.com/facebook/react/pull/6243)</small> <add> <add>### Breaking changes <add> <add>- #### No more extra `<span>`s <add> <add> It’s worth calling out the DOM structure changes above again, in particular the change from `<span>`s. In the course of updating the Facebook codebase, we found a very small amount of code that was depending on the markup that React generated. Some of these cases were integration tests like WebDriver which were doing very specific XPath queries to target nodes. Others were simply tests using `ReactDOM.renderToStaticMarkup` and comparing markup. Again, there were a very small number of changes that had to be made, but we don’t want anybody to be blindsided. We encourage everybody to run their test suites when upgrading and consider alternative approaches when possible. One approach that will work for some cases is to explicitly use `<span>`s in your `render` method. <add> <add> <small>[@mwiencek](https://github.com/mwiencek) in [#5753](https://github.com/facebook/react/pull/5753)</small> <add> <add>- #### `React.cloneElement()` now resolves `defaultProps` <add> <add> We fixed a bug in `React.cloneElement()` that some components may rely on. If some of the `props` received by `cloneElement()` are `undefined`, it used to return an element with `undefined` values for those props. In React 15, we’re changing it to be consistent with `createElement()`. Now any `undefined` props passed to `cloneElement()` are resolved to the corresponding component’s `defaultProps`. Only one of our 20,000 React components was negatively affected by this so we feel comfortable releasing this change without keeping the old behavior for another release cycle. <add> <add> <small>[@truongduy134](https://github.com/truongduy134) in [#5997](https://github.com/facebook/react/pull/5997)</small> <add> <add>- #### `ReactPerf.getLastMeasurements()` is opaque <add> <add> This change won’t affect applications but may break some third-party tools. We are [revamping `ReactPerf` implementation](https://github.com/facebook/react/pull/6046) and plan to release it during the 15.x cycle. The internal performance measurement format is subject to change so, for the time being, we consider the return value of `ReactPerf.getLastMeasurements()` an opaque data structure that should not be relied upon. <add> <add> <small>[@gaearon](https://github.com/gaearon) in [#6286](https://github.com/facebook/react/pull/6286)</small> <add> <add>- #### Removed deprecations <add> <add> These deprecations were introduced nine months ago in v0.14 with a warning and are removed: <add> <add> - Deprecated APIs are removed from the `React` top-level export: `findDOMNode`, `render`, `renderToString`, `renderToStaticMarkup`, and `unmountComponentAtNode`. As a reminder, they are now available on `ReactDOM` and `ReactDOMServer`. <add> <small>[@jimfb](https://github.com/jimfb) in [#5832](https://github.com/facebook/react/pull/5832)</small> <add> <add> - Deprecated addons are removed: `batchedUpdates` and `cloneWithProps`. <add> <small>[@jimfb](https://github.com/jimfb) in [#5859](https://github.com/facebook/react/pull/5859), [@zpao](https://github.com/zpao) in [#6016](https://github.com/facebook/react/pull/6016)</small> <add> <add> - Deprecated component instance methods are removed: `setProps`, `replaceProps`, and `getDOMNode`. <add> <small>[@jimfb](https://github.com/jimfb) in [#5570](https://github.com/facebook/react/pull/5570)</small> <add> <add> - Deprecated CommonJS `react/addons` entry point is removed. As a reminder, you should use separate `react-addons-*` packages instead. This only applies if you use the CommonJS builds. <add> <small>[@gaearon](https://github.com/gaearon) in [#6285](https://github.com/facebook/react/pull/6285)</small> <add> <add> - Passing `children` to void elements like `<input>` was deprecated, and now throws an error. <add> <small>[@jonhester](https://github.com/jonhester) in [#3372](https://github.com/facebook/react/pull/3372)</small> <add> <add> - React-specific properties on DOM `refs` (e.g. `this.refs.div.props`) were deprecated, and are removed now. <add> <small>[@jimfb](https://github.com/jimfb) in [#5495](https://github.com/facebook/react/pull/5495)</small> <add> <add>### New deprecations, introduced with a warning <add> <add>Each of these changes will continue to work as before with a new warning until the release of React 16 so you can upgrade your code gradually. <add> <add>- `LinkedStateMixin` and `valueLink` are now deprecated due to very low popularity. If you need this, you can use a wrapper component that implements the same behavior: [react-linked-input](https://www.npmjs.com/package/react-linked-input). <add><small>[@jimfb](https://github.com/jimfb) in [#6127](https://github.com/facebook/react/pull/6127)</small> <add> <add>- Future versions of React will treat `<input value={null}>` as a request to clear the input. However, React 0.14 has been ignoring `value={null}`. React 15 warns you on a `null` input value and offers you to clarify your intention. To fix the warning, you may explicitly pass an empty string to clear a controlled input, or pass `undefined` to make the input uncontrolled. <add><small>[@antoaravinth](https://github.com/antoaravinth) in [#5048](https://github.com/facebook/react/pull/5048)</small> <add> <add>- `ReactPerf.printDOM()` was renamed to `ReactPerf.printOperations()`, and `ReactPerf.getMeasurementsSummaryMap()` was renamed to `ReactPerf.getWasted()`. <add><small>[@gaearon](https://github.com/gaearon) in [#6287](https://github.com/facebook/react/pull/6287)</small> <add> <add>### New helpful warnings <add> <add>- If you use a minified copy of the _development_ build, React DOM kindly encourages you to use the faster production build instead. <add><small>[@spicyj](https://github.com/spicyj) in [#5083](https://github.com/facebook/react/pull/5083)</small> <add> <add>- React DOM: When specifying a unit-less CSS value as a string, a future version will not add `px` automatically. This version now warns in this case (ex: writing `style={{'{{'}}width: '300'}}`. Unitless *number* values like `width: 300` are unchanged. <add><small>[@pluma](https://github.com/pluma) in [#5140](https://github.com/facebook/react/pull/5140)</small> <add> <add>- Synthetic Events will now warn when setting and accessing properties (which will not get cleared appropriately), as well as warn on access after an event has been returned to the pool. <add><small>[@kentcdodds](https://github.com/kentcdodds) in [#5940](https://github.com/facebook/react/pull/5940) and [@koba04](https://github.com/koba04) in [#5947](https://github.com/facebook/react/pull/5947)</small> <add> <add>- Elements will now warn when attempting to read `ref` and `key` from the props. <add><small>[@prometheansacrifice](https://github.com/prometheansacrifice) in [#5744](https://github.com/facebook/react/pull/5744)</small> <add> <add>- React will now warn if you pass a different `props` object to `super()` in the constructor. <add><small>[@prometheansacrifice](https://github.com/prometheansacrifice) in [#5346](https://github.com/facebook/react/pull/5346)</small> <add> <add>- React will now warn if you call `setState()` inside `getChildContext()`. <add><small>[@raineroviir](https://github.com/raineroviir) in [#6121](https://github.com/facebook/react/pull/6121)</small> <add> <add>- React DOM now attempts to warn for mistyped event handlers on DOM elements, such as `onclick` which should be `onClick`. <add><small>[@ali](https://github.com/ali) in [#5361](https://github.com/facebook/react/pull/5361)</small> <add> <add>- React DOM now warns about `NaN` values in `style`. <add><small>[@jontewks](https://github.com/jontewks) in [#5811](https://github.com/facebook/react/pull/5811)</small> <add> <add>- React DOM now warns if you specify both `value` and `defaultValue` for an input. <add><small>[@mgmcdermott](https://github.com/mgmcdermott) in [#5823](https://github.com/facebook/react/pull/5823)</small> <add> <add>- React DOM now warns if an input switches between being controlled and uncontrolled. <add><small>[@TheBlasfem](https://github.com/TheBlasfem) in [#5864](https://github.com/facebook/react/pull/5864)</small> <add> <add>- React DOM now warns if you specify `onFocusIn` or `onFocusOut` handlers as they are unnecessary in React. <add><small>[@jontewks](https://github.com/jontewks) in [#6296](https://github.com/facebook/react/pull/6296)</small> <add> <add>- React now prints a descriptive error message when you pass an invalid callback as the last argument to `ReactDOM.render()`, `this.setState()`, or `this.forceUpdate()`. <add><small>[@conorhastings](https://github.com/conorhastings) in [#5193](https://github.com/facebook/react/pull/5193) and [@gaearon](https://github.com/gaearon) in [#6310](https://github.com/facebook/react/pull/6310)</small> <add> <add>- Add-Ons: `TestUtils.Simulate()` now prints a helpful message if you attempt to use it with shallow rendering. <add><small>[@conorhastings](https://github.com/conorhastings) in [#5358](https://github.com/facebook/react/pull/5358)</small> <add> <add>- PropTypes: `arrayOf()` and `objectOf()` provide better error messages for invalid arguments. <add><small>[@chicoxyzzy](https://github.com/chicoxyzzy) in [#5390](https://github.com/facebook/react/pull/5390)</small> <add> <add>### Notable bug fixes <add> <add>- Fixed multiple small memory leaks. <add><small>[@spicyj](https://github.com/spicyj) in [#4983](https://github.com/facebook/react/pull/4983) and [@victor-homyakov](https://github.com/victor-homyakov) in [#6309](https://github.com/facebook/react/pull/6309)</small> <add> <add>- Input events are handled more reliably in IE 10 and IE 11; spurious events no longer fire when using a placeholder. <add><small>[@jquense](https://github.com/jquense) in [#4051](https://github.com/facebook/react/pull/4051)</small> <add> <add>- The `componentWillReceiveProps()` lifecycle method is now consistently called when `context` changes. <add><small>[@milesj](https://github.com/milesj) in [#5787](https://github.com/facebook/react/pull/5787)</small> <add> <add>- `React.cloneElement()` doesn’t append slash to an existing `key` when used inside `React.Children.map()`. <add><small>[@ianobermiller](https://github.com/ianobermiller) in [#5892](https://github.com/facebook/react/pull/5892)</small> <add> <add>- React DOM now supports the `cite` and `profile` HTML attributes. <add><small>[@AprilArcus](https://github.com/AprilArcus) in [#6094](https://github.com/facebook/react/pull/6094) and [@saiichihashimoto](https://github.com/saiichihashimoto) in [#6032](https://github.com/facebook/react/pull/6032)</small> <add> <add>- React DOM now supports `cssFloat`, `gridRow` and `gridColumn` CSS properties. <add><small>[@stevenvachon](https://github.com/stevenvachon) in [#6133](https://github.com/facebook/react/pull/6133) and [@mnordick](https://github.com/mnordick) in [#4779](https://github.com/facebook/react/pull/4779)</small> <add> <add>- React DOM now correctly handles `borderImageOutset`, `borderImageWidth`, `borderImageSlice`, `floodOpacity`, `strokeDasharray`, and `strokeMiterlimit` as unitless CSS properties. <add><small>[@rofrischmann](https://github.com/rofrischmann) in [#6210](https://github.com/facebook/react/pull/6210) and [#6270](https://github.com/facebook/react/pull/6270)</small> <add> <add>- React DOM now supports the `onAnimationStart`, `onAnimationEnd`, `onAnimationIteration`, `onTransitionEnd`, and `onInvalid` events. Support for `onLoad` has been added to `object` elements. <add><small>[@tomduncalf](https://github.com/tomduncalf) in [#5187](https://github.com/facebook/react/pull/5187), [@milesj](https://github.com/milesj) in [#6005](https://github.com/facebook/react/pull/6005), and [@ara4n](https://github.com/ara4n) in [#5781](https://github.com/facebook/react/pull/5781)</small> <add> <add>- React DOM now defaults to using DOM attributes instead of properties, which fixes a few edge case bugs. Additionally the nullification of values (ex: `href={null}`) now results in the forceful removal, no longer trying to set to the default value used by browsers in the absence of a value. <add><small>[@syranide](https://github.com/syranide) in [#1510](https://github.com/facebook/react/pull/1510)</small> <add> <add>- React DOM does not mistakingly coerce `children` to strings for Web Components. <add><small>[@jimfb](https://github.com/jimfb) in [#5093](https://github.com/facebook/react/pull/5093)</small> <add> <add>- React DOM now correctly normalizes SVG `<use>` events. <add><small>[@edmellum](https://github.com/edmellum) in [#5720](https://github.com/facebook/react/pull/5720)</small> <add> <add>- React DOM does not throw if a `<select>` is unmounted while its `onChange` handler is executing. <add><small>[@sambev](https://github.com/sambev) in [#6028](https://github.com/facebook/react/pull/6028)</small> <add> <add>- React DOM does not throw in Windows 8 apps. <add><small>[@Andrew8xx8](https://github.com/Andrew8xx8) in [#6063](https://github.com/facebook/react/pull/6063)</small> <add> <add>- React DOM does not throw when asynchronously unmounting a child with a `ref`. <add><small>[@yiminghe](https://github.com/yiminghe) in [#6095](https://github.com/facebook/react/pull/6095)</small> <add> <add>- React DOM no longer forces synchronous layout because of scroll position tracking. <add><small>[@syranide](https://github.com/syranide) in [#2271](https://github.com/facebook/react/pull/2271)</small> <add> <add>- `Object.is` is used in a number of places to compare values, which leads to fewer false positives, especially involving `NaN`. In particular, this affects the `shallowCompare` add-on. <add><small>[@chicoxyzzy](https://github.com/chicoxyzzy) in [#6132](https://github.com/facebook/react/pull/6132)</small> <add> <add>- Add-Ons: ReactPerf no longer instruments adding or removing an event listener because they don’t really touch the DOM due to event delegation. <add><small>[@antoaravinth](https://github.com/antoaravinth) in [#5209](https://github.com/facebook/react/pull/5209)</small> <add> <add>### Other improvements <add> <add>- React now uses `loose-envify` instead of `envify` so it installs less transitive dependencies. <add><small>[@qerub](https://github.com/qerub) in [#6303](https://github.com/facebook/react/pull/6303)</small> <add> <add>- Shallow renderer now exposes `getMountedInstance()`. <add><small>[@glenjamin](https://github.com/glenjamin) in [#4918](https://github.com/facebook/react/pull/4918)</small> <add> <add>- Shallow renderer now returns the rendered output from `render()`. <add><small>[@simonewebdesign](https://github.com/simonewebdesign) in [#5411](https://github.com/facebook/react/pull/5411)</small> <add> <add>- React no longer depends on ES5 *shams* for `Object.create` and `Object.freeze` in older environments. It still, however, requires ES5 *shims* in those environments. <add><small>[@dgreensp](https://github.com/dgreensp) in [#4959](https://github.com/facebook/react/pull/4959)</small> <add> <add>- React DOM now allows `data-` attributes with names that start with numbers. <add><small>[@nLight](https://github.com/nLight) in [#5216](https://github.com/facebook/react/pull/5216)</small> <add> <add>- React DOM adds a new `suppressContentEditableWarning` prop for components like [Draft.js](https://facebook.github.io/draft-js/) that intentionally manage `contentEditable` children with React. <add><small>[@mxstbr](https://github.com/mxstbr) in [#6112](https://github.com/facebook/react/pull/6112)</small> <add> <add>- React improves the performance for `createClass()` on complex specs. <add><small>[@spicyj](https://github.com/spicyj) in [#5550](https://github.com/facebook/react/pull/5550)</small>
1
Ruby
Ruby
fix race in connectionpool#checkout
21eb18a70c7a1f08e7e2dc1c5bc17d67e1d14c46
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb <ide> def clear_stale_cached_connections! <ide> # Check-out a database connection from the pool. <ide> def checkout <ide> # Checkout an available connection <del> conn = @connection_mutex.synchronize do <del> if @checked_out.size < @connections.size <del> checkout_existing_connection <del> elsif @connections.size < @size <del> checkout_new_connection <del> end <del> end <del> return conn if conn <del> <del> # No connections available; wait for one <ide> @connection_mutex.synchronize do <del> if @queue.wait(@timeout) <del> checkout_existing_connection <del> else <del> raise ConnectionTimeoutError, "could not obtain a database connection within #{@timeout} seconds. The pool size is currently #{@size}, perhaps you need to increase it?" <add> loop do <add> conn = if @checked_out.size < @connections.size <add> checkout_existing_connection <add> elsif @connections.size < @size <add> checkout_new_connection <add> end <add> return conn if conn <add> # No connections available; wait for one <add> if @queue.wait(@timeout) <add> next <add> else <add> raise ConnectionTimeoutError, "could not obtain a database connection within #{@timeout} seconds. The pool size is currently #{@size}, perhaps you need to increase it?" <add> end <ide> end <ide> end <ide> end <ide> def retrieve_connection_pool(klass) <ide> end <ide> end <ide> end <del>end <ide>\ No newline at end of file <add>end
1
Javascript
Javascript
draw active points last
547aa515440def05a3c2ab998919faead7d102f5
<ide><path>src/controllers/controller.line.js <ide> export default DatasetController.extend({ <ide> const meta = me._cachedMeta; <ide> const points = meta.data || []; <ide> const area = chart.chartArea; <del> const ilen = points.length; <del> let i = 0; <add> const active = []; <add> let ilen = points.length; <add> let i, point; <ide> <ide> if (me._showLine) { <ide> meta.dataset.draw(ctx, area); <ide> } <ide> <add> <ide> // Draw the points <del> for (; i < ilen; ++i) { <del> points[i].draw(ctx, area); <add> for (i = 0; i < ilen; ++i) { <add> point = points[i]; <add> if (point.active) { <add> active.push(point); <add> } else { <add> point.draw(ctx, area); <add> } <add> } <add> for (i = 0, ilen = active.length; i < ilen; ++i) { <add> active[i].draw(ctx, area); <ide> } <ide> }, <ide> }); <ide><path>src/core/core.datasetController.js <ide> helpers.extend(DatasetController.prototype, { <ide> * @private <ide> */ <ide> _setStyle(element, index, mode, active) { <add> element.active = active; <ide> this._resolveAnimations(index, mode, active).update(element, {options: this.getStyle(index, active)}); <ide> }, <ide>
2
Ruby
Ruby
move used_options and unused_options to argv
ebbc3438a1e6f9014d049c98c54182a31212b1d8
<ide><path>Library/Homebrew/extend/ARGV.rb <ide> def options_only <ide> select {|arg| arg[0..0] == '-'} <ide> end <ide> <add> def used_options f <add> f.build.as_flags & options_only <add> end <add> <add> def unused_options f <add> f.build.as_flags - options_only <add> end <add> <ide> def formulae <ide> require 'formula' <ide> @formulae ||= downcased_unique_named.map{ |name| Formula.factory name } <ide><path>Library/Homebrew/tab.rb <ide> # `Tab.for_install`. <ide> class Tab < OpenStruct <ide> def self.for_install f, args <del> # Retrieve option flags from command line. <del> arg_options = args.options_only <del> # Pick off the option flags from the formula's `options` array by <del> # discarding the descriptions. <del> formula_options = f.build.as_flags <del> <del> Tab.new :used_options => formula_options & arg_options, <del> :unused_options => formula_options - arg_options, <add> Tab.new :used_options => args.used_options(f), <add> :unused_options => args.unused_options(f), <ide> :tabfile => f.prefix + "INSTALL_RECEIPT.json", <ide> :built_bottle => !!args.build_bottle?, <ide> :tapped_from => f.tap
2
Python
Python
add tests to trainer
573bdb0a5d2897ff6c7520ebb38693c7acfbf17e
<ide><path>src/transformers/data/data_collator.py <ide> def default_data_collator(features: List[InputDataClass]) -> Dict[str, torch.Ten <ide> if isinstance(v, torch.Tensor): <ide> batch[k] = torch.stack([f[k] for f in features]) <ide> else: <del> batch[k] = torch.tensor([f[k] for f in features], dtype=torch.long) <add> batch[k] = torch.tensor([f[k] for f in features]) <ide> <ide> return batch <ide> <ide><path>src/transformers/trainer.py <ide> def train(self, model_path: Optional[str] = None): <ide> else: <ide> t_total = int(len(train_dataloader) // self.args.gradient_accumulation_steps * self.args.num_train_epochs) <ide> num_train_epochs = self.args.num_train_epochs <add> self.args.max_steps = t_total <ide> <ide> self.create_optimizer_and_scheduler(num_training_steps=t_total) <ide> <ide> def train(self, model_path: Optional[str] = None): <ide> logging_loss = 0.0 <ide> model.zero_grad() <ide> train_iterator = trange( <del> epochs_trained, int(num_train_epochs), desc="Epoch", disable=not self.is_local_process_zero() <add> epochs_trained, int(np.ceil(num_train_epochs)), desc="Epoch", disable=not self.is_local_process_zero() <ide> ) <ide> for epoch in train_iterator: <ide> if isinstance(train_dataloader, DataLoader) and isinstance(train_dataloader.sampler, DistributedSampler): <ide> def train(self, model_path: Optional[str] = None): <ide> torch.save(self.optimizer.state_dict(), os.path.join(output_dir, "optimizer.pt")) <ide> torch.save(self.lr_scheduler.state_dict(), os.path.join(output_dir, "scheduler.pt")) <ide> <del> if self.args.max_steps > 0 and self.global_step > self.args.max_steps: <add> if self.args.max_steps > 0 and self.global_step >= self.args.max_steps: <ide> epoch_iterator.close() <ide> break <del> if self.args.max_steps > 0 and self.global_step > self.args.max_steps: <add> if self.args.max_steps > 0 and self.global_step >= self.args.max_steps: <ide> train_iterator.close() <ide> break <ide> if self.args.tpu_metrics_debug or self.args.debug: <ide> def prediction_loop( <ide> if self.args.past_index >= 0: <ide> self._past = None <ide> <add> samples_count = 0 <ide> for inputs in tqdm(dataloader, desc=description): <ide> loss, logits, labels = self.prediction_step(model, inputs, prediction_loss_only) <add> batch_size = inputs[list(inputs.keys())[0]].shape[0] <add> samples_count += batch_size <ide> if loss is not None: <del> eval_losses.append(loss) <add> eval_losses.append(loss * batch_size) <ide> if logits is not None: <ide> preds = logits if preds is None else torch.cat((preds, logits), dim=0) <ide> if labels is not None: <ide> def prediction_loop( <ide> else: <ide> metrics = {} <ide> if len(eval_losses) > 0: <del> metrics["eval_loss"] = np.mean(eval_losses) <add> metrics["eval_loss"] = np.sum(eval_losses) / samples_count <ide> <ide> # Prefix all keys with eval_ <ide> for key in list(metrics.keys()): <ide><path>src/transformers/training_args.py <ide> class TrainingArguments: <ide> max_grad_norm (:obj:`float`, `optional`, defaults to 1.0): <ide> Maximum gradient norm (for gradient clipping). <ide> num_train_epochs(:obj:`float`, `optional`, defaults to 3.0): <del> Total number of training epochs to perform. <add> Total number of training epochs to perform (if not an integer, will perform the decimal part percents of <add> the last epoch before stopping training). <ide> max_steps (:obj:`int`, `optional`, defaults to -1): <ide> If set to a positive number, the total number of training steps to perform. Overrides <ide> :obj:`num_train_epochs`. <ide><path>tests/test_data_collator.py <add>import unittest <add> <add>from transformers import AutoTokenizer, is_torch_available <add>from transformers.testing_utils import require_torch <add> <add> <add>if is_torch_available(): <add> import torch <add> <add> from transformers import ( <add> DataCollatorForLanguageModeling, <add> DataCollatorForPermutationLanguageModeling, <add> GlueDataset, <add> GlueDataTrainingArguments, <add> LineByLineTextDataset, <add> TextDataset, <add> default_data_collator, <add> ) <add> <add> <add>PATH_SAMPLE_TEXT = "./tests/fixtures/sample_text.txt" <add> <add> <add>@require_torch <add>class DataCollatorIntegrationTest(unittest.TestCase): <add> def test_default_with_dict(self): <add> features = [{"label": i, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <add> <add> # With label_ids <add> features = [{"label_ids": [0, 1, 2], "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertTrue(batch["labels"].equal(torch.tensor([[0, 1, 2]] * 8))) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <add> <add> # Features can already be tensors <add> features = [{"label": i, "inputs": torch.randint(10, [10])} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 10])) <add> <add> # Labels can already be tensors <add> features = [{"label": torch.tensor(i), "inputs": torch.randint(10, [10])} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 10])) <add> <add> def test_default_with_no_labels(self): <add> features = [{"label": None, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertTrue("labels" not in batch) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <add> <add> # With label_ids <add> features = [{"label_ids": None, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <add> batch = default_data_collator(features) <add> self.assertTrue("labels" not in batch) <add> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <add> <add> def test_default_classification(self): <add> MODEL_ID = "bert-base-cased-finetuned-mrpc" <add> tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) <add> data_args = GlueDataTrainingArguments( <add> task_name="mrpc", data_dir="./tests/fixtures/tests_samples/MRPC", overwrite_cache=True <add> ) <add> dataset = GlueDataset(data_args, tokenizer=tokenizer, mode="dev") <add> data_collator = default_data_collator <add> batch = data_collator(dataset.features) <add> self.assertEqual(batch["labels"].dtype, torch.long) <add> <add> def test_default_regression(self): <add> MODEL_ID = "distilroberta-base" <add> tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) <add> data_args = GlueDataTrainingArguments( <add> task_name="sts-b", data_dir="./tests/fixtures/tests_samples/STS-B", overwrite_cache=True <add> ) <add> dataset = GlueDataset(data_args, tokenizer=tokenizer, mode="dev") <add> data_collator = default_data_collator <add> batch = data_collator(dataset.features) <add> self.assertEqual(batch["labels"].dtype, torch.float) <add> <add> def test_lm_tokenizer_without_padding(self): <add> tokenizer = AutoTokenizer.from_pretrained("gpt2") <add> data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=False) <add> # ^ causal lm <add> <add> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <add> examples = [dataset[i] for i in range(len(dataset))] <add> with self.assertRaises(ValueError): <add> # Expect error due to padding token missing on gpt2: <add> data_collator(examples) <add> <add> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <add> examples = [dataset[i] for i in range(len(dataset))] <add> batch = data_collator(examples) <add> self.assertIsInstance(batch, dict) <add> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <add> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <add> <add> def test_lm_tokenizer_with_padding(self): <add> tokenizer = AutoTokenizer.from_pretrained("distilroberta-base") <add> data_collator = DataCollatorForLanguageModeling(tokenizer) <add> # ^ masked lm <add> <add> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <add> examples = [dataset[i] for i in range(len(dataset))] <add> batch = data_collator(examples) <add> self.assertIsInstance(batch, dict) <add> self.assertEqual(batch["input_ids"].shape, torch.Size((31, 107))) <add> self.assertEqual(batch["labels"].shape, torch.Size((31, 107))) <add> <add> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <add> examples = [dataset[i] for i in range(len(dataset))] <add> batch = data_collator(examples) <add> self.assertIsInstance(batch, dict) <add> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <add> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <add> <add> def test_plm(self): <add> tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased") <add> data_collator = DataCollatorForPermutationLanguageModeling(tokenizer) <add> # ^ permutation lm <add> <add> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <add> examples = [dataset[i] for i in range(len(dataset))] <add> batch = data_collator(examples) <add> self.assertIsInstance(batch, dict) <add> self.assertEqual(batch["input_ids"].shape, torch.Size((31, 112))) <add> self.assertEqual(batch["perm_mask"].shape, torch.Size((31, 112, 112))) <add> self.assertEqual(batch["target_mapping"].shape, torch.Size((31, 112, 112))) <add> self.assertEqual(batch["labels"].shape, torch.Size((31, 112))) <add> <add> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <add> examples = [dataset[i] for i in range(len(dataset))] <add> batch = data_collator(examples) <add> self.assertIsInstance(batch, dict) <add> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <add> self.assertEqual(batch["perm_mask"].shape, torch.Size((2, 512, 512))) <add> self.assertEqual(batch["target_mapping"].shape, torch.Size((2, 512, 512))) <add> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <add> <add> example = [torch.randint(5, [5])] <add> with self.assertRaises(ValueError): <add> # Expect error due to odd sequence length <add> data_collator(example) <ide><path>tests/test_trainer.py <ide> import unittest <ide> <add>import numpy as np <add> <ide> from transformers import AutoTokenizer, TrainingArguments, is_torch_available <ide> from transformers.testing_utils import require_torch <ide> <ide> <ide> from transformers import ( <ide> AutoModelForSequenceClassification, <del> DataCollatorForLanguageModeling, <del> DataCollatorForPermutationLanguageModeling, <ide> GlueDataset, <ide> GlueDataTrainingArguments, <ide> LineByLineTextDataset, <del> TextDataset, <ide> Trainer, <del> default_data_collator, <ide> ) <ide> <ide> <ide> PATH_SAMPLE_TEXT = "./tests/fixtures/sample_text.txt" <ide> <ide> <del>@require_torch <del>class DataCollatorIntegrationTest(unittest.TestCase): <del> def test_default_with_dict(self): <del> features = [{"label": i, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <del> self.assertEqual(batch["labels"].dtype, torch.long) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <del> <del> # With label_ids <del> features = [{"label_ids": [0, 1, 2], "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertTrue(batch["labels"].equal(torch.tensor([[0, 1, 2]] * 8))) <del> self.assertEqual(batch["labels"].dtype, torch.long) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <del> <del> # Features can already be tensors <del> features = [{"label": i, "inputs": torch.randint(10, [10])} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <del> self.assertEqual(batch["labels"].dtype, torch.long) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 10])) <del> <del> # Labels can already be tensors <del> features = [{"label": torch.tensor(i), "inputs": torch.randint(10, [10])} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertEqual(batch["labels"].dtype, torch.long) <del> self.assertTrue(batch["labels"].equal(torch.tensor(list(range(8))))) <del> self.assertEqual(batch["labels"].dtype, torch.long) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 10])) <del> <del> def test_default_with_no_labels(self): <del> features = [{"label": None, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertTrue("labels" not in batch) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <del> <del> # With label_ids <del> features = [{"label_ids": None, "inputs": [0, 1, 2, 3, 4, 5]} for i in range(8)] <del> batch = default_data_collator(features) <del> self.assertTrue("labels" not in batch) <del> self.assertEqual(batch["inputs"].shape, torch.Size([8, 6])) <del> <del> def test_default_classification(self): <del> MODEL_ID = "bert-base-cased-finetuned-mrpc" <del> tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) <del> data_args = GlueDataTrainingArguments( <del> task_name="mrpc", data_dir="./tests/fixtures/tests_samples/MRPC", overwrite_cache=True <del> ) <del> dataset = GlueDataset(data_args, tokenizer=tokenizer, mode="dev") <del> data_collator = default_data_collator <del> batch = data_collator(dataset.features) <del> self.assertEqual(batch["labels"].dtype, torch.long) <add>class RegressionDataset: <add> def __init__(self, a=2, b=3, length=64, seed=42): <add> np.random.seed(seed) <add> self.length = length <add> self.x = np.random.normal(size=(length,)).astype(np.float32) <add> self.y = a * self.x + b + np.random.normal(scale=0.1, size=(length,)) <ide> <del> def test_default_regression(self): <del> MODEL_ID = "distilroberta-base" <del> tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) <del> data_args = GlueDataTrainingArguments( <del> task_name="sts-b", data_dir="./tests/fixtures/tests_samples/STS-B", overwrite_cache=True <del> ) <del> dataset = GlueDataset(data_args, tokenizer=tokenizer, mode="dev") <del> data_collator = default_data_collator <del> batch = data_collator(dataset.features) <del> self.assertEqual(batch["labels"].dtype, torch.float) <del> <del> def test_lm_tokenizer_without_padding(self): <del> tokenizer = AutoTokenizer.from_pretrained("gpt2") <del> data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=False) <del> # ^ causal lm <del> <del> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <del> examples = [dataset[i] for i in range(len(dataset))] <del> with self.assertRaises(ValueError): <del> # Expect error due to padding token missing on gpt2: <del> data_collator(examples) <del> <del> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <del> examples = [dataset[i] for i in range(len(dataset))] <del> batch = data_collator(examples) <del> self.assertIsInstance(batch, dict) <del> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <del> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <del> <del> def test_lm_tokenizer_with_padding(self): <del> tokenizer = AutoTokenizer.from_pretrained("distilroberta-base") <del> data_collator = DataCollatorForLanguageModeling(tokenizer) <del> # ^ masked lm <del> <del> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <del> examples = [dataset[i] for i in range(len(dataset))] <del> batch = data_collator(examples) <del> self.assertIsInstance(batch, dict) <del> self.assertEqual(batch["input_ids"].shape, torch.Size((31, 107))) <del> self.assertEqual(batch["labels"].shape, torch.Size((31, 107))) <del> <del> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <del> examples = [dataset[i] for i in range(len(dataset))] <del> batch = data_collator(examples) <del> self.assertIsInstance(batch, dict) <del> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <del> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <del> <del> def test_plm(self): <del> tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased") <del> data_collator = DataCollatorForPermutationLanguageModeling(tokenizer) <del> # ^ permutation lm <del> <del> dataset = LineByLineTextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512) <del> examples = [dataset[i] for i in range(len(dataset))] <del> batch = data_collator(examples) <del> self.assertIsInstance(batch, dict) <del> self.assertEqual(batch["input_ids"].shape, torch.Size((31, 112))) <del> self.assertEqual(batch["perm_mask"].shape, torch.Size((31, 112, 112))) <del> self.assertEqual(batch["target_mapping"].shape, torch.Size((31, 112, 112))) <del> self.assertEqual(batch["labels"].shape, torch.Size((31, 112))) <del> <del> dataset = TextDataset(tokenizer, file_path=PATH_SAMPLE_TEXT, block_size=512, overwrite_cache=True) <del> examples = [dataset[i] for i in range(len(dataset))] <del> batch = data_collator(examples) <del> self.assertIsInstance(batch, dict) <del> self.assertEqual(batch["input_ids"].shape, torch.Size((2, 512))) <del> self.assertEqual(batch["perm_mask"].shape, torch.Size((2, 512, 512))) <del> self.assertEqual(batch["target_mapping"].shape, torch.Size((2, 512, 512))) <del> self.assertEqual(batch["labels"].shape, torch.Size((2, 512))) <del> <del> example = [torch.randint(5, [5])] <del> with self.assertRaises(ValueError): <del> # Expect error due to odd sequence length <del> data_collator(example) <add> def __len__(self): <add> return self.length <add> <add> def __getitem__(self, i): <add> return {"input_x": self.x[i], "label": self.y[i]} <add> <add> <add>class AlmostAccuracy: <add> def __init__(self, thresh=0.25): <add> self.thresh = thresh <add> <add> def __call__(self, eval_pred): <add> predictions, labels = eval_pred <add> true = np.abs(predictions - labels) <= self.thresh <add> return {"accuracy": true.astype(np.float32).mean().item()} <ide> <ide> <ide> if is_torch_available(): <ide> def parse_file(self): <ide> def __iter__(self): <ide> return iter(self.parse_file()) <ide> <add> class RegressionModel(torch.nn.Module): <add> def __init__(self, a=0, b=0): <add> super().__init__() <add> self.a = torch.nn.Parameter(torch.tensor(a).float()) <add> self.b = torch.nn.Parameter(torch.tensor(b).float()) <add> <add> def forward(self, input_x=None, labels=None): <add> y = input_x * self.a + self.b <add> if labels is None: <add> return (y,) <add> loss = torch.nn.functional.mse_loss(y, labels) <add> return (loss, y) <add> <add> def get_regression_trainer(a=0, b=0, train_len=64, eval_len=64, **kwargs): <add> train_dataset = RegressionDataset(length=train_len) <add> eval_dataset = RegressionDataset(length=eval_len) <add> model = RegressionModel(a, b) <add> compute_metrics = kwargs.pop("compute_metrics", None) <add> data_collator = kwargs.pop("data_collator", None) <add> optimizers = kwargs.pop("optimizers", (None, None)) <add> args = TrainingArguments("./regression", **kwargs) <add> return Trainer( <add> model, <add> args, <add> data_collator=data_collator, <add> train_dataset=train_dataset, <add> eval_dataset=eval_dataset, <add> compute_metrics=compute_metrics, <add> optimizers=optimizers, <add> ) <add> <ide> <ide> @require_torch <ide> class TrainerIntegrationTest(unittest.TestCase): <add> def setUp(self): <add> # Get the default values (in case they change): <add> args = TrainingArguments(".") <add> self.n_epochs = args.num_train_epochs <add> self.batch_size = args.per_device_train_batch_size <add> <add> def test_reproducible_training(self): <add> # Checks that training worked, model trained and seed made a reproducible training. <add> trainer = get_regression_trainer(learning_rate=0.1) <add> trainer.train() <add> self.assertTrue(torch.abs(trainer.model.a - 0.6975) < 1e-4) <add> self.assertTrue(torch.abs(trainer.model.b - 1.2415) < 1e-4) <add> <add> # Checks that a different seed gets different (reproducible) results. <add> trainer = get_regression_trainer(learning_rate=0.1, seed=314) <add> trainer.train() <add> self.assertTrue(torch.abs(trainer.model.a - 1.0171) < 1e-4) <add> self.assertTrue(torch.abs(trainer.model.b - 1.2494) < 1e-4) <add> <add> def test_number_of_steps_in_training(self): <add> # Regular training has n_epochs * len(train_dl) steps <add> trainer = get_regression_trainer(learning_rate=0.1) <add> train_output = trainer.train() <add> self.assertEqual(train_output.global_step, self.n_epochs * 64 / self.batch_size) <add> <add> # Check passing num_train_epochs works (and a float version too): <add> trainer = get_regression_trainer(learning_rate=0.1, num_train_epochs=1.5) <add> train_output = trainer.train() <add> self.assertEqual(train_output.global_step, int(1.5 * 64 / self.batch_size)) <add> <add> # If we pass a max_steps, num_train_epochs is ignored <add> trainer = get_regression_trainer(learning_rate=0.1, max_steps=10) <add> train_output = trainer.train() <add> self.assertEqual(train_output.global_step, 10) <add> <add> def test_train_and_eval_dataloaders(self): <add> trainer = get_regression_trainer(learning_rate=0.1, per_device_train_batch_size=16) <add> self.assertEqual(trainer.get_train_dataloader().batch_size, 16) <add> trainer = get_regression_trainer(learning_rate=0.1, per_device_eval_batch_size=16) <add> self.assertEqual(trainer.get_eval_dataloader().batch_size, 16) <add> <add> # Check drop_last works <add> trainer = get_regression_trainer( <add> train_len=66, eval_len=74, learning_rate=0.1, per_device_train_batch_size=16, per_device_eval_batch_size=32 <add> ) <add> self.assertEqual(len(trainer.get_train_dataloader()), 66 // 16 + 1) <add> self.assertEqual(len(trainer.get_eval_dataloader()), 74 // 32 + 1) <add> <add> trainer = get_regression_trainer( <add> train_len=66, <add> eval_len=74, <add> learning_rate=0.1, <add> per_device_train_batch_size=16, <add> per_device_eval_batch_size=32, <add> dataloader_drop_last=True, <add> ) <add> self.assertEqual(len(trainer.get_train_dataloader()), 66 // 16) <add> self.assertEqual(len(trainer.get_eval_dataloader()), 74 // 32) <add> <add> # Check passing a new dataset fpr evaluation wors <add> new_eval_dataset = RegressionDataset(length=128) <add> self.assertEqual(len(trainer.get_eval_dataloader(new_eval_dataset)), 128 // 32) <add> <add> def test_evaluate(self): <add> trainer = get_regression_trainer(a=1.5, b=2.5, compute_metrics=AlmostAccuracy()) <add> results = trainer.evaluate() <add> <add> x, y = trainer.eval_dataset.x, trainer.eval_dataset.y <add> pred = 1.5 * x + 2.5 <add> expected_loss = ((pred - y) ** 2).mean() <add> self.assertAlmostEqual(results["eval_loss"], expected_loss) <add> expected_acc = AlmostAccuracy()((pred, y))["accuracy"] <add> self.assertAlmostEqual(results["eval_accuracy"], expected_acc) <add> <add> # With a number of elements not a round multiple of the batch size <add> trainer = get_regression_trainer(a=1.5, b=2.5, eval_len=66, compute_metrics=AlmostAccuracy()) <add> results = trainer.evaluate() <add> <add> x, y = trainer.eval_dataset.x, trainer.eval_dataset.y <add> pred = 1.5 * x + 2.5 <add> expected_loss = ((pred - y) ** 2).mean() <add> self.assertAlmostEqual(results["eval_loss"], expected_loss) <add> expected_acc = AlmostAccuracy()((pred, y))["accuracy"] <add> self.assertAlmostEqual(results["eval_accuracy"], expected_acc) <add> <add> def test_predict(self): <add> trainer = get_regression_trainer(a=1.5, b=2.5) <add> preds = trainer.predict(trainer.eval_dataset).predictions <add> x = trainer.eval_dataset.x <add> self.assertTrue(np.allclose(preds, 1.5 * x + 2.5)) <add> <add> # With a number of elements not a round multiple of the batch size <add> trainer = get_regression_trainer(a=1.5, b=2.5, eval_len=66) <add> preds = trainer.predict(trainer.eval_dataset).predictions <add> x = trainer.eval_dataset.x <add> self.assertTrue(np.allclose(preds, 1.5 * x + 2.5)) <add> <ide> def test_trainer_eval_mrpc(self): <ide> MODEL_ID = "bert-base-cased-finetuned-mrpc" <ide> tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) <ide><path>tests/test_trainer_distributed.py <ide> def forward(self, input_ids, labels=None): <ide> <ide> if __name__ == "__main__": <ide> parser = HfArgumentParser((TrainingArguments,)) <del> training_args = parser.parse_args_into_dataclasses(sys.argv + ["--output_dir", "./examples"])[0] <add> sys.argv += ["--output_dir", "./examples"] <add> training_args = parser.parse_args_into_dataclasses()[0] <ide> <ide> logger.warning( <ide> "Process rank: %s, device: %s, n_gpu: %s, distributed training: %s",
6
Go
Go
add cache-from support to buildkit
46bd229b5168e3d00e524e24c13545c718e3144f
<ide><path>builder/builder-next/builder.go <ide> import ( <ide> "github.com/docker/docker/pkg/jsonmessage" <ide> controlapi "github.com/moby/buildkit/api/services/control" <ide> "github.com/moby/buildkit/cache" <add> "github.com/moby/buildkit/cache/cacheimport" <ide> "github.com/moby/buildkit/cache/metadata" <ide> "github.com/moby/buildkit/control" <ide> "github.com/moby/buildkit/executor/runcexecutor" <ide> func (b *Builder) Build(ctx context.Context, opt backend.BuildConfig) (*builder. <ide> frontendAttrs["context"] = opt.Options.RemoteContext <ide> } <ide> <add> if len(opt.Options.CacheFrom) > 0 { <add> frontendAttrs["cache-from"] = opt.Options.CacheFrom[0] <add> } <add> <ide> logrus.Debugf("frontend: %+v", frontendAttrs) <ide> <ide> for k, v := range opt.Options.BuildArgs { <ide> func newController(opt Opt, reporter chan containerimageexp.Result) (*control.Co <ide> ContentStore: store, <ide> DownloadManager: dist.DownloadManager, <ide> MetadataStore: dist.V2MetadataService, <add> ImageStore: dist.ImageStore, <add> ReferenceStore: dist.ReferenceStore, <ide> }) <ide> if err != nil { <ide> return nil, err <ide> func newController(opt Opt, reporter chan containerimageexp.Result) (*control.Co <ide> // } <ide> <ide> wopt := mobyworker.WorkerOpt{ <del> ID: "moby", <del> SessionManager: opt.SessionManager, <del> MetadataStore: md, <del> ContentStore: store, <del> CacheManager: cm, <del> Snapshotter: snapshotter, <del> Executor: exec, <del> ImageSource: src, <add> ID: "moby", <add> SessionManager: opt.SessionManager, <add> MetadataStore: md, <add> ContentStore: store, <add> CacheManager: cm, <add> Snapshotter: snapshotter, <add> Executor: exec, <add> ImageSource: src, <add> DownloadManager: dist.DownloadManager, <add> V2MetadataService: dist.V2MetadataService, <ide> Exporters: map[string]exporter.Exporter{ <ide> "image": exp, <ide> }, <ide> func newController(opt Opt, reporter chan containerimageexp.Result) (*control.Co <ide> } <ide> wc.Add(w) <ide> <add> ci := cacheimport.NewCacheImporter(cacheimport.ImportOpt{ <add> Worker: w, <add> SessionManager: opt.SessionManager, <add> }) <add> <ide> return control.NewController(control.Opt{ <ide> SessionManager: opt.SessionManager, <ide> WorkerController: wc, <ide> Frontends: frontends, <ide> CacheKeyStorage: cacheStorage, <ide> // CacheExporter: ce, <del> // CacheImporter: ci, <add> CacheImporter: ci, <ide> }) <ide> } <ide> <ide><path>builder/builder-next/containerimage/pull.go <ide> import ( <ide> "github.com/containerd/containerd/remotes" <ide> "github.com/containerd/containerd/remotes/docker" <ide> "github.com/containerd/containerd/remotes/docker/schema1" <add> distreference "github.com/docker/distribution/reference" <ide> "github.com/docker/docker/distribution" <ide> "github.com/docker/docker/distribution/metadata" <ide> "github.com/docker/docker/distribution/xfer" <ide> import ( <ide> "golang.org/x/time/rate" <ide> ) <ide> <add>const preferLocal = true // FIXME: make this optional from the op <add> <ide> type SourceOpt struct { <ide> SessionManager *session.Manager <ide> ContentStore content.Store <ide> CacheAccessor cache.Accessor <ide> ReferenceStore reference.Store <ide> DownloadManager distribution.RootFSDownloadManager <ide> MetadataStore metadata.V2MetadataService <add> ImageStore image.Store <ide> } <ide> <ide> type imageSource struct { <ide> func (is *imageSource) getCredentialsFromSession(ctx context.Context) func(strin <ide> } <ide> } <ide> <add>func (is *imageSource) resolveLocal(refStr string) ([]byte, error) { <add> ref, err := distreference.ParseNormalizedNamed(refStr) <add> if err != nil { <add> return nil, err <add> } <add> dgst, err := is.ReferenceStore.Get(ref) <add> if err != nil { <add> return nil, err <add> } <add> img, err := is.ImageStore.Get(image.ID(dgst)) <add> if err != nil { <add> return nil, err <add> } <add> return img.RawJSON(), nil <add>} <add> <ide> func (is *imageSource) ResolveImageConfig(ctx context.Context, ref string) (digest.Digest, []byte, error) { <add> if preferLocal { <add> dt, err := is.resolveLocal(ref) <add> if err == nil { <add> return "", dt, nil <add> } <add> } <add> <ide> type t struct { <ide> dgst digest.Digest <ide> dt []byte <ide> type puller struct { <ide> ref string <ide> resolveErr error <ide> resolver remotes.Resolver <add> imageID image.ID <add> cacheKey digest.Digest <ide> } <ide> <ide> func (p *puller) resolve(ctx context.Context) error { <ide> p.resolveOnce.Do(func() { <ide> resolveProgressDone := oneOffProgress(ctx, "resolve "+p.src.Reference.String()) <ide> <del> dgst := p.src.Reference.Digest() <del> if dgst != "" { <del> info, err := p.is.ContentStore.Info(ctx, dgst) <add> // dgst := p.src.Reference.Digest() <add> // if dgst != "" { <add> // info, err := p.is.ContentStore.Info(ctx, dgst) <add> // if err == nil { <add> // p.ref = p.src.Reference.String() <add> // ra, err := p.is.ContentStore.ReaderAt(ctx, dgst) <add> // if err == nil { <add> // mt, err := imageutil.DetectManifestMediaType(ra) <add> // if err == nil { <add> // p.desc = ocispec.Descriptor{ <add> // Size: info.Size, <add> // Digest: dgst, <add> // MediaType: mt, <add> // } <add> // resolveProgressDone(nil) <add> // return <add> // } <add> // } <add> // } <add> // } <add> <add> // ref, desc, err := p.resolver.Resolve(ctx, p.src.Reference.String()) <add> // if err != nil { <add> // p.resolveErr = err <add> // resolveProgressDone(err) <add> // return <add> // } <add> <add> if preferLocal { <add> dt, err := p.is.resolveLocal(p.src.Reference.String()) <ide> if err == nil { <del> p.ref = p.src.Reference.String() <del> ra, err := p.is.ContentStore.ReaderAt(ctx, dgst) <del> if err == nil { <del> mt, err := imageutil.DetectManifestMediaType(ra) <del> if err == nil { <del> p.desc = ocispec.Descriptor{ <del> Size: info.Size, <del> Digest: dgst, <del> MediaType: mt, <del> } <del> resolveProgressDone(nil) <del> return <del> } <del> } <add> dgst := digest.FromBytes(dt) <add> p.imageID = image.ID(dgst) <add> p.cacheKey = dgst <add> resolveProgressDone(nil) <add> return <ide> } <add> <add> } <add> <add> ref, err := distreference.ParseNormalizedNamed(p.src.Reference.String()) <add> if err != nil { <add> p.resolveErr = err <add> resolveProgressDone(err) <add> return <add> } <add> <add> outRef, desc, err := p.resolver.Resolve(ctx, p.src.Reference.String()) <add> if err != nil { <add> p.resolveErr = err <add> resolveProgressDone(err) <add> return <add> } <add> <add> ref, err = distreference.WithDigest(ref, desc.Digest) <add> if err != nil { <add> p.resolveErr = err <add> resolveProgressDone(err) <add> return <ide> } <ide> <del> ref, desc, err := p.resolver.Resolve(ctx, p.src.Reference.String()) <add> _, dt, err := p.is.ResolveImageConfig(ctx, ref.String()) <ide> if err != nil { <ide> p.resolveErr = err <ide> resolveProgressDone(err) <ide> return <ide> } <ide> p.desc = desc <del> p.ref = ref <add> p.cacheKey = digest.FromBytes(dt) <add> p.ref = outRef <ide> resolveProgressDone(nil) <ide> }) <ide> return p.resolveErr <ide> func (p *puller) CacheKey(ctx context.Context) (string, error) { <ide> if err := p.resolve(ctx); err != nil { <ide> return "", err <ide> } <del> return p.desc.Digest.String(), nil <add> return p.cacheKey.String(), nil <ide> } <ide> <ide> func (p *puller) Snapshot(ctx context.Context) (cache.ImmutableRef, error) { <ide> if err := p.resolve(ctx); err != nil { <ide> return nil, err <ide> } <ide> <add> if p.imageID != "" { <add> img, err := p.is.ImageStore.Get(p.imageID) <add> if err != nil { <add> return nil, err <add> } <add> ref, err := p.is.CacheAccessor.Get(ctx, string(img.RootFS.ChainID()), cache.WithDescription(fmt.Sprintf("from local %s", p.ref))) <add> if err != nil { <add> return nil, err <add> } <add> return ref, nil <add> } <add> <ide> ongoing := newJobs(p.ref) <ide> <ide> pctx, stopProgress := context.WithCancel(ctx) <ide> func (ld *layerDescriptor) Download(ctx netcontext.Context, progressOutput pkgpr <ide> } <ide> <ide> func (ld *layerDescriptor) Close() { <del> ld.is.ContentStore.Delete(context.TODO(), ld.desc.Digest) <add> // ld.is.ContentStore.Delete(context.TODO(), ld.desc.Digest)) <ide> } <ide> <ide> func (ld *layerDescriptor) Registered(diffID layer.DiffID) { <ide><path>builder/builder-next/worker/worker.go <ide> package worker <ide> <ide> import ( <ide> "context" <add> "fmt" <ide> "io" <add> "io/ioutil" <add> "runtime" <ide> "time" <ide> <ide> "github.com/containerd/containerd/content" <ide> "github.com/containerd/containerd/rootfs" <add> "github.com/docker/docker/distribution" <add> distmetadata "github.com/docker/docker/distribution/metadata" <add> "github.com/docker/docker/distribution/xfer" <add> "github.com/docker/docker/image" <add> "github.com/docker/docker/layer" <add> pkgprogress "github.com/docker/docker/pkg/progress" <ide> "github.com/moby/buildkit/cache" <ide> "github.com/moby/buildkit/cache/metadata" <ide> "github.com/moby/buildkit/client" <ide> import ( <ide> "github.com/moby/buildkit/source/git" <ide> "github.com/moby/buildkit/source/http" <ide> "github.com/moby/buildkit/source/local" <add> "github.com/moby/buildkit/util/contentutil" <ide> "github.com/moby/buildkit/util/progress" <ide> digest "github.com/opencontainers/go-digest" <ide> ocispec "github.com/opencontainers/image-spec/specs-go/v1" <ide> "github.com/pkg/errors" <add> netcontext "golang.org/x/net/context" <ide> ) <ide> <ide> // TODO: this file should be removed. containerd defines ContainerdWorker, oci defines OCIWorker. There is no base worker. <ide> <ide> // WorkerOpt is specific to a worker. <ide> // See also CommonOpt. <ide> type WorkerOpt struct { <del> ID string <del> Labels map[string]string <del> SessionManager *session.Manager <del> MetadataStore *metadata.Store <del> Executor executor.Executor <del> Snapshotter snapshot.Snapshotter <del> ContentStore content.Store <del> CacheManager cache.Manager <del> ImageSource source.Source <del> Exporters map[string]exporter.Exporter <add> ID string <add> Labels map[string]string <add> SessionManager *session.Manager <add> MetadataStore *metadata.Store <add> Executor executor.Executor <add> Snapshotter snapshot.Snapshotter <add> ContentStore content.Store <add> CacheManager cache.Manager <add> ImageSource source.Source <add> Exporters map[string]exporter.Exporter <add> DownloadManager distribution.RootFSDownloadManager <add> V2MetadataService distmetadata.V2MetadataService <ide> // ImageStore images.Store // optional <ide> } <ide> <ide> func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef) (*solver <ide> } <ide> <ide> func (w *Worker) FromRemote(ctx context.Context, remote *solver.Remote) (cache.ImmutableRef, error) { <add> rootfs, err := getLayers(ctx, remote.Descriptors) <add> if err != nil { <add> return nil, err <add> } <add> <add> layers := make([]xfer.DownloadDescriptor, 0, len(rootfs)) <add> <add> for _, l := range rootfs { <add> // ongoing.add(desc) <add> layers = append(layers, &layerDescriptor{ <add> desc: l.Blob, <add> diffID: layer.DiffID(l.Diff.Digest), <add> provider: remote.Provider, <add> w: w, <add> pctx: ctx, <add> // ref: l.Blob.Digest.String(), <add> }) <add> } <add> <add> defer func() { <add> for _, l := range rootfs { <add> w.ContentStore.Delete(context.TODO(), l.Blob.Digest) <add> } <add> }() <add> <add> r := image.NewRootFS() <add> rootFS, release, err := w.DownloadManager.Download(ctx, *r, runtime.GOOS, layers, &discardProgress{}) <add> if err != nil { <add> return nil, err <add> } <add> defer release() <add> <add> ref, err := w.CacheManager.Get(ctx, string(rootFS.ChainID()), cache.WithDescription(fmt.Sprintf("imported %s", remote.Descriptors[len(remote.Descriptors)-1].Digest))) <add> if err != nil { <add> return nil, err <add> } <add> <ide> // eg, gctx := errgroup.WithContext(ctx) <ide> // for _, desc := range remote.Descriptors { <ide> // func(desc ocispec.Descriptor) { <ide> func (w *Worker) FromRemote(ctx context.Context, remote *solver.Remote) (cache.I <ide> // unpackProgressDone(nil) <ide> // <ide> // return w.CacheManager.Get(ctx, chainID, cache.WithDescription(fmt.Sprintf("imported %s", remote.Descriptors[len(remote.Descriptors)-1].Digest))) <del> return nil, errors.Errorf("fromremote not implemented") <add> // return nil, errors.Errorf("fromremote not implemented") <add> return ref, nil <ide> } <ide> <ide> // utility function. could be moved to the constructor logic? <ide> func (w *Worker) FromRemote(ctx context.Context, remote *solver.Remote) (cache.I <ide> // return string(b), nil <ide> // } <ide> <add>type discardProgress struct{} <add> <add>func (_ *discardProgress) WriteProgress(_ pkgprogress.Progress) error { <add> return nil <add>} <add> <add>// Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) <add>type layerDescriptor struct { <add> provider content.Provider <add> desc ocispec.Descriptor <add> diffID layer.DiffID <add> // ref ctdreference.Spec <add> w *Worker <add> pctx context.Context <add>} <add> <add>func (ld *layerDescriptor) Key() string { <add> return "v2:" + ld.desc.Digest.String() <add>} <add> <add>func (ld *layerDescriptor) ID() string { <add> return ld.desc.Digest.String() <add>} <add> <add>func (ld *layerDescriptor) DiffID() (layer.DiffID, error) { <add> return ld.diffID, nil <add>} <add> <add>func (ld *layerDescriptor) Download(ctx netcontext.Context, progressOutput pkgprogress.Output) (io.ReadCloser, int64, error) { <add> done := oneOffProgress(ld.pctx, fmt.Sprintf("pulling %s", ld.desc.Digest)) <add> if err := contentutil.Copy(ctx, ld.w.ContentStore, ld.provider, ld.desc); err != nil { <add> return nil, 0, done(err) <add> } <add> done(nil) <add> <add> ra, err := ld.w.ContentStore.ReaderAt(ctx, ld.desc.Digest) <add> if err != nil { <add> return nil, 0, err <add> } <add> <add> return ioutil.NopCloser(content.NewReader(ra)), ld.desc.Size, nil <add>} <add> <add>func (ld *layerDescriptor) Close() { <add> // ld.is.ContentStore.Delete(context.TODO(), ld.desc.Digest) <add>} <add> <add>func (ld *layerDescriptor) Registered(diffID layer.DiffID) { <add> // Cache mapping from this layer's DiffID to the blobsum <add> ld.w.V2MetadataService.Add(diffID, distmetadata.V2Metadata{Digest: ld.desc.Digest}) <add>} <add> <ide> func getLayers(ctx context.Context, descs []ocispec.Descriptor) ([]rootfs.Layer, error) { <ide> layers := make([]rootfs.Layer, len(descs)) <ide> for i, desc := range descs {
3
PHP
PHP
consolidate doc block headings
5e996cd4b90fd31dd71c12a3be04e4c851b8c6ae
<ide><path>src/Collection/CollectionInterface.php <ide> public function each(callable $c); <ide> * in the current iteration, the key of the element and this collection as <ide> * arguments, in that order. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * Filtering odd numbers in an array, at the end only the value 2 will <ide> * be present in the resulting collection: <ide> public function filter(callable $c = null); <ide> * in the current iteration, the key of the element and this collection as <ide> * arguments, in that order. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * Filtering even numbers in an array, at the end only values 1 and 3 will <ide> * be present in the resulting collection: <ide> public function contains($value); <ide> * in the current iteration, the key of the element and this collection as <ide> * arguments, in that order. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * Getting a collection of booleans where true indicates if a person is female: <ide> * <ide><path>src/Collection/Iterator/MapReduce.php <ide> class MapReduce implements IteratorAggregate { <ide> /** <ide> * Constructor <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * Separate all unique odd and even numbers in an array <ide> * <ide><path>src/Collection/Iterator/TreeIterator.php <ide> public function __construct(RecursiveIterator $items, $mode = RecursiveIteratorI <ide> * the current element as first parameter, the current iteration key as second <ide> * parameter, and the iterator instance as third argument. <ide> * <del> * ## Example <add> * ### Example <ide> * <ide> * {{{ <ide> * $printer = (new Collection($treeStructure))->listNested()->printer('name'); <ide><path>src/Controller/Component.php <ide> * controller logic that can be composed into a controller. Components also <ide> * provide request life-cycle callbacks for injecting logic at specific points. <ide> * <del> * ## Initialize hook <add> * ### Initialize hook <ide> * <ide> * Like Controller and Table, this class has an initialize() hook that you can use <ide> * to add custom 'constructor' logic. It is important to remember that each request <ide> * (and sub-request) will only make one instance of any given component. <ide> * <del> * ## Life cycle callbacks <add> * ### Life cycle callbacks <ide> * <ide> * Components can provide several callbacks that are fired at various stages of the request <ide> * cycle. The available callbacks are: <ide><path>src/Controller/Component/PaginatorComponent.php <ide> public function implementedEvents() { <ide> /** <ide> * Handles automatic pagination of model records. <ide> * <del> * ## Configuring pagination <add> * ### Configuring pagination <ide> * <ide> * When calling `paginate()` you can use the $settings parameter to pass in pagination settings. <ide> * These settings are used to build the queries made and control other pagination settings. <ide><path>src/Core/Configure.php <ide> public static function load($key, $config = 'default', $merge = true) { <ide> * 'default' adapter is a PhpConfig, the generated file will be a PHP <ide> * configuration file loadable by the PhpConfig. <ide> * <del> * ## Usage <add> * ### Usage <ide> * <ide> * Given that the 'default' engine is an instance of PhpConfig. <ide> * Save all data in Configure to the file `my_config.php`: <ide><path>src/Core/Plugin.php <ide> class Plugin { <ide> * This method does not configure any autoloaders. That must be done separately either <ide> * through composer, or your own code during config/bootstrap.php. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * `Plugin::load('DebugKit')` <ide> * <ide> class Plugin { <ide> * <ide> * Will only load the bootstrap for ApiGenerator and only the routes for DebugKit <ide> * <del> * ## Configuration options <add> * ### Configuration options <ide> * <ide> * - `bootstrap` - array - Whether or not you want the $plugin/config/bootstrap.php file loaded. <ide> * - `routes` - boolean - Whether or not you want to load the $plugin/config/routes.php file. <ide><path>src/Database/Connection.php <ide> public function rollback() { <ide> * If you are trying to enable this feature, make sure you check the return value of this <ide> * function to verify it was enabled successfully. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * `$connection->useSavePoints(true)` Returns true if drivers supports save points, false otherwise <ide> * `$connection->useSavePoints(false)` Disables usage of savepoints and returns false <ide><path>src/Database/Expression/FunctionExpression.php <ide> class FunctionExpression extends QueryExpression { <ide> * By default, all params that are passed will be quoted. If you wish to use <ide> * literal arguments, you need to explicitly hint this function. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * ``$f = new FunctionExpression('CONCAT', ['CakePHP', ' rules']);`` <ide> * <ide><path>src/Database/Query.php <ide> public function sql(ValueBinder $generator = null) { <ide> * The callback will receive 2 parameters, the first one is the value of the query <ide> * part that is being iterated and the second the name of such part. <ide> * <del> * ## Example: <add> * ### Example: <ide> * {{{ <ide> * $query->select(['title'])->from('articles')->traverse(function ($value, $clause) { <ide> * if ($clause === 'select') { <ide> public function traverse(callable $visitor, array $parts = []) { <ide> * By default this function will append any passed argument to the list of fields <ide> * to be selected, unless the second argument is set to true. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $query->select(['id', 'title']); // Produces SELECT id, title <ide> public function select($fields = [], $overwrite = false) { <ide> * or set of fields, you may pass an array of fields to filter on. Beware that <ide> * this option might not be fully supported in all database systems. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * // Filters products with the same name and city <ide> public function modifier($modifiers, $overwrite = false) { <ide> * <ide> * This method can be used for select, update and delete statements. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $query->from(['p' => 'posts']); // Produces FROM posts p <ide> public function from($tables = [], $overwrite = false) { <ide> * // INNER JOIN products p (a.owner_id = p.id) <ide> * }}} <ide> * <del> * ## Using conditions and types <add> * ### Using conditions and types <ide> * <ide> * Conditions can be expressed, as in the examples above, using a string for comparing <ide> * columns, or string with already quoted literal values. Additionally it is <ide> public function from($tables = [], $overwrite = false) { <ide> * ]], ['a.posted' => 'datetime', 'a.published' => 'boolean']) <ide> * }}} <ide> * <del> * ## Overwriting joins <add> * ### Overwriting joins <ide> * <ide> * When creating aliased joins using the array notation, you can override <ide> * previous join definitions by using the same alias in consequent <ide> protected function _makeJoin($table, $conditions, $type) { <ide> * Any conditions created with this methods can be used with any SELECT, UPDATE <ide> * and DELETE type of queries. <ide> * <del> * ## Conditions using operators: <add> * ### Conditions using operators: <ide> * <ide> * {{{ <ide> * $query->where([ <ide> protected function _makeJoin($table, $conditions, $type) { <ide> * Second parameter is used to specify what type is expected for each passed <ide> * key. Valid types can be used from the mapped with Database\Type class. <ide> * <del> * ## Nesting conditions with conjunctions: <add> * ### Nesting conditions with conjunctions: <ide> * <ide> * {{{ <ide> * $query->where([ <ide> protected function _makeJoin($table, $conditions, $type) { <ide> * the AND operator. Also, using the same array key twice in consecutive calls to <ide> * this method will not override the previous value. <ide> * <del> * ## Using expressions objects: <add> * ### Using expressions objects: <ide> * <ide> * {{{ <ide> * $exp = $query->newExpr()->add(['id !=' => 100, 'author_id' != 1])->type('OR'); <ide> protected function _makeJoin($table, $conditions, $type) { <ide> * <ide> * Other Query objects that be used as conditions for any field. <ide> * <del> * ## Adding conditions in multiple steps: <add> * ### Adding conditions in multiple steps: <ide> * <ide> * You can use callable functions to construct complex expressions, functions <ide> * receive as first argument a new QueryExpression object and this query instance <ide> protected function _makeJoin($table, $conditions, $type) { <ide> * <ide> * ``WHERE title != 'Hello World' AND (id = 1 OR (id > 2 AND id < 10))`` <ide> * <del> * ## Conditions as strings: <add> * ### Conditions as strings: <ide> * <ide> * {{{ <ide> * $query->where(['articles.author_id = authors.id', 'modified IS NULL']); <ide> public function where($conditions = null, $types = [], $overwrite = false) { <ide> * that each array entry will be joined to the other using the AND operator, unless <ide> * you nest the conditions in the array using other operator. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $query->where(['title' => 'Hello World')->andWhere(['author_id' => 1]); <ide> public function andWhere($conditions, $types = []) { <ide> * that each array entry will be joined to the other using the OR operator, unless <ide> * you nest the conditions in the array using other operator. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $query->where(['title' => 'Hello World')->orWhere(['title' => 'Foo']); <ide> public function orWhere($conditions, $types = []) { <ide> * By default this function will append any passed argument to the list of fields <ide> * to be selected, unless the second argument is set to true. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $query->order(['title' => 'DESC', 'author_id' => 'ASC']); <ide> public function order($fields, $overwrite = false) { <ide> * By default this function will append any passed argument to the list of fields <ide> * to be grouped, unless the second argument is set to true. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * // Produces GROUP BY id, title <ide> public function page($num, $limit = null) { <ide> * In some databases, this operation might not be supported or will require <ide> * the query to be transformed in order to limit the result set size. <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * {{{ <ide> * $query->limit(10) // generates LIMIT 10 <ide> public function limit($num) { <ide> * In some databases, this operation might not be supported or will require <ide> * the query to be transformed in order to limit the result set size. <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * {{{ <ide> * $query->offset(10) // generates OFFSET 10 <ide> public function offset($num) { <ide> * By default, the UNION operator will remove duplicate rows, if you wish to include <ide> * every row for all queries, use unionAll(). <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * {{{ <ide> * $union = (new Query($conn))->select(['id', 'title'])->from(['a' => 'articles']); <ide> public function clause($name) { <ide> * If you wish to remove all decorators from the stack, set the first parameter <ide> * to null and the second to true. <ide> * <del> * ## Example <add> * ### Example <ide> * <ide> * {{{ <ide> * $query->decorateResults(function ($row) { <ide><path>src/Database/Statement/PDOStatement.php <ide> public function __construct(Statement $statement = null, $driver = null) { <ide> * <ide> * It is not allowed to combine positional and named variables in the same statement <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $statement->bindValue(1, 'a title'); <ide> public function bindValue($column, $value, $type = 'string') { <ide> * Rows can be fetched to contain columns as names or positions. If no <ide> * rows are left in result set, this method will return false <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function fetch($type = 'num') { <ide> /** <ide> * Returns an array with all rows resulting from executing this statement <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide><path>src/Database/Statement/StatementDecorator.php <ide> public function __get($property) { <ide> * <ide> * It is not allowed to combine positional and named variables in the same statement. <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * {{{ <ide> * $statement->bindValue(1, 'a title'); <ide> public function closeCursor() { <ide> /** <ide> * Returns the number of columns this statement's results will contain. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function execute($params = null) { <ide> * Rows can be fetched to contain columns as names or positions. If no <ide> * rows are left in result set, this method will return false. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function fetch($type = 'num') { <ide> /** <ide> * Returns an array with all rows resulting from executing this statement. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function fetchAll($type = 'num') { <ide> /** <ide> * Returns the number of rows affected by this SQL statement. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function rowCount() { <ide> * Statements are iterable as arrays, this method will return <ide> * the iterator object for traversing all items in the result. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide><path>src/Database/StatementInterface.php <ide> interface StatementInterface { <ide> * <ide> * It is not allowed to combine positional and named variables in the same statement <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * `$statement->bindValue(1, 'a title');` <ide> * `$statement->bindValue('active', true, 'boolean');` <ide> public function closeCursor(); <ide> /** <ide> * Returns the number of columns this statement's results will contain <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function execute($params = null); <ide> * Rows can be fetched to contain columns as names or positions. If no <ide> * rows are left in result set, this method will return false <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function fetch($type = 'num'); <ide> /** <ide> * Returns an array with all rows resulting from executing this statement <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide> public function fetchAll($type = 'num'); <ide> /** <ide> * Returns the number of rows affected by this SQL statement <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $statement = $connection->prepare('SELECT id, title from articles'); <ide><path>src/Database/TypeMap.php <ide> public function __construct(array $defaults = []) { <ide> * <ide> * If called with no arguments it will return the currently configured types. <ide> * <del> * ## Example <add> * ### Example <ide> * <ide> * {{{ <ide> * $query->defaults(['created' => 'datetime', 'is_visible' => 'boolean']); <ide> public function defaults(array $defaults = null) { <ide> * <ide> * If called with no arguments it will return the currently configured types. <ide> * <del> * ## Example <add> * ### Example <ide> * <ide> * {{{ <ide> * $query->types(['created' => 'time']); <ide><path>src/Datasource/EntityTrait.php <ide> public function __unset($property) { <ide> * with one call by passing a hashed array as properties in the form of <ide> * property => value pairs <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $entity->set(['name' => 'andrew', 'id' => 1]); <ide><path>src/Datasource/QueryTrait.php <ide> public function getIterator() { <ide> * - When the cached data is stale/missing the result set will be cached as the query <ide> * is executed. <ide> * <del> * ## Usage <add> * ### Usage <ide> * <ide> * {{{ <ide> * // Simple string key + config <ide><path>src/Event/Event.php <ide> class Event { <ide> /** <ide> * Constructor <ide> * <del> * ## Examples of usage: <add> * ### Examples of usage: <ide> * <ide> * {{{ <ide> * $event = new Event('Order.afterBuy', $this, array('buyer' => $userData)); <ide><path>src/Event/EventListenerInterface.php <ide> interface EventListenerInterface { <ide> * Returns a list of events this object is implementing. When the class is registered <ide> * in an event manager, each individual method will be associated with the respective event. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * public function implementedEvents() { <ide><path>src/I18n/Time.php <ide> public function isWithinNext($timeInterval) { <ide> * function, or pass a full ICU date formatting string as specified in the following <ide> * resource: http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details. <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * {{{ <ide> * $time = new Time('2014-04-20 22:10'); <ide> public function isWithinNext($timeInterval) { <ide> * Finally, should you need to use a different locale for displaying this time object, <ide> * pass a locale string as the third parameter to this function. <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * {{{ <ide> * $time = new Time('2014-04-20 22:10'); <ide><path>src/Log/Engine/SyslogLog.php <ide> class SyslogLog extends BaseLog { <ide> * the running process. For a local prefix, to be used only by one stream, you <ide> * can use the format key. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * Log::config('error', ] <ide><path>src/Network/Request.php <ide> public function query($name) { <ide> * Provides a read/write accessor for `$this->data`. Allows you <ide> * to use a syntax similar to `Cake\Model\Datasource\Session` for reading post data. <ide> * <del> * ## Reading values. <add> * ### Reading values. <ide> * <ide> * `$request->data('Post.title');` <ide> * <ide> * When reading values you will get `null` for keys/values that do not exist. <ide> * <del> * ## Writing values <add> * ### Writing values <ide> * <ide> * `$request->data('Post.title', 'New post!');` <ide> * <ide><path>src/Network/Response.php <ide> protected function _setCacheControl() { <ide> * Sets the Expires header for the response by taking an expiration time <ide> * If called with no parameters it will return the current Expires value <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * `$response->expires('now')` Will Expire the response cache now <ide> * `$response->expires(new DateTime('+1 day'))` Will set the expiration in next 24 hours <ide> public function expires($time = null) { <ide> * Sets the Last-Modified header for the response by taking a modification time <ide> * If called with no parameters it will return the current Last-Modified value <ide> * <del> * ## Examples: <add> * ### Examples: <ide> * <ide> * `$response->modified('now')` Will set the Last-Modified to the current time <ide> * `$response->modified(new DateTime('+1 day'))` Will set the modification date in the past 24 hours <ide> public function __toString() { <ide> * - secure: Is the cookie https? <ide> * - httpOnly: Is the cookie available in the client? <ide> * <del> * ## Examples <add> * ### Examples <ide> * <ide> * ### Getting all cookies <ide> * <ide><path>src/ORM/Behavior.php <ide> * <ide> * Would be called like `$table->doSomething($arg1, $arg2);`. <ide> * <del> * ## Callback methods <add> * ### Callback methods <ide> * <ide> * Behaviors can listen to any events fired on a Table. By default <ide> * CakePHP provides a number of lifecycle events your behaviors can <ide> * `priority` setting when attaching a behavior. This will set the <ide> * priority for all the callbacks a behavior provides. <ide> * <del> * ## Finder methods <add> * ### Finder methods <ide> * <ide> * Behaviors can provide finder methods that hook into a Table's <ide> * find() method. Custom finders are a great way to provide preset <ide><path>src/ORM/Query.php <ide> public function aliasFields($fields, $defaultAlias = null) { <ide> * - join: Maps to the join method <ide> * - page: Maps to the page method <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $query->applyOptions([ <ide><path>src/ORM/Table.php <ide> protected function _update($entity, $data) { <ide> * will always be removed. You can use the `cascadeCallbacks` option <ide> * when defining associations to change how associated data is deleted. <ide> * <del> * ## Options <add> * ### Options <ide> * <ide> * - `atomic` Defaults to true. When true the deletion happens within a transaction. <ide> * <del> * ## Events <add> * ### Events <ide> * <ide> * - `beforeDelete` Fired before the delete occurs. If stopped the delete <ide> * will be aborted. Receives the event, entity, and options. <ide><path>src/ORM/TableRegistry.php <ide> * This registry allows you to centralize the configuration for tables <ide> * their connections and other meta-data. <ide> * <del> * ## Configuring instances <add> * ### Configuring instances <ide> * <ide> * You may need to configure your table objects, using TableRegistry you can <ide> * centralize configuration. Any configuration set before instances are created <ide> * Configuration data is stored *per alias* if you use the same table with <ide> * multiple aliases you will need to set configuration multiple times. <ide> * <del> * ## Getting instances <add> * ### Getting instances <ide> * <ide> * You can fetch instances out of the registry using get(). One instance is stored <ide> * per alias. Once an alias is populated the same instance will always be returned. <ide><path>src/Routing/Router.php <ide> public static function url($url = null, $full = false) { <ide> * fully qualified URLs for this application. If not parameters are passed, <ide> * the currently configured value is returned. <ide> * <del> * ## Note: <add> * ### Note: <ide> * <ide> * If you change the configuration value ``App.fullBaseUrl`` during runtime <ide> * and expect the router to produce links using the new setting, you are <ide><path>src/Utility/Hash.php <ide> public static function apply(array $data, $path, $function) { <ide> * - `asc` Sort ascending. <ide> * - `desc` Sort descending. <ide> * <del> * ## Sort types <add> * ### Sort types <ide> * <ide> * - `regular` For regular sorting (don't change types) <ide> * - `numeric` Compare values numerically <ide><path>src/Validation/ValidationSet.php <ide> public function rules() { <ide> /** <ide> * Sets a ValidationRule $rule with a $name <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $set <ide> public function add($name, $rule) { <ide> /** <ide> * Removes a validation rule from the set <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $set <ide><path>src/Validation/Validator.php <ide> public function count() { <ide> * then rules list for the field will be replaced with second argument and <ide> * third argument will be ignored. <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $validator <ide> public function add($field, $name, $rule = []) { <ide> /** <ide> * Removes a rule from the set by its name <ide> * <del> * ## Example: <add> * ### Example: <ide> * <ide> * {{{ <ide> * $validator <ide><path>src/View/Helper.php <ide> * Abstract base class for all other Helpers in CakePHP. <ide> * Provides common methods and features. <ide> * <del> * ## Callback methods <add> * ### Callback methods <ide> * <ide> * Helpers support a number of callback methods. These callbacks allow you to hook into <ide> * the various view lifecycle events and either modify existing view content or perform <ide><path>src/View/Helper/TimeHelper.php <ide> public function toRss($dateString, $timezone = null) { <ide> /** <ide> * Formats a date into a phrase expressing the relative time. <ide> * <del> * ## Additional options <add> * ### Additional options <ide> * <ide> * - `element` - The element to wrap the formatted time in. <ide> * Has a few additional options:
32
PHP
PHP
add withbearertoken method
9897e3f77b33ee0546509ba73e48aeaa6f5a6c95
<ide><path>src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php <ide> public function flushHeaders() <ide> return $this; <ide> } <ide> <add> /** <add> * Add a bearer token to the request headers. <add> * <add> * @param string $value <add> * @return $this <add> */ <add> public function withBearerToken(string $value) <add> { <add> $this->defaultHeaders['Authorization'] = 'Bearer '.$value; <add> <add> return $this; <add> } <add> <ide> /** <ide> * Define a set of server variables to be sent with the requests. <ide> *
1
Text
Text
add documentation for atom.io star api
728aacd3fbd1c1af6fff462483ad029f2eef6b92
<ide><path>docs/apm-rest-api.md <ide> you'll need to increment the version when republishing. <ide> <ide> Returns 204 No Content <ide> <add> <add>### Stars <add> <add>#### GET /api/users/:login/stars <add> <add>List a user's starred packages. <add> <add>Return value is similar to **GET /api/packages** <add> <add>#### GET /api/stars <add> <add>List authenticated user's starred packages; requires authentication. <add> <add>Return value is similar to **GET /api/packages** <add> <add>#### POST /api/packages/:name/star <add> <add>Stars a package; requires authentication. <add> <add>Returns package. <add> <add>#### DELETE /api/packages/:name/star <add> <add>Unstars a package; requires authentication. <add> <add>Returns 204 No Content. <add> <ide> ### Atom updates <ide> <ide> #### GET /api/updates
1
Javascript
Javascript
add test for uid/gid setting in spawn
d0151695a7a5504115dd3feb4ffac7557e9e31b2
<ide><path>test/disabled/test-child-process-uid-gid.js <del>'use strict'; <del>var common = require('../common'); <del>var assert = require('assert'); <del>var spawn = require('child_process').spawn; <del>var fs = require('fs'); <del> <del>var myUid = process.getuid(); <del>var myGid = process.getgid(); <del> <del>if (myUid != 0) { <del> console.error('must be run as root, otherwise the gid/uid setting will' + <del> ' fail.'); <del> process.exit(1); <del>} <del> <del>// get a different user. <del>// don't care who it is, as long as it's not root <del>var passwd = fs.readFileSync('/etc/passwd', 'utf8'); <del>passwd = passwd.trim().split(/\n/); <del> <del>for (var i = 0, l = passwd.length; i < l; i++) { <del> if (passwd[i].charAt(0) === '#') continue; <del> passwd[i] = passwd[i].split(':'); <del> var otherName = passwd[i][0]; <del> var otherUid = +passwd[i][2]; <del> var otherGid = +passwd[i][3]; <del> if (otherUid && otherUid !== myUid && <del> otherGid && otherGid !== myGid && <del> otherUid > 0) { <del> break; <del> } <del>} <del>if (!otherUid && !otherGid) throw new Error('failed getting passwd info.'); <del> <del>console.error('name, id, gid = %j', [otherName, otherUid, otherGid]); <del> <del>var whoNumber = spawn('id', [], { uid: otherUid, gid: otherGid }); <del>var whoName = spawn('id', [], { uid: otherName, gid: otherGid }); <del> <del>whoNumber.stdout.buf = 'byNumber:'; <del>whoName.stdout.buf = 'byName:'; <del>whoNumber.stdout.on('data', onData); <del>whoName.stdout.on('data', onData); <del>function onData(c) { this.buf += c; } <del> <del>whoNumber.on('exit', onExit); <del>whoName.on('exit', onExit); <del> <del>function onExit(code) { <del> var buf = this.stdout.buf; <del> console.log(buf); <del> var expr = new RegExp('^(byName|byNumber):uid=' + <del> otherUid + <del> '\\(' + <del> otherName + <del> '\\) gid=' + <del> otherGid + <del> '\\('); <del> assert.ok(buf.match(expr), 'uid and gid should match ' + otherName); <del>} <ide><path>test/parallel/test-child-process-uid-gid.js <add>'use strict'; <add>const common = require('../common'); <add>const assert = require('assert'); <add>const spawn = require('child_process').spawn; <add> <add>const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/; <add> <add>assert.throws(() => { <add> spawn('echo', ['fhqwhgads'], {uid: 0}); <add>}, expectedError); <add> <add>assert.throws(() => { <add> spawn('echo', ['fhqwhgads'], {gid: 0}); <add>}, expectedError);
2
Ruby
Ruby
handle empty log files
a70c44993f52f731f84fde3471ff805249851a97
<ide><path>Library/Contributions/cmd/brew-test-bot.rb <ide> def self.run test, command, puts_output_on_success = false <ide> else <ide> output = `#{command}` <ide> end <del> output = IO.read(step.log_file_path) <add> output = IO.read(step.log_file_path) rescue nil <ide> <ide> success = $?.success? <ide> step.status = success ? :passed : :failed
1
Python
Python
add sum of the longest sub array
ac5d2354ba6f4a385b32960a3179707aaff69639
<ide><path>dynamic_programming/longest_sub_array.py <add>''' <add>Auther : Yvonne <add> <add>This is a pure Python implementation of Dynamic Programming solution to the edit distance problem. <add> <add>The problem is : <add>Given an array, to find the longest and continuous sub array and get the max sum of the sub array in the given array. <add>''' <add> <add> <add>class SubArray: <add> <add> def __init__(self, arr): <add> # we need a list not a string, so do something to change the type <add> self.array = arr.split(',') <add> print("the input array is:", self.array) <add> <add> def solve_sub_array(self): <add> rear = [int(self.array[0])]*len(self.array) <add> sum_value = [int(self.array[0])]*len(self.array) <add> for i in range(1, len(self.array)): <add> sum_value[i] = max(int(self.array[i]) + sum_value[i-1], int(self.array[i])) <add> rear[i] = max(sum_value[i], rear[i-1]) <add> return rear[len(self.array)-1] <add> <add> <add>if __name__ == '__main__': <add> whole_array = input("please input some numbers:") <add> array = SubArray(whole_array) <add> re = array.solve_sub_array() <add> print("the results is:", re) <add>
1
Go
Go
fix build test by adding --no-cache
c49cc1f2fbd3d0256455750c885eadcaa3d17937
<ide><path>integration-cli/docker_cli_build_test.go <ide> func TestBuildResourceConstraintsAreUsed(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <del> cmd := exec.Command(dockerBinary, "build", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpu-shares=100", "-t", name, ".") <add> cmd := exec.Command(dockerBinary, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpu-shares=100", "-t", name, ".") <ide> cmd.Dir = ctx.Dir <ide> <ide> out, _, err := runCommandWithOutput(cmd)
1
Python
Python
fix usage of deprecated freqs.txt in init-model
02c5c114d02d5ad21dcd94a7b603c43a1dc415d0
<ide><path>spacy/cli/init_model.py <ide> def open_file(loc): <ide> def read_attrs_from_deprecated(freqs_loc, clusters_loc): <ide> probs, oov_prob = read_freqs(freqs_loc) if freqs_loc is not None else ({}, -20) <ide> clusters = read_clusters(clusters_loc) if clusters_loc else {} <del> lex_attrs = {} <add> lex_attrs = [] <ide> sorted_probs = sorted(probs.items(), key=lambda item: item[1], reverse=True) <ide> for i, (word, prob) in tqdm(enumerate(sorted_probs)): <ide> attrs = {'orth': word, 'id': i, 'prob': prob}
1
Javascript
Javascript
fix rightpane ishidden shadow bound
8498abc95a08b73d49a04ccf26a905eb30b02be3
<ide><path>common/app/Panes/redux/index.js <ide> function checkForTypeKeys(panesMap) { <ide> return panesMap; <ide> } <ide> <del>const getPaneName = (panes, index) => (panes[index] || {}).name || ''; <add>const getPane = (panesByName, panes, index) => _.get( <add> panesByName, <add> getPaneName(panes, index), <add> null <add>); <add> <add>const getPaneName = (panes, index) => _.get( <add> panes, <add> index, <add> '' <add>); <add> <add>const createGetBound = isRight => (pane, buffer) => <add> (pane && !pane.isHidden && pane.dividerLeft || (isRight ? 100 : 0)) - buffer; <add>const getRightBound = createGetBound(true); <add>const getLeftBound = createGetBound(false); <ide> <ide> function normalizePanesMapCreator(createPanesMap) { <ide> invariant( <ide> export default function createPanesAspects({ createPanesMap }) { <ide> pressedDivider: name <ide> }), <ide> [types.dividerMoved]: (state, { payload: clientX }) => { <del> const { width, pressedDivider: paneName } = state; <add> const { <add> panes, <add> panesByName, <add> pressedDivider: paneName, <add> width <add> } = state; <ide> const dividerBuffer = (200 / width) * 100; <ide> const paneIndex = <ide> _.findIndex(state.panes, ({ name }) => paneName === name); <del> const currentPane = state.panesByName[paneName]; <del> const rightPane = <del> state.panesByName[getPaneName(state.panes, paneIndex + 1)] || {}; <del> const leftPane = <del> state.panesByName[getPaneName(state.panes, paneIndex - 1)] || {}; <del> const rightBound = (rightPane.dividerLeft || 100) - dividerBuffer; <del> const leftBound = <del> (leftPane.isHidden || typeof leftPane.isHidden === 'undefined') ? <del> dividerBuffer : (leftPane.dividerLeft + dividerBuffer); <add> const currentPane = panesByName[paneName]; <add> const rightPane = getPane(panesByName, panes, paneIndex + 1); <add> const leftPane = getPane(panesByName, panes, paneIndex - 1); <add> const rightBound = getRightBound(rightPane, dividerBuffer); <add> const leftBound = getLeftBound(leftPane, dividerBuffer); <ide> const newPosition = _.clamp( <ide> (clientX / width) * 100, <ide> leftBound,
1
Python
Python
catch deprecation warnings in tets
312ca0ddb5dd88c69c6c86455e2c5bceae9d65f9
<ide><path>celery/tests/test_app/test_loaders.py <ide> <ide> import os <ide> import sys <add>import warnings <ide> <ide> from celery import task <ide> from celery import loaders <ide> from celery.app import app_or_default <del>from celery.exceptions import ImproperlyConfigured <add>from celery.exceptions import CPendingDeprecationWarning, ImproperlyConfigured <ide> from celery.loaders import base <ide> from celery.loaders import default <ide> from celery.loaders.app import AppLoader <ide> def test_get_loader_cls(self): <ide> default.Loader) <ide> <ide> def test_current_loader(self): <del> self.assertIs(loaders.current_loader(), self.app.loader) <add> warnings.resetwarnings() <add> with catch_warnings(record=True) as log: <add> self.assertIs(loaders.current_loader(), self.app.loader) <add> warning = log[0].message <add> <add> self.assertIsInstance(warning, CPendingDeprecationWarning) <add> self.assertIn("deprecation", warning.args[0]) <ide> <ide> def test_load_settings(self): <del> self.assertIs(loaders.load_settings(), self.app.conf) <add> warnings.resetwarnings() <add> with catch_warnings(record=True) as log: <add> self.assertIs(loaders.load_settings(), self.app.conf) <add> warning = log[0].message <add> <add> self.assertIsInstance(warning, CPendingDeprecationWarning) <add> self.assertIn("deprecation", warning.args[0]) <ide> <ide> <ide> class TestLoaderBase(unittest.TestCase):
1
Python
Python
remove some weird comments from iotools
3c782b9156a9d2d7159accc6bb9d8e6f4d0108b5
<ide><path>numpy/lib/_iotools.py <ide> def autostrip(self, method): <ide> <ide> """ <ide> return lambda input: [_.strip() for _ in method(input)] <del> # <ide> <ide> def __init__(self, delimiter=None, comments='#', autostrip=True, <ide> encoding=None): <ide> def __init__(self, delimiter=None, comments='#', autostrip=True, <ide> else: <ide> self._handyman = _handyman <ide> self.encoding = encoding <del> # <ide> <ide> def _delimited_splitter(self, line): <ide> """Chop off comments, strip, and split at delimiter. """ <ide> def _delimited_splitter(self, line): <ide> if not line: <ide> return [] <ide> return line.split(self.delimiter) <del> # <ide> <ide> def _fixedwidth_splitter(self, line): <ide> if self.comments is not None: <ide> def _fixedwidth_splitter(self, line): <ide> fixed = self.delimiter <ide> slices = [slice(i, i + fixed) for i in range(0, len(line), fixed)] <ide> return [line[s] for s in slices] <del> # <ide> <ide> def _variablewidth_splitter(self, line): <ide> if self.comments is not None: <ide> def _variablewidth_splitter(self, line): <ide> return [] <ide> slices = self.delimiter <ide> return [line[s] for s in slices] <del> # <ide> <ide> def __call__(self, line): <ide> return self._handyman(_decode_line(line, self.encoding)) <ide> class NameValidator: <ide> ('EXCL', 'FIELD2', 'NO_Q', 'WITH_SPACE', 'CASE') <ide> <ide> """ <del> # <add> <ide> defaultexcludelist = ['return', 'file', 'print'] <ide> defaultdeletechars = set(r"""~!@#$%^&*()-=+~\|]}[{';: /?.>,<""") <del> # <ide> <ide> def __init__(self, excludelist=None, deletechars=None, <ide> case_sensitive=None, replace_space='_'): <ide> def __init__(self, excludelist=None, deletechars=None, <ide> else: <ide> msg = 'unrecognized case_sensitive value %s.' % case_sensitive <ide> raise ValueError(msg) <del> # <add> <ide> self.replace_space = replace_space <ide> <ide> def validate(self, names, defaultfmt="f%i", nbfields=None): <ide> def validate(self, names, defaultfmt="f%i", nbfields=None): <ide> validatednames = [] <ide> seen = dict() <ide> nbempty = 0 <del> # <add> <ide> for item in names: <ide> item = case_converter(item).strip() <ide> if replace_space: <ide> def validate(self, names, defaultfmt="f%i", nbfields=None): <ide> validatednames.append(item) <ide> seen[item] = cnt + 1 <ide> return tuple(validatednames) <del> # <ide> <ide> def __call__(self, names, defaultfmt="f%i", nbfields=None): <ide> return self.validate(names, defaultfmt=defaultfmt, nbfields=nbfields) <ide> class StringConverter: <ide> upgrade or not. Default is False. <ide> <ide> """ <del> # <ide> _mapper = [(nx.bool_, str2bool, False), <ide> (nx.int_, int, -1),] <ide> <ide> class StringConverter: <ide> def _getdtype(cls, val): <ide> """Returns the dtype of the input variable.""" <ide> return np.array(val).dtype <del> # <ide> <ide> @classmethod <ide> def _getsubdtype(cls, val): <ide> """Returns the type of the dtype of the input variable.""" <ide> return np.array(val).dtype.type <del> # <del> # This is a bit annoying. We want to return the "general" type in most <del> # cases (ie. "string" rather than "S10"), but we want to return the <del> # specific type for datetime64 (ie. "datetime64[us]" rather than <del> # "datetime64"). <ide> <ide> @classmethod <ide> def _dtypeortype(cls, dtype): <ide> """Returns dtype for datetime64 and type of dtype otherwise.""" <add> <add> # This is a bit annoying. We want to return the "general" type in most <add> # cases (ie. "string" rather than "S10"), but we want to return the <add> # specific type for datetime64 (ie. "datetime64[us]" rather than <add> # "datetime64"). <ide> if dtype.type == np.datetime64: <ide> return dtype <ide> return dtype.type <del> # <ide> <ide> @classmethod <ide> def upgrade_mapper(cls, func, default=None): <ide> """ <del> Upgrade the mapper of a StringConverter by adding a new function and <del> its corresponding default. <del> <del> The input function (or sequence of functions) and its associated <del> default value (if any) is inserted in penultimate position of the <del> mapper. The corresponding type is estimated from the dtype of the <del> default value. <add> Upgrade the mapper of a StringConverter by adding a new function and <add> its corresponding default. <ide> <del> Parameters <del> ---------- <del> func : var <del> Function, or sequence of functions <add> The input function (or sequence of functions) and its associated <add> default value (if any) is inserted in penultimate position of the <add> mapper. The corresponding type is estimated from the dtype of the <add> default value. <ide> <del> Examples <del> -------- <del> >>> import dateutil.parser <del> >>> import datetime <del> >>> dateparser = dateutil.parser.parse <del> >>> defaultdate = datetime.date(2000, 1, 1) <del> >>> StringConverter.upgrade_mapper(dateparser, default=defaultdate) <add> Parameters <add> ---------- <add> func : var <add> Function, or sequence of functions <add> <add> Examples <add> -------- <add> >>> import dateutil.parser <add> >>> import datetime <add> >>> dateparser = dateutil.parser.parse <add> >>> defaultdate = datetime.date(2000, 1, 1) <add> >>> StringConverter.upgrade_mapper(dateparser, default=defaultdate) <ide> """ <ide> # Func is a single functions <ide> if hasattr(func, '__call__'): <ide> def upgrade_mapper(cls, func, default=None): <ide> default.append([None] * (len(func) - len(default))) <ide> for (fct, dft) in zip(func, default): <ide> cls._mapper.insert(-1, (cls._getsubdtype(dft), fct, dft)) <del> # <ide> <ide> def __init__(self, dtype_or_func=None, default=None, missing_values=None, <ide> locked=False): <ide> def __init__(self, dtype_or_func=None, default=None, missing_values=None, <ide> if isinstance(missing_values, str): <ide> missing_values = missing_values.split(",") <ide> self.missing_values = set(list(missing_values) + ['']) <del> # <add> <ide> self._callingfunction = self._strict_call <ide> self.type = self._dtypeortype(dtype) <ide> self._checked = False <ide> self._initial_default = default <del> # <ide> <ide> def _loose_call(self, value): <ide> try: <ide> return self.func(value) <ide> except ValueError: <ide> return self.default <del> # <ide> <ide> def _strict_call(self, value): <ide> try: <ide> def _strict_call(self, value): <ide> self._checked = False <ide> return self.default <ide> raise ValueError("Cannot convert string '%s'" % value) <del> # <ide> <ide> def __call__(self, value): <ide> return self._callingfunction(value) <del> # <ide> <ide> def _do_upgrade(self): <ide> # Raise an exception if we locked the converter...
1
Javascript
Javascript
show cheater message directly on user page
e71f33cfc05473643818e2b646b954bd96543482
<ide><path>server/boot/user.js <ide> module.exports = function(app) { <ide> return data; <ide> }, {}); <ide> <add> if (userPortfolio.isCheater) { <add> req.flash('errors', { <add> msg: dedent` <add> Upon review, this account has been flagged for academic <add> dishonesty. If you’re the owner of this account contact <add> team@freecodecamp.com for details. <add> ` <add> }); <add> } <add> <ide> return buildDisplayChallenges(userPortfolio.challengeMap, timezone) <ide> .map(displayChallenges => ({ <ide> ...userPortfolio, <ide> module.exports = function(app) { <ide> } <ide> <ide> if (user.isCheater) { <del> req.flash('errors', { <del> msg: dedent` <del> Upon review, this account has been flagged for academic <del> dishonesty. If you’re the owner of this account contact <del> team@freecodecamp.com for details. <del> ` <del> }); <ide> return res.redirect(`/${user.username}`); <ide> } <ide>
1
Python
Python
fix example for __call__. see
b1ffafbf4b93fb5c01e0216ee018e64596d7f33b
<ide><path>numpy/_pytesttester.py <ide> def __call__(self, label='fast', verbose=1, extra_argv=None, <ide> <ide> Notes <ide> ----- <del> Each NumPy module exposes `test` in its namespace to run all tests for it. <del> For example, to run all tests for numpy.lib: <add> Each NumPy module exposes `test` in its namespace to run all tests for <add> it. For example, to run all tests for numpy.lib: <ide> <ide> >>> np.lib.test() #doctest: +SKIP <ide> <ide> Examples <ide> -------- <ide> >>> result = np.lib.test() #doctest: +SKIP <del> Running unit tests for numpy.lib <ide> ... <del> Ran 976 tests in 3.933s <del> <del> OK <del> <del> >>> result.errors #doctest: +SKIP <del> [] <del> >>> result.knownfail #doctest: +SKIP <del> [] <add> 1023 passed, 2 skipped, 6 deselected, 1 xfailed in 10.39 seconds <add> >>> result <add> True <ide> <ide> """ <ide> import pytest
1
Ruby
Ruby
pass path into the formula constructor
abbed076f091e6420734bda094dc13527f4e1620
<ide><path>Library/Homebrew/formulary.rb <ide> def initialize name <ide> end <ide> <ide> def get_formula <del> return klass.new(name) <add> klass.new(name, path) <ide> end <ide> end <ide>
1
Text
Text
add error codes update to release process
8835955218134df61773ae7130291c03843c1c55
<ide><path>scripts/release-manager/Readme.md <ide> You can fix them in a separate commit. <ide> <ide> **Tip:** tests might also be failing if dependency versions are incorrect. You might want to run `yarn` first since sometimes `package.json` on master is different from the stable branches. <ide> <add>### Update the Error Codes <add> <add>**This step is only necessary for a stable release.** <add>If you’re just cutting an alpha, you should skip it. <add> <add>Run this so that `scripts/error-codes/codes.json` is up to date: <add> <add>``` <add>./node_modules/.bin/gulp react:extract-errors <add>``` <add> <add>Check `git diff`. Do changes, if any, look sensible? <add> <add>If there are any changes, commit them: <add> <add>``` <add>git commit -am 'Update error codes' <add>``` <add> <add>You will see the commit hash. Copy it in your editor. You will need it later to cherry-pick the error codes update to master. <add> <add>If there were no changes, it’s also fine. <add> <ide> ### Push and Choose the Branch <ide> <ide> If you followed the guide correctly (and ran `start-release` in the beginning), you should be on a “stable development” branch such as `15-dev`. Now is a good time to push the development branch: <ide> Looks good? Push it. <ide> git push <ide> ``` <ide> <add>### Cherry-Pick the Error Codes <add> <add>**This step is only necessary for a stable release.** <add>If you’re just cutting an alpha, you should skip it. <add> <add>If error codes were updated, you were supposed to commit that earlier and record the commit hash. <add> <add>Did this happen? <add> <add>If so, cherry-pick it to `master` as well: <add> <add>``` <add>git cherry-pick <hash of the error codes update commit> <add>``` <add> <add>Verify you picked the right commit: <add> <add>``` <add>git diff HEAD~ <add>``` <add> <add>Looks good? Push it. <add> <add>``` <add>git push <add>``` <add> <ide> ### Creating a GitHub Release <ide> <ide> **This step is only necessary for a stable release.**
1
PHP
PHP
remove duplicate useless empty lines.
e5697d5f0c244b443a7622328a6d3d99b93dbe72
<ide><path>tests/Validation/ValidationExistsRuleTest.php <ide> public function testItCorrectlyFormatsAStringVersionOfTheRule() <ide> $rule->where('foo', 'bar'); <ide> $this->assertEquals('exists:table,NULL,foo,bar', (string) $rule); <ide> <del> <ide> $rule = new Illuminate\Validation\Rules\Exists('table', 'column'); <ide> $rule->where('foo', 'bar'); <ide> $this->assertEquals('exists:table,column,foo,bar', (string) $rule); <ide><path>tests/Validation/ValidationUniqueRuleTest.php <ide> public function testItCorrectlyFormatsAStringVersionOfTheRule() <ide> $rule->where('foo', 'bar'); <ide> $this->assertEquals('unique:table,NULL,NULL,id,foo,bar', (string) $rule); <ide> <del> <ide> $rule = new Illuminate\Validation\Rules\Unique('table', 'column'); <ide> $rule->ignore(1, 'id_column'); <ide> $rule->where('foo', 'bar'); <ide><path>tests/Validation/ValidationValidatorTest.php <ide> public function testValidateUniqueAndExistsSendsCorrectFieldNameToDBWithArrays() <ide> $v->setPresenceVerifier($mock); <ide> $this->assertTrue($v->passes()); <ide> <del> <ide> $trans = $this->getIlluminateArrayTranslator(); <ide> $closure = function () { <ide> };
3
Javascript
Javascript
use canvas measuretext to detect font loading
9d2806ec87614680dc3534f125ac58da7fabb940
<ide><path>fonts.js <ide> if (!isWorker) { <ide> })(); <ide> } <ide> <add>/** <add> * The FontLoader binds a fontObj to the DOM and checks if it is loaded. <add> * At the point of writing (11/9/14) there is no DOM event to detect loading <add> * of fonts. Therefore, we measure the font using a canvas before the <add> * font is attached to the DOM and later on test if the width changed. <add> * To ensure there is a change in the font size, two fallback fonts are used. <add> * The font used might look like this: <add> * ctx.font = "normal normmal 'p0_font_0', 'Arial' <add> * <add> * As long as the font 'p0_font_0' isn't loaded, the font 'Arial' is used. A <add> * second measurement is done against the font 'Courier': <add> * ctx.font = "normal normmal 'p0_font_0', 'Courier' <add> * <add> * The font sizes of Arial and Courier are quite different which ensures there <add> * gone be a change nomatter what the font looks like (e.g. you could end up <add> * with a font that looks like Arial which means you don't see any change in <add> * size, but as Courier is checked as well, there will be difference in this <add> * font). <add> * <add> * !!! The test string used for measurements is really important. Some fonts <add> * don't have definitions for characters like "a" or "b", but only for some <add> * unicode characters. Therefore, the test string have to be build using the <add> * encoding of the fontObj. <add> */ <ide> var FontLoader = { <del> fonts: {}, <del> fontsLoading: false, <del> waitingFontObjs: [], <del> waitingFontIds: [], <del> <del> bind: function(objId, fontObj) { <del> this.waitingFontObjs.push(fontObj); <del> this.waitingFontIds.push(objId); <add> scratchCtx: null, <add> <add> /** <add> * Create the canvas used for measuring the width of text. <add> */ <add> setup: function() { <add> var canvas = document.createElement("canvas"); <add> var ctx = canvas.getContext("2d"); <add> this.ctx = ctx; <add> }, <add> <add> /** <add> * Measures the width of some string using a fontObj and some different <add> * fallback fonts. <add> */ <add> measure: function(fontObj, str) { <add> var ctx = this.ctx; <add> <add> // THe fonts used as fallback. <add> var fallbacks = [ "Arial", "Courier" ]; <ide> <del> if (!this.fontsLoading) { <del> this.executeWaiting(); <add> var widths = []; <add> for (var n = 0; n < fallbacks.length; n++) { <add> // Choose a large font size as there are no sub-pixel returned from <add> // measureText. <add> var font = fontObj.getRule(420, fallbacks[n]); <add> ctx.font = font; <add> <add> widths.push(ctx.measureText(str).width); <ide> } <add> return widths; <add> }, <add> <add> /** <add> * Attaches a fontObj to the DOM and calls Objects.resolve(objId) once <add> * the font is loaded. <add> */ <add> bind: function(objId, fontObj) { <add> var encoding = fontObj.encoding; <add> var testStr = ""; <add> for (var enc in encoding) { <add> testStr += String.fromCharCode(encoding[enc]); <add> if (testStr.length == 10) { <add> break; <add> } <add> } <add> <add> var before = this.measure(fontObj, testStr); <add> this.bindDOM(fontObj); <add> <add> var check = function() { <add> var measure = this.measure(fontObj, testStr); <add> <add> for (var i = 0; i < measure.length; i++) { <add> if (measure[i] !== before[i]) { <add> Objects.resolve(objId); <add> return; <add> } <add> } <add> <add> setTimeout(check, 0); <add> }.bind(this); <add> <add> // Start checking if font is loaded. <add> check(); <ide> }, <ide> <add> /** <add> * Attach the fontObj to the DOM. <add> */ <ide> bindDOM: function font_bindDom(fontObj) { <del> var fontName = fontObj.loadedName; <add> // The browser isn't loading a font until it's used on the page. Attaching <add> // a hidden div that uses the font 'tells' the browser to load the font. <add> var div = document.createElement('div'); <add> div.setAttribute('style', <add> 'visibility: hidden;' + <add> 'width: 10px; height: 10px;' + <add> 'position: absolute; top: 0px; left: 0px;' + <add> 'font-family: ' + fontObj.loadedName); <add> div.innerHTML = "Hi"; <add> document.body.appendChild(div); <add> <ide> // Add the font-face rule to the document <add> var fontName = fontObj.loadedName; <ide> var url = ('url(data:' + fontObj.mimetype + ';base64,' + <ide> window.btoa(fontObj.str) + ');'); <ide> var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}'; <ide> var styleSheet = document.styleSheets[0]; <ide> styleSheet.insertRule(rule, styleSheet.cssRules.length); <ide> return rule; <del> }, <del> <del> executeWaiting: function() { <del> var rules = []; <del> var names = []; <del> var objIds = this.waitingFontIds; <del> <del> for (var i = 0; i < this.waitingFontObjs.length; i++) { <del> var fontObj = this.waitingFontObjs[i]; <del> var rule = this.bindDOM(fontObj); <del> names.push(fontObj.loadedName); <del> rules.push(rule); <del> } <del> <del> this.prepareFontLoadEvent(rules, names, objIds); <del> this.waitingFontIds = []; <del> this.waitingFontObjs = []; <del> }, <del> <del> fontLoadEvent: function(objIds) { <del> for (var i = 0; i < objIds.length; i++) { <del> var objId = objIds[i]; <del> Objects.resolve(objId); <del> } <del> <del> this.fontsLoading = false; <del> <del> if (this.waitingFontIds.length != 0) { <del> this.executeWaiting(); <del> } <del> }, <del> <del> // Set things up so that at least one pdfjsFontLoad event is <del> // dispatched when all the @font-face |rules| for |names| have been <del> // loaded in a subdocument. It's expected that the load of |rules| <del> // has already started in this (outer) document, so that they should <del> // be ordered before the load in the subdocument. <del> prepareFontLoadEvent: function(rules, names, objIds) { <del> this.fontsLoading = true; <del> /** Hack begin */ <del> // There's no event when a font has finished downloading so the <del> // following code is a dirty hack to 'guess' when a font is <del> // ready. This code will be obsoleted by Mozilla bug 471915. <del> // <del> // The only reliable way to know if a font is loaded in Gecko <del> // (at the moment) is document.onload in a document with <del> // a @font-face rule defined in a "static" stylesheet. We use a <del> // subdocument in an <iframe>, set up properly, to know when <del> // our @font-face rule was loaded. However, the subdocument and <del> // outer document can't share CSS rules, so the inner document <del> // is only part of the puzzle. The second piece is an invisible <del> // div created in order to force loading of the @font-face in <del> // the *outer* document. (The font still needs to be loaded for <del> // its metrics, for reflow). We create the div first for the <del> // outer document, then create the iframe. Unless something <del> // goes really wonkily, we expect the @font-face for the outer <del> // document to be processed before the inner. That's still <del> // fragile, but seems to work in practice. <del> // <del> // The postMessage() hackery was added to work around chrome bug <del> // 82402. <del> <del> var div = document.createElement('div'); <del> div.setAttribute('style', <del> 'visibility: hidden;' + <del> 'width: 10px; height: 10px;' + <del> 'position: absolute; top: 0px; left: 0px;'); <del> var html = ''; <del> for (var i = 0; i < names.length; ++i) { <del> html += '<span style="font-family:' + names[i] + '">Hi</span>'; <del> } <del> div.innerHTML = html; <del> document.body.appendChild(div); <del> <del> // XXX we should have a time-out here too, and maybe fire <del> // pdfjsFontLoadFailed? <del> var src = '<!DOCTYPE HTML><html><head>'; <del> src += '<style type="text/css">'; <del> for (var i = 0; i < rules.length; ++i) { <del> src += rules[i]; <del> } <del> src += '</style>'; <del> src += '<script type="application/javascript">'; <del> var objIdsArray = ''; <del> for (var i = 0; i < objIds.length; ++i) { <del> objIdsArray += '"' + objIds[i] + '", '; <del> } <del> src += ' var objIds=[' + objIdsArray + '];\n'; <del> src += ' window.onload = function () {\n'; <del> src += ' setTimeout(function(){parent.postMessage(JSON.stringify(objIds), "*")},0);\n'; <del> src += ' }'; <del> src += '</script></head><body>'; <del> src += '<p style="font-family:\'' + name + '\'">Hi</p>'; <del> src += '</body></html>'; <del> var frame = document.createElement('iframe'); <del> frame.src = 'data:text/html,' + src; <del> frame.setAttribute('style', <del> 'visibility: hidden;' + <del> 'width: 10px; height: 10px;' + <del> 'position: absolute; top: 0px; left: 0px;'); <del> document.body.appendChild(frame); <del> /** Hack end */ <ide> } <ide> }; <ide> <ide> if (!isWorker) { <add> FontLoader.setup(); <add> <ide> window.addEventListener( <ide> 'message', <ide> function(e) { <ide> var FontShape = (function FontShape() { <ide> (this.bold ? 'bold' : 'normal'); <ide> <ide> var italic = this.italic ? 'italic' : 'normal'; <del> var serif = this.serif ? 'serif' : 'sans-serif'; <del> var typeface = '"' + name + '", ' + serif; <add> this.fontFallback = this.serif ? 'serif' : 'sans-serif'; <ide> <ide> this.$name1 = italic + ' ' + bold + ' '; <del> this.$name2 = 'px ' + typeface; <add> this.$name2 = 'px "' + name + '", "'; <ide> }; <ide> <ide> function int16(bytes) { <ide> return (bytes[0] << 8) + (bytes[1] & 0xff); <ide> }; <ide> <ide> constructor.prototype = { <del> getRule: function fonts_getRule(size) { <del> return this.$name1 + size + this.$name2; <add> getRule: function fonts_getRule(size, fallback) { <add> fallback = fallback || this.fontFallback; <add> return this.$name1 + size + this.$name2 + fallback + '"'; <ide> }, <ide> <ide> charsToUnicode: function fonts_chars2Unicode(chars) {
1
Javascript
Javascript
update example to es6
86684a0a294a5970f8b01824c8f7fe5226556e5c
<ide><path>Libraries/AppState/AppState.js <ide> const invariant = require('fbjs/lib/invariant'); <ide> * while `AppState` retrieves it over the bridge. <ide> * <ide> * ``` <del> * getInitialState: function() { <del> * return { <del> * currentAppState: AppState.currentState, <del> * }; <del> * }, <del> * componentDidMount: function() { <del> * AppState.addEventListener('change', this._handleAppStateChange); <del> * }, <del> * componentWillUnmount: function() { <del> * AppState.removeEventListener('change', this._handleAppStateChange); <del> * }, <del> * _handleAppStateChange: function(currentAppState) { <del> * this.setState({ currentAppState, }); <del> * }, <del> * render: function() { <del> * return ( <del> * <Text>Current state is: {this.state.currentAppState}</Text> <del> * ); <del> * }, <add> * import React, {Component} from 'react' <add> * import {AppState, Text} from 'react-native' <add> * <add> * class AppStateExample extends Component { <add> * <add> * state = { <add> * appState: AppState.currentState <add> * } <add> * <add> * componentDidMount() { <add> * AppState.addEventListener('change', this._handleAppStateChange); <add> * } <add> * <add> * componentWillUnmount() { <add> * AppState.removeEventListener('change', this._handleAppStateChange); <add> * } <add> * <add> * _handleAppStateChange = (nextAppState) => { <add> * if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') { <add> * console.log('App has come to the foreground!') <add> * } <add> * this.setState({appState: nextAppState}); <add> * } <add> * <add> * render() { <add> * return ( <add> * <Text>Current state is: {this.state.appState}</Text> <add> * ); <add> * } <add> * <add> * } <ide> * ``` <ide> * <ide> * This example will only ever appear to say "Current state is: active" because
1
Javascript
Javascript
add test for coercion of mixed range
205be78ed3f9c7ff5889bc6b4a5431ab55883999
<ide><path>test/scale/linear-test.js <ide> suite.addBatch({ <ide> assert.inDelta(x.invert(new Date(1990, 6, 2, 13)), .5, 1e-6); <ide> var x = d3.scale.linear().range(["#000", "#fff"]); <ide> assert.isNaN(x.invert("#999")); <add> var x = d3.scale.linear().range([0, "#fff"]); <add> assert.isNaN(x.invert("#999")); <add> assert.isNaN(x.invert(1)); <ide> }, <ide> "can invert a polylinear descending domain": function(d3) { <ide> var x = d3.scale.linear().domain([4, 2, 1]).range([1, 2, 4]);
1
PHP
PHP
support delete with limit on sqlsrv
f16d3256f93be71935ed86951e58f90b83912feb
<ide><path>src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php <ide> <ide> use Illuminate\Database\Query\Builder; <ide> use Illuminate\Support\Arr; <add>use Illuminate\Support\Str; <ide> <ide> class SqlServerGrammar extends Grammar <ide> { <ide> protected function compileRowConstraint($query) <ide> return ">= {$start}"; <ide> } <ide> <add> /** <add> * Compile a delete statement without joins into SQL. <add> * <add> * @param \Illuminate\Database\Query\Builder $query <add> * @param string $table <add> * @param string $where <add> * @return string <add> */ <add> protected function compileDeleteWithoutJoins(Builder $query, $table, $where) <add> { <add> $sql = parent::compileDeleteWithoutJoins($query, $table, $where); <add> <add> return ! is_null($query->limit) && $query->limit > 0 && $query->offset <= 0 <add> ? Str::replaceFirst('delete', 'delete top ('.$query->limit.')', $sql) <add> : $sql; <add> } <add> <ide> /** <ide> * Compile the random statement into SQL. <ide> * <ide><path>tests/Database/DatabaseQueryBuilderTest.php <ide> public function testDeleteMethod() <ide> $builder->getConnection()->shouldReceive('delete')->once()->with('delete from [users] where [email] = ?', ['foo'])->andReturn(1); <ide> $result = $builder->from('users')->where('email', '=', 'foo')->delete(); <ide> $this->assertEquals(1, $result); <add> <add> $builder = $this->getSqlServerBuilder(); <add> $builder->getConnection()->shouldReceive('delete')->once()->with('delete top (1) from [users] where [email] = ?', ['foo'])->andReturn(1); <add> $result = $builder->from('users')->where('email', '=', 'foo')->orderBy('id')->take(1)->delete(); <add> $this->assertEquals(1, $result); <ide> } <ide> <ide> public function testDeleteWithJoinMethod()
2
Go
Go
fix a bug in encoding of multi-value maps
99dda11d4525c5153a10c4c95c5f46ca3512fc69
<ide><path>pkg/beam/data/data.go <ide> func decodeString(msg string) (string, int, error) { <ide> length = int(l) <ide> } <ide> if len(parts[1]) < length + 1 { <del> return "", 0, fmt.Errorf("message is less than %d bytes", length) <add> return "", 0, fmt.Errorf("message '%s' is %d bytes, expected at least %d", parts[1], len(parts[1]), length + 1) <ide> } <ide> payload := parts[1][:length + 1] <ide> if payload[length] != ',' { <ide> return "", 0, fmt.Errorf("message is not comma-terminated") <ide> } <del> return payload[:length], len(parts[0]) + length + 1, nil <add> return payload[:length], len(parts[0]) + 1 + length + 1, nil <ide> } <ide> <ide> func decodeHeader(msg string) (int, int, error) { <ide><path>pkg/beam/data/data_test.go <ide> package data <ide> <ide> import ( <add> "strings" <ide> "testing" <ide> ) <ide> <ide> func TestEncodeBinaryValue(t *testing.T) { <ide> t.Fatalf("'%v' != '%v'", output, expectedOutput) <ide> } <ide> } <add> <add>func TestDecodeString(t *testing.T) { <add> validEncodedStrings := []struct{ <add> input string <add> output string <add> skip int <add> }{ <add> {"3:foo,", "foo", 6}, <add> {"5:hello,", "hello", 8}, <add> {"5:hello,5:world,", "hello", 8}, <add> } <add> for _, sample := range validEncodedStrings { <add> output, skip, err := decodeString(sample.input) <add> if err != nil { <add> t.Fatalf("error decoding '%v': %v", sample.input, err) <add> } <add> if skip != sample.skip { <add> t.Fatalf("invalid skip: %v!=%v", skip, sample.skip) <add> } <add> if output != sample.output { <add> t.Fatalf("invalid output: %v!=%v", output, sample.output) <add> } <add> } <add>} <add> <add>func TestDecode1Key1Value(t *testing.T) { <add> input := "000;3:foo,6:3:bar,," <add> output, err := Decode(input) <add> if err != nil { <add> t.Fatal(err) <add> } <add> if v, exists := output["foo"]; !exists { <add> t.Fatalf("wrong output: %v\n", output) <add> } else if len(v) != 1 || strings.Join(v, "") != "bar" { <add> t.Fatalf("wrong output: %v\n", output) <add> } <add>}
2
Text
Text
fix typo of variable name
50f7f405a4cb26acd703d581d0a8c92459473af9
<ide><path>research/object_detection/g3doc/using_your_own_dataset.md <ide> def create_cat_tf_example(encoded_cat_image_data): <ide> 'image/width': dataset_util.int64_feature(width), <ide> 'image/filename': dataset_util.bytes_feature(filename), <ide> 'image/source_id': dataset_util.bytes_feature(filename), <del> 'image/encoded': dataset_util.bytes_feature(encoded_image_data), <add> 'image/encoded': dataset_util.bytes_feature(encoded_cat_image_data), <ide> 'image/format': dataset_util.bytes_feature(image_format), <ide> 'image/object/bbox/xmin': dataset_util.float_list_feature(xmins), <ide> 'image/object/bbox/xmax': dataset_util.float_list_feature(xmaxs),
1