/** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } }
( function add( args ) { jQuery.each( args, function( _, arg ) { if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && toType( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments );
// Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } }
stream.on('end', function() { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) self.push(chunk); } self.push(null); });
createSelector( ( state, term ) => { const filters = getThemeFilters( state ); const results = filter( filters, ( terms ) => !! get( terms, term ) ); return results.length > 1; }, ( state ) => [ getThemeFilters( state ) ] )
describe('add', () => { it('calls forwardFn', () => { const equation = new Equation(); const input = fourSquareMatrix(1); equation.add(input, fourSquareMatrix(1)); expect(equation.states.length).toBe(1); jest.spyOn(equation.states[0], 'forwardFn'); equation.runIndex(); expect(equation.states[0].forwardFn).toBeCalled(); }); });
// Sort bottom-to-top, line-deletes last, right-to-left, long-to-short fixInfos.sort((a, b) => { const aDeletingLine = (a.deleteCount === -1); const bDeletingLine = (b.deleteCount === -1); return ( (b.lineNumber - a.lineNumber) || (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || (b.editColumn - a.editColumn) || (b.insertText.length - a.insertText.length) ); });
function getTranslation( i18n, options ) { for ( let i = translationLookup.length - 1; i >= 0; i-- ) { const lookup = translationLookup[ i ]( Object.assign( {}, options ) ); const key = lookup.context ? lookup.context + '\u0004' + lookup.original : lookup.original; // Only get the translation from tannin if it exists. if ( i18n.state.locale[ key ] ) { return getTranslationFromTannin( i18n.state.tannin, lookup ); } } return null; }
$pauseButton.click(function() { downloader._downloads[downloader._downloads.length - 1].stop(); $pauseButton.addClass("disabled"); $resumeButton.removeClass("disabled"); });
export function arraysToFloat32Arrays(arrays: number[][]): Float32Array[] { const result: Float32Array[] = []; for (let i = 0; i < arrays.length; i++) { result.push(Float32Array.from(arrays[i])); } return result; }
$resumeButton.click(function() { downloader._downloads[downloader._downloads.length - 1].resume(); $resumeButton.addClass("disabled"); $pauseButton.removeClass("disabled"); });
describe('multiply', () => { it('calls forwardFn', () => { const equation = new Equation(); const input = fourSquareMatrix(1); equation.multiply(input, fourSquareMatrix(1)); expect(equation.states.length).toBe(1); jest.spyOn(equation.states[0], 'forwardFn'); equation.runIndex(); expect(equation.states[0].forwardFn).toBeCalled(); }); });
describe('multiplyElement', () => { it('calls forwardFn', () => { const equation = new Equation(); const input = fourSquareMatrix(1); equation.add(input, fourSquareMatrix(1)); expect(equation.states.length).toBe(1); jest.spyOn(equation.states[0], 'forwardFn'); equation.runIndex(); expect(equation.states[0].forwardFn).toBeCalled(); }); });