Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].
function continuous(deinterpolate, reinterpolate) { var domain = unit, range$$1 = unit, interpolate$$1 = d3Interpolate.interpolate, clamp = false, piecewise, output, input; function rescale() { piecewise = Math.min(domain.length, range$$1.length) > 2 ? polymap : bimap; o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _interpolate(a, b, t) {\n\t return ((1 - t) * a) + (t * b);\n\t }", "function _interpolate(a, b, t) {\n return ((1 - t) * a) + (t * b);\n }", "function _interpolate(a, b, t) {\n return ((1 - t) * a) + (t * b);\n }", "function continuous(deinterpolate,reinterpolate){var ...
[ "0.67073786", "0.6663296", "0.6663296", "0.6368387", "0.63470465", "0.6337132", "0.6261001", "0.6240214", "0.6240214", "0.62272835", "0.62272835", "0.62272835", "0.62272835", "0.6221141", "0.6221141", "0.6221141", "0.621756", "0.6209406", "0.6209406", "0.6209406", "0.6209406"...
0.63088304
12
Compute perpendicular offset line of length rc.
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPerpendicularLine(context, eventData, element, data, color, lineWidth) {\n\n // mid point of long-axis line\n var mid = {\n x: (data.handles.start.x + data.handles.end.x) / 2,\n y: (data.handles.start.y + data.handles.end.y) / 2\n };\n\n // Length of l...
[ "0.61555076", "0.6136213", "0.592017", "0.5753711", "0.5637825", "0.5612782", "0.54631627", "0.5454807", "0.5444906", "0.53873765", "0.5300839", "0.5262509", "0.51919144", "0.5177952", "0.5157787", "0.5157787", "0.5157787", "0.5149515", "0.51270515", "0.5126161", "0.5105256",...
0.0
-1
Calculate the slopes of the tangents (Hermitetype interpolation) based on the following paper: Steffen, M. 1990. A Simple Method for Monotonic Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO. NOV(II), P. 443, 1990.
function slope3(that, x2, y2) { var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Mat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function slope2(that,t){var h=that._x1-that._x0;...
[ "0.6539162", "0.6539162", "0.6539162", "0.65048176", "0.6441283", "0.64147156", "0.64127094", "0.63864577", "0.63864577", "0.63864577", "0.63864577", "0.63864577", "0.63864577", "0.63864577", "0.6374098", "0.6374098", "0.63705593", "0.63677025", "0.63452274", "0.6233702", "0....
0.0
-1
Calculate a onesided slope.
function slope2(that, t) { var h = that._x1 - that._x0; return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateSlope() {\n let x1 = 2;\n let x2 = 4;\n let firstPointY = 2 * x1 - 2;\n let secondPointY = 2 * x2 - 2;\n return (secondPointY - firstPointY) / (x2 - x1);\n}", "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "function slope(a, b) {\n return (b.y - a.y)...
[ "0.7581995", "0.74803245", "0.74803245", "0.74425995", "0.74425995", "0.7222996", "0.7183728", "0.7183728", "0.7183728", "0.7166007", "0.7138525", "0.713446", "0.71305066", "0.711682", "0.7022051", "0.70193577", "0.700835", "0.69189817", "0.69015527", "0.6782913", "0.6677642"...
0.65396535
91
Returns true if the given `key` is an own property of `obj`.
function hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "function hasOwn(obj, key) {\n\t return Object.prototype.hasOwnProperty.call(obj, key);\n\t}", "function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key)\n}", "function hasOwn$1(obj, key) ...
[ "0.76800776", "0.7679248", "0.76637346", "0.7659957", "0.74843556", "0.74458146", "0.7444411", "0.7415909", "0.74099565", "0.73986334", "0.7389322", "0.7389322", "0.7389322", "0.7389322", "0.7389322", "0.73557514", "0.73463684", "0.7298799", "0.72919685", "0.72887254", "0.728...
0.77113444
33
eslintdisable nobitwise Checks if a given DOM node contains or is another DOM node.
function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } else if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNodeInDOM(node) {\n var ancestor = node;\n while (ancestor.parentNode) {\n ancestor = ancestor.parentNode;\n }\n // ancestor should be a document\n return !!ancestor.body;\n }", "function isElement(domNode) {\n return domNode.nodeType !== undefined;\...
[ "0.73209375", "0.7070514", "0.6997442", "0.6997442", "0.69797397", "0.6879964", "0.6825696", "0.67898536", "0.67599165", "0.6703535", "0.6681516", "0.6681516", "0.6681516", "0.6681516", "0.6681516", "0.6681516", "0.66689837", "0.6650565", "0.6643169", "0.66393316", "0.6622063...
0.0
-1
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.58213997", "0.56351775", "0.5554003", "0.54880005", "0.53968745", "0.5384077", "0.5362144", "0.53260416", "0.5321262", "0.53156716", "0.53156716", "0.5291979", "0.52659994", "0.52164733", "0.5197259", "0.5190788", "0.51904845", "0.5154647", "0.5140113", "0.51331437", "0.51...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 // Added the nonzero y check to make Flow happy, but it is redundant return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", ...
[ "0.7044135", "0.6979357", "0.68574303", "0.6821805", "0.68029666", "0.67803156", "0.6729492", "0.67206", "0.6709456", "0.66839457", "0.6676559", "0.6676559", "0.6676559", "0.66488636", "0.6640003", "0.6640003", "0.6640003", "0.6640003", "0.6625777", "0.6623136", "0.6623136", ...
0.0
-1
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
function shallowEqual(objA, objB) { if (is(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalForKeys(a, b, keys) {\n if (!angular.isArray(keys) && angular.isObject(keys)) {\n keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n }\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n)...
[ "0.6573566", "0.6573566", "0.64670867", "0.6455202", "0.643334", "0.6335227", "0.6295365", "0.6271248", "0.6240487", "0.62244165", "0.6215123", "0.61840254", "0.615888", "0.6129564", "0.61267", "0.6074246", "0.603424", "0.6014015", "0.60044837", "0.59774935", "0.5975783", "...
0.0
-1
If you need to support Safari 57 (810 yrold browser), take a look at
function isBuffer(val) { return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSafari() {\n let isSafari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&\n navigator.userAgent &&\n navigator.userAgent.indexOf('CriOS') == -1 &&\n navigator.userAgent.indexOf('FxiOS') == -1;\n\n if (isSafari) {\n document.getElementById('wrapper').classList.add('s...
[ "0.6860666", "0.6858721", "0.6842412", "0.68269986", "0.6607409", "0.66046786", "0.66046786", "0.66046786", "0.66046786", "0.6576386", "0.6533261", "0.65117216", "0.6499543", "0.6499543", "0.6499543", "0.64812416", "0.64658344", "0.64658344", "0.64658344", "0.64658344", "0.64...
0.0
-1
Indents every line in a string. Empty lines (\n only) are not indented.
function indentString(string, spaces) { var ind = common.repeat(' ', spaces), position = 0, next = -1, result = '', line, length = string.length; while (position < length) { next = string.indexOf('\n', position); if (next === -1) { line = string.slice(position); po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indentString$1(string, spaces) {\n var ind = common$5.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slic...
[ "0.6786829", "0.67142516", "0.6687751", "0.6651403", "0.6651403", "0.6651403", "0.6598248", "0.65797234", "0.65418786", "0.6412618", "0.6160087", "0.6160087", "0.6103218", "0.60988843", "0.6044039", "0.6014744", "0.6014744", "0.6014744", "0.6014744", "0.6014744", "0.6014744",...
0.6739443
21
[33] swhite ::= sspace | stab
function isWhitespace(c) { return c === CHAR_SPACE || c === CHAR_TAB; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function white() {\r\n var c = walker.ch,\r\n token = '';\r\n \r\n while (c === \" \" || c === \"\\t\") {\r\n token += c;\r\n c = walker.nextChar();\r\n }\r\n \r\n tokener(token, 'white');\r\n \r\n }", "function matchWhite() {\n\t\tvar pattern = /^(\\s|\\n|\\t)/;\n\t\tvar x = lexSt...
[ "0.71999675", "0.63202614", "0.6066033", "0.60659677", "0.60659677", "0.6039607", "0.5978178", "0.5901559", "0.5901559", "0.5816258", "0.5816258", "0.5816258", "0.58161986", "0.5756463", "0.5749449", "0.5690292", "0.5690292", "0.5649742", "0.55242056", "0.54569775", "0.545697...
0.0
-1
Simplified test for values allowed after the first character in plain style.
function isPlainSafe(c) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n return isPrintable(c) && c !== 0xFEFF\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !==...
[ "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6716499", "0.6710389", "0.6710389", "0.6710389", "0.66741455", "0.66741455", "0.66741455", "0.66741455", "0.66741455", "0.66741455", "0.66741455", "0.66741455", "0.66741...
0.0
-1
Simplified test for values allowed as the first character in plain style.
function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n return isPrintable(c) && c !== 0xFEFF\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !==...
[ "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.69060594", "0.6874973", "0.6874973", "0.6874973", "0.6716959", "0.6699953", "0.6699953", "0.6699953", "0.6699953", "0.64679575", "0.6443986", "0.64386994", "0.63...
0.68719757
22
Determines whether block indentation indicator is required.
function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; return leadingSpaceRe.test(string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function needIndentIndicator$1(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}", "indentation() {\n var _a;\n return (_a = this.overrideIndent) !== null && _a !== void 0 ? _a : countCol(this.string, null, this.tabSize);\n }", "isNextLineIndented(ignoreComm...
[ "0.6787066", "0.63313544", "0.6041281", "0.6031409", "0.59672546", "0.5964364", "0.59153175", "0.5908457", "0.5908457", "0.5908457", "0.5908457", "0.5908457", "0.56096697", "0.5475761", "0.5385763", "0.5381619", "0.537914", "0.5349726", "0.52810466", "0.526711", "0.5263013", ...
0.67317927
22
Determines which scalar styles are possible and returns the preferred style. lineWidth = 1 => no limit. Preconditions: str.length > 0. Postconditions: STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. STYLE_LITERAL => no lines are suitable for folding (or lineWidth is 1). STYLE_FOLDED => a line > lineWidth and ca...
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { var i; var char; var hasLineBreak = false; var hasFoldableLine = false; // only checked if shouldTrackWidth var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; // count the first line correctl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {\n var i;\n var char, prev_char;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count t...
[ "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.76291645", "0.75900143", "0.7569788", "0.7569788", "0.7569788", "0.75559837", "0.7417766", "0.7417766", "0.7417766", "0.7417766", "0.5697013", "0.5654883", "0.54...
0.75900143
19
Preconditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
function blockHeader(string, indentPerLevel) { var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; // note the special case: the string '\n' counts as a "trailing" empty line. var clip = string[string.length - 1] === '\n'; var keep = clip && (string[string.length - 2] === ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = null;\n\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n ...
[ "0.61747354", "0.61747354", "0.6094623", "0.60905737", "0.6074551", "0.6069336", "0.60691166", "0.606905", "0.606905", "0.606905", "0.606905", "0.606905", "0.6058055", "0.6058055", "0.6042766", "0.6042766", "0.6042766", "0.6025677", "0.60222024", "0.6014868", "0.599498", "0...
0.5916536
53
(See the note for writeScalar.)
function dropEndingNewline(string) { return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scalarScalar(a, b) {\n\t var x = a + b\n\t var bv = x - a\n\t var av = x - bv\n\t var br = b - bv\n\t var ar = a - av\n\t var y = ar + br\n\t if(y) {\n\t return [y, x]\n\t }\n\t return [x]\n\t}", "function scalarScalar(a, b) {\n\t var x = a + b\n\t var bv = x - a\n\t var av = x - bv\n\t ...
[ "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.57324404", "0.5670208", "0.5642623", "0.56310874", "0.5620793", "0.5614877", "0.5605067", "0.5533351", "0.55127835", "0.5507258", "0.5507258", "0.5...
0.0
-1
Note: a long line without a suitable break point will exceed the width limit. Preconditions: every char in str isPrintable, str.length > 0, width > 0.
function foldString(string, width) { // In folded style, $k$ consecutive newlines output as $k+1$ newlines— // unless they're before or after a more-indented line, or at the very // beginning or end, in which case $k$ maps to $k$. // Therefore, parse each chunk as newline(s) followed by a content line. var li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordWrap(str, width) {\n\t\tif (str.length <= width) return str;\n\t\tvar count = 0;\n\t\tvar newStr = [];\n\t\tfor (const char of str) {\n\t\t\tcount++;\n\t\t\tif (char === \"\\n\") {\n\t\t\t\tnewStr.push(char);\n\t\t\t\tcount = 0;\n\t\t\t} else if (count >= width) {\n\t\t\t\tnewStr.push(char + \"\\n\");...
[ "0.67308474", "0.64998955", "0.6404971", "0.63891506", "0.62890816", "0.6250449", "0.62337464", "0.62337464", "0.62337464", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.6182557", "0.618255...
0.5447545
90
Greedy line breaking. Picks the longest line under the limit each time, otherwise settles for the shortest line over the limit. NB. Moreindented lines cannot be folded, as that would add an extra \n.
function foldLine(line, width) { if (line === '' || line[0] === ' ') return line; // Since a more-indented line adds a \n, breaks can't be followed by a space. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. var match; // start is an inclusive index. end, curr, and next are exclu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_maxLineHack() {\n var display = this.cm.display, curOp = this.cm.curOp;\n const CLEARANCE = 3; /* space added to the right, in characters */\n display.maxLineChanged = false;\n if (curOp) {\n curOp.updateMaxLine = false;\n curOp.adjustWidthTo = (display.maxLine.t...
[ "0.61912745", "0.6155772", "0.6136653", "0.60758495", "0.59446704", "0.5905801", "0.5903518", "0.5903518", "0.5903518", "0.5895008", "0.5859297", "0.58386946", "0.5632553", "0.5621985", "0.55997616", "0.55528784", "0.5539872", "0.5539821", "0.55261034", "0.5514364", "0.549796...
0.5902871
29
Escapes a doublequoted string.
function escapeString(string) { var result = ''; var char, nextChar; var escapeSeq; for (var i = 0; i < string.length; i++) { char = string.charCodeAt(i); // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function escapeDoubleQuotes(text) {\n\treturn text.replace(/\"/g, '\\\\\"');\n}", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }",...
[ "0.75086665", "0.73967606", "0.73967606", "0.73967606", "0.73967606", "0.7339402", "0.732685", "0.7322355", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227", "0.7151227",...
0.0
-1
Serializes `object` and writes it to global `result`. Returns true on success, or false on invalid object.
function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; if (!detectType(state, object, false)) { detectType(state, object, true); } var type = _toString.call(state.dump); if (block) { block = (state.flowLevel < 0 || state.flowLevel > level); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stringify(object) {\n return JSON.stringify(object)\n }", "function serialize(object, options = {}) {\n // Unpack the options\n const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;\n const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? o...
[ "0.55372435", "0.550772", "0.5396421", "0.5378927", "0.53609836", "0.5304392", "0.5290606", "0.5290606", "0.5266007", "0.52468634", "0.5243715", "0.5241914", "0.523814", "0.5174504", "0.5168797", "0.5143203", "0.51339746", "0.51178324", "0.51143724", "0.51099664", "0.5109823"...
0.0
-1
The function whose prototype chain sequence wrappers inherit from.
function baseLodash() { // No operation performed. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get prototype() {}", "function FunctionWithPrototypeTest() {}", "function n(e,t){e.prototype.__proto__=t&&t.prototype,e.__proto__=t}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prototype;\n\tsubfn.prototype = new r();\n}", "function m(a){var b=function(){};re...
[ "0.63432866", "0.6205933", "0.58863425", "0.583783", "0.5753452", "0.5729398", "0.5729398", "0.5718173", "0.5718173", "0.5718173", "0.5718173", "0.5718173", "0.5715005", "0.5715005", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", ...
0.0
-1
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.67331547", "0.66229314", "0.65130246", "0.6456053", "0.62131137", "0.6201214", "0.6139392", "0.61100906", "0.6029288", "0.5966744", "0.59360605", "0.59072584", "0.59072584", "0.59072584", "0.59040016", "0.5900616", "0.5900616", "0.5900616", "0.58648694", "0.58648694", "0.5...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; this.size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7234546",...
0.0
-1
Removes all keyvalue entries from the map.
function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function multiMapRemo...
[ "0.7590112", "0.70694387", "0.6735414", "0.6652174", "0.6530006", "0.6267597", "0.62582785", "0.62582785", "0.62582785", "0.617115", "0.617115", "0.617115", "0.6166302", "0.61519635", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614...
0.0
-1
Removes all keyvalue entries from the stack.
function stackClear() { this.__data__ = new ListCache; this.size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear () {\n this._dict = {}\n this._stack = [this._dict]\n }", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear() {\n\t this.__...
[ "0.63577217", "0.63291264", "0.63291264", "0.63291264", "0.62734073", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006"...
0.0
-1
This method returns `undefined`.
function noop() { // No operation performed. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnUndefined() {}", "value() { return undefined; }", "function _undefined() {\n return exports.PREFIX.undefined;\n}", "function f () {\n return undefined;\n }", "_get(key) { return undefined; }", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "_get_value() ...
[ "0.7349204", "0.67813563", "0.6498075", "0.6468386", "0.6265139", "0.6195519", "0.6195519", "0.6195519", "0.6195519", "0.5957684", "0.5942946", "0.5942946", "0.59360754", "0.5919196", "0.5828133", "0.5788914", "0.57824624", "0.5770755", "0.5736466", "0.5725097", "0.57073194",...
0.0
-1
a State is a rule at a position from a given starting point in the input stream (reference)
function State(rule, dot, reference, wantedBy) { this.rule = rule; this.dot = dot; this.reference = reference; this.data = []; this.wantedBy = wantedBy; this.isComplete = this.dot === rule.symbols.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function State(rule, dot, reference, wantedBy) {\n this.rule = rule;\n this.dot = dot;\n this.reference = reference;\n this.data = [];\n this.wantedBy = wantedBy;\n this.isComplete = this.dot === rule.symbols.length;\n}", "function State(rule,dot,reference,wantedBy){this.rule=rule;this.dot=dot;...
[ "0.65215415", "0.64577216", "0.58783334", "0.57574743", "0.5714121", "0.5601528", "0.5595379", "0.55100155", "0.55064565", "0.54768157", "0.5473086", "0.5473086", "0.54487634", "0.54456496", "0.5404044", "0.5404044", "0.5393336", "0.53770375", "0.53709704", "0.53709704", "0.5...
0.6425298
3
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n ...
[ "0.6732616", "0.6635038", "0.661072", "0.6601085", "0.6600715", "0.6566089", "0.65076286", "0.64694375", "0.64637655", "0.6413088", "0.63718337", "0.6366774", "0.6366774", "0.6366774", "0.6366774", "0.63587356", "0.63286597", "0.632346", "0.6322866", "0.62971216", "0.62971216...
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\...
[ "0.6908266", "0.67753035", "0.6608242", "0.65383387", "0.6493603", "0.6488205", "0.6488205", "0.645129", "0.645129", "0.6428518", "0.64284635", "0.64030594", "0.64030594", "0.6395142", "0.6395142", "0.6395142", "0.6395142", "0.6395142", "0.6395142", "0.6395142", "0.6395142", ...
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for type...
[ "0.68783337", "0.6854942", "0.6854942", "0.6854942", "0.6854942", "0.6853652", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "0.68482035", "...
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n ...
[ "0.65988296", "0.6565237", "0.6559532", "0.6559532", "0.6559532", "0.6559532", "0.6522337", "0.65215486", "0.65060395", "0.65060395", "0.65060395", "0.65060395", "0.65060395", "0.65013695", "0.6489755", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.64777...
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n...
[ "0.7730571", "0.74697196", "0.74697196", "0.74258965", "0.7164231", "0.71448183", "0.7083163", "0.7080694", "0.6995368", "0.6971116", "0.6901662", "0.6883398", "0.67147285", "0.66557264", "0.6639163", "0.6611592", "0.6611592", "0.6611592", "0.6611592", "0.6600893", "0.6599787...
0.0
-1
Create a factory that creates HTML tag elements.
function createDOMFactory(type) { var factory = React.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be // easily accessed on elements. E.g. `<Foo />.type === Foo`. // This should not be named `constructor` since this may not be the function // tha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEl(tag){\n return document.createElement(tag);\n}", "function elementFactory(tag, text, css) {\n var element = document.createElement(tag);\n var innerHTML = document.createTextNode(text);\n\n element.appendChild(innerHTML);\n if(css !== '') {\n if(typeof css === 'string') {\n eleme...
[ "0.7087224", "0.7012231", "0.68404186", "0.67985576", "0.67218196", "0.6653159", "0.6594526", "0.6592767", "0.655653", "0.6549683", "0.6536307", "0.65296376", "0.6521061", "0.6510798", "0.646388", "0.64369357", "0.6434278", "0.6424656", "0.6404411", "0.63769203", "0.6364542",...
0.600104
65
Recomputes the plugin list using the injected plugins and plugin ordering.
function recomputePluginOrdering() { if (!eventPluginOrder) { // Wait until an `eventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName]; var pluginIndex = eventPluginOrder.indexOf(pluginName); !(pluginIndex > -1) ? invaria...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderPlugins() {\r\n debug('orderPlugins:before', this.pluginNames);\r\n const runLast = this._plugins\r\n .filter(p => p.requirements.has('runLast'))\r\n .map(p => p.name);\r\n for (const name of runLast) {\r\n const index = this._plugins.findIndex(p => p.name...
[ "0.7994826", "0.74705356", "0.71697074", "0.7136579", "0.7136579", "0.7136579", "0.71291363", "0.7123043", "0.7119059", "0.71177113", "0.71177113", "0.71177113", "0.710143", "0.710143", "0.710143", "0.70917714", "0.70917714", "0.70917714", "0.70917714", "0.70917714", "0.70917...
0.0
-1
Standard/simple iteration through an event's collected dispatches.
function executeDispatchesInOrder(event, simulated) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break...
[ "0.6340201", "0.6318283", "0.6216154", "0.6129209", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6119329", "0.6119329", "0.61154145", "0.60784554", "0.60784554", "0.60784554", "0.60784554", "0.60784554", "0.6078455...
0.0
-1
Given a DOM node, return the closest ReactDOMComponent or ReactDOMTextComponent instance ancestor.
function getClosestInstanceFromNode(node) { if (node[internalInstanceKey]) { return node[internalInstanceKey]; } while (!node[internalInstanceKey]) { if (node.parentNode) { node = node.parentNode; } else { // Top of the tree. This node must not be part of a React tree (or is // unmo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[...
[ "0.7372026", "0.7372026", "0.7372026", "0.7372026", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.73251814", "0.7309252", "0.7309252", "0...
0.0
-1
Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent instance, or null if the node was not rendered by this React.
function getInstanceFromNode$1(node) { var inst = node[internalInstanceKey]; if (inst) { if (inst.tag === HostComponent || inst.tag === HostText) { return inst; } else { return null; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof react__WEBPACK_IMPORTED_MODULE_0__.Component) {\n return react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(node);\n }\n return null;\n}", "function findFirstReactDOMImpl(node) {\n\t\t // This n...
[ "0.75965786", "0.7380417", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.7350097", "0.73300976", "0.73300976", "0.73300976",...
0.0
-1
Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding DOM node.
function getNodeFromInstance$1(inst) { if (inst.tag === HostComponent || inst.tag === HostText) { // In Fiber this, is just the state node right now. We assume it will be // a host component or host text. return inst.stateNode; } // Without this first invariant, passing a non-DOM-component triggers t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n\t\t // This node might be from another React instance, so we make sure not to\n\t\t // examine the node cache here\n\t\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t\t if (node.nodeType !== 1) {\n\t\t // Not a DOMElement, therefore not a...
[ "0.67848456", "0.6778149", "0.6772021", "0.6766768", "0.6766768", "0.6752285", "0.67427766", "0.674125", "0.674125", "0.674125", "0.674125", "0.674125", "0.674125", "0.6741039", "0.6741039", "0.6741039", "0.6741039", "0.6741039", "0.6741039", "0.6741039", "0.67319804", "0.6...
0.0
-1
Return the lowest common ancestor of A and B, or null if they are in different trees.
function getLowestCommonAncestor(instA, instB) { var depthA = 0; for (var tempA = instA; tempA; tempA = getParent(tempA)) { depthA++; } var depthB = 0; for (var tempB = instB; tempB; tempB = getParent(tempB)) { depthB++; } // If A is deeper, crawl up. while (depthA - depthB > 0) { instA = g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLowestCommonAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromIns...
[ "0.82778895", "0.82778895", "0.82778895", "0.8273446", "0.8273446", "0.8273446", "0.8255146", "0.8230099", "0.8230099", "0.8230099", "0.8230099", "0.8200897", "0.8200273", "0.8185259", "0.8185259", "0.8185259", "0.8185259", "0.8185259", "0.8185259", "0.8185259", "0.8185259", ...
0.0
-1
Return if A is an ancestor of B. Return the parent instance of the passedin instance.
function getParentInstance(inst) { return getParent(inst); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : in...
[ "0.7309921", "0.7309921", "0.7309921", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73099107", "0.73070306", "0.73039186", "0.73039186", "0.73039186", "0.71653056", "0.70357543", "0.70357543", "0.7020314", ...
0.0
-1
Simulates the traversal of a twophase, capture/bubble event dispatch.
function traverseTwoPhase(inst, fn, arg) { var path = []; while (inst) { path.push(inst); inst = getParent(inst); } var i = void 0; for (i = path.length; i-- > 0;) { fn(path[i], 'captured', arg); } for (i = 0; i < path.length; i++) { fn(path[i], 'bubbled', arg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent...
[ "0.58791095", "0.58791095", "0.58791095", "0.58791095", "0.58791095", "0.58791095", "0.5860188", "0.58587825", "0.58587825", "0.58587825", "0.58587825", "0.5663513", "0.5630192", "0.5587722", "0.5569497", "0.5569497", "0.5562592", "0.5548963", "0.5548963", "0.5548963", "0.554...
0.0
-1
Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that should would receive a `mouseEnter` or `mouseLeave` event. Does not invoke the callback on the nearest common ancestor because nothing "entered" or "left" that element.
function traverseEnterLeave(from, to, fn, argFrom, argTo) { var common = from && to ? getLowestCommonAncestor(from, to) : null; var pathFrom = []; while (true) { if (!from) { break; } if (from === common) { break; } var alternate = from.alternate; if (alternate !== null && alte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleMouseEnter() {\n this._hovered.next(this);\n }", "_elementMouseEnterHandler() {\n const that = this;\n\n if (that.clickMode === 'hover' && !that.disabled && !that.readonly) {\n that._handleMouseInteraction();\n }\n }", "_elementMouseEnterHandler() {\n ...
[ "0.50938433", "0.49230218", "0.49230218", "0.48820615", "0.48795786", "0.48795786", "0.48697004", "0.48644733", "0.4798072", "0.4776119", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.4734976", "0.47289...
0.0
-1
Some event types have a notion of different registration names for different "phases" of propagation. This finds listeners by a given phase.
function listenerAtPhase(inst, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(inst, registrationName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t\t return getListener(inst, registrationName);\n\t\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispat...
[ "0.6933484", "0.6933484", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6932607", "0.6926106", "0.6926106", "0.6901754", "0.6901754", "0.6901754", "0.6901754", "...
0.0
-1
A small set of propagation patterns, each of which will accept a small amount of information, and generate a set of "dispatch ready event objects" which are sets of events that have already been annotated with a set of dispatched listener functions/ids. The API is designed this way to discourage these propagation strat...
function accumulateDirectionalDispatches(inst, phase, event) { { !inst ? warning(false, 'Dispatching inst must not be null') : void 0; } var listener = listenerAtPhase(inst, event, phase); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); event._dispatchI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDirectionalDispatches(inst,upwards,event){if(process.env.NODE_ENV!=='production'){process.env.NODE_ENV!=='production'?warning(inst,'Dispatching inst must not be null'):void 0;}var phase=upwards?PropagationPhases.bubbled:PropagationPhases.captured;var listener=listenerAtPhase(inst,event,phase);if...
[ "0.6350786", "0.6350786", "0.6247749", "0.62328684", "0.60861367", "0.60861367", "0.60861367", "0.60861367", "0.60861367", "0.5958953", "0.5958953", "0.5952106", "0.5944571", "0.5944571", "0.5927643", "0.5927643", "0.59275264", "0.59275264", "0.59275264", "0.59275264", "0.592...
0.0
-1
Collect dispatches (must be entirely collected before dispatching see unit tests). Lazily allocate the array to conserve memory. We must loop through each event and perform the traversal for each one. We cannot perform a single traversal for the entire collection of events because each event may have a different target...
function accumulateTwoPhaseDispatchesSingle(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances...
[ "0.60375905", "0.60375905", "0.60375905", "0.60375905", "0.60375905", "0.59032416", "0.58940375", "0.58940375", "0.58940375", "0.58940375", "0.5876829", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.579...
0.0
-1
Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { var targetInst = event._targetInst; var parentInst = targetInst ? getParentInstance(targetInst) : null; traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDi...
[ "0.7413974", "0.7413974", "0.7413974", "0.7413974", "0.7413974", "0.7403243", "0.7403243", "0.7403243", "0.737805", "0.7365441", "0.7320921", "0.7320921", "0.73002684", "0.72855204", "0.72855204", "0.72855204", "0.72855204", "0.72855204", "0.72855204", "0.72855204", "0.728552...
0.7298637
59
Accumulates without regard to direction, does not look for phased registration names. Same as `accumulateDirectDispatchesSingle` but without requiring that the `dispatchMarker` be the same as the dispatched ID.
function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName; var listener = getListener(inst, registrationName); if (listener) { event._dispatchListeners = accumulateInto(eve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulate...
[ "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745", "0.74662745"...
0.0
-1
Do not uses the below two methods directly! Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. (It is the only module that is allowed to access these methods.)
function unsafeCastStringToDOMTopLevelType(topLevelType) { return topLevelType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,targetInst,nativeEvent,nativeEventTarget);runEventQueueInBatch(events);}", "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,tar...
[ "0.6449749", "0.6449749", "0.6449749", "0.63349396", "0.6323711", "0.62636024", "0.622248", "0.6149773", "0.6149773", "0.6149773", "0.6149773", "0.6149773", "0.60983765", "0.60983765", "0.6082075", "0.59561354", "0.59380305", "0.58962786", "0.58962786", "0.58962786", "0.58962...
0.0
-1
Return whether a native keypress event is assumed to be a command. This is required because Firefox fires `keypress` events for key commands (cut, copy, selectall, etc.) even though no character is inserted.
function isKeypressCommand(nativeEvent) { return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isKeypressCommand(nativeEvent) {\n\t return (\n\t (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey)\n\t );\n\t}", "function isKeypressCommand(nativeEvent...
[ "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80083644", "0.79994756", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998482", "0.7998...
0.0
-1
This function can only be called with a workinprogress fiber and only during begin or complete phase. Do not call it under any other circumstances.
function getStackAddendumByWorkInProgressFiber(workInProgress) { var info = ''; var node = workInProgress; do { info += describeFiber(node); // Otherwise this return pointer might point to the wrong tree: node = node.return; } while (node); return info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (\n workInProgressSuspendedReason === SuspendedOnData &&\n workInProgressRoot === root\n ) {\n // Mark the root as ready to continue rendering.\n workInProgressSuspendedReason = SuspendedAndReadyToContinue;\n }", "function g...
[ "0.6055185", "0.6040343", "0.59954184", "0.59954184", "0.59954184", "0.58810025", "0.58022887", "0.57078326", "0.56556517", "0.56357723", "0.5588384", "0.5558378", "0.5517867", "0.55155945", "0.551355", "0.54839903", "0.54772514", "0.544112", "0.544112", "0.544112", "0.544112...
0.5390318
76
Get the value for a property on a node. Only used in DEV for SSR validation. The "expected" argument is used as a hint of what the expected value is. Some properties have multiple equivalent values.
function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { var attributeName = propertyInfo.attributeName; var stringValue = null; if (propertyInfo.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueForProperty(node,name,expected){{var propertyInfo=getPropertyInfo(name);if(propertyInfo){var mutationMethod=propertyInfo.mutationMethod;if(mutationMethod||propertyInfo.mustUseProperty){return node[propertyInfo.propertyName];}else{var attributeName=propertyInfo.attributeName;var stringValue=null;if...
[ "0.81597364", "0.81597364", "0.8144743", "0.8068788", "0.8068788", "0.80650955", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", "0.80606514", ...
0.0
-1
Get the value for a attribute on a node. Only used in DEV for SSR validation. The third argument is used as a hint of what the expected value is. Some attributes have multiple equivalent values.
function getValueForAttribute(node, name, expected) { { if (!isAttributeNameSafe(name)) { return; } if (!node.hasAttribute(name)) { return expected === undefined ? undefined : null; } var value = node.getAttribute(name); if (value === '' + expected) { return expected; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "function getValueForAttribute(node,name,expected){{if(!i...
[ "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.7426042", "0.73294044", "0.73294044", "0.73260397", "0.7322676", "0.7322676", "0.7322676", "0.7322676", "0.7322676", "0.7322676", "0.7322676", "0.7322676", ...
0.0
-1
Implements an host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not null/undef...
function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = _assign({}, props, { defaultChecked: undefined, defaultValue: undefined, value: undefined, checked: checked != null ? checked : node._wrapperState.initialChecked }); return hostProps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.value = props.value;\n this.id = RadioButton.idGenerator(this.value);\n this.groupName = props.groupName;\n this.optional = {};\n if (typeof props.onChangeCallback === 'function') {\n this.optional.onChangeCallback =\n...
[ "0.6890673", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.6785545", "0.63877356", "0.62561625", "0.6210559", "0.6131126", "0.6131126", "0.6131126", "0.6131126", "0.6131126", "0.6131126", "0.6131126", "0.6131126", ...
0.0
-1
In Chrome, assigning defaultValue to certain input types triggers input validation. For number inputs, the display value loses trailing decimal points. For email inputs, Chrome raises "The specified value is not a valid email address". Here we check to see if the defaultValue has actually changed, avoiding these proble...
function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== 'number' || node.ownerDocument.activeElement !== node) { if (value == null) { node.defaultValue = '' + node._wrapperState.initialValue; } else if (node.defaultValue !== ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldSetInputTextToDefaultValue (props) {\n let result = (this.previousDefaultValue != props.defaultValue) || (this.previousChangeIndicator != props.changeIndicator)\n return result\n }", "function checkValue(value, defaultValue) {\n return (value ? value : defaultValue)\n }", "function setDe...
[ "0.7002995", "0.66457564", "0.65495944", "0.65495944", "0.6510807", "0.6510807", "0.65021855", "0.65021855", "0.65021855", "0.65021855", "0.65021855", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.6381883", "0.63741...
0.0
-1
SECTION: handle `change` event
function shouldUseChangeEvent(elem) { var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change(/*event*/) {\n this._super(...arguments);\n this._parse();\n }", "handleChange(event) {\n this.dispatchEvent(new CustomEvent('change', {detail: event.target.value}));\n }", "onchange() {}", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}...
[ "0.7854437", "0.77068484", "0.7598262", "0.7521723", "0.7511005", "0.7504069", "0.7448793", "0.7420877", "0.7401912", "0.7386296", "0.73666596", "0.73555636", "0.73510677", "0.73496395", "0.73438835", "0.7339759", "0.73381084", "0.73354316", "0.73326874", "0.7328343", "0.7321...
0.0
-1
(For IE <=9) Starts tracking propertychange events on the passedin element and override the value property so that we can distinguish user events from value changes in JS.
function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElement.attachEvent('onpropertychange', handlePropertyChange); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('on...
[ "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.74985516", "0.7280844", "0.7193671", "0.7193671", "0.70448834", "0.7032214", "0.70233506", "0.6934341", "0.6934341", "0...
0.0
-1
(For IE <=9) Removes the event listeners from the currentlytracked element, if any exists.
function stopWatchingForValueChange() { if (!activeElement) { return; } activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementInst = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "function removeListeners(useCapturing) {\r\r\n // get all div in list\r\r\...
[ "0.75100756", "0.7134596", "0.710348", "0.70854056", "0.70854056", "0.70752424", "0.705488", "0.7043779", "0.70388514", "0.7013583", "0.7004919", "0.6984396", "0.6976549", "0.69420594", "0.6922267", "0.6918258", "0.6913697", "0.6898917", "0.6863952", "0.6862534", "0.6861944",...
0.0
-1
(For IE <=9) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } if (getInstIfValueChanged(activeElementInst)) { manualDispatchChangeEvent(nativeEvent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('on...
[ "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.7171032", "0.6944243", "0.6842561", "0.68339026", "0.6746077", "0.6695916", "0.6695916", "0.6695916", "0.6695916", "0.6695916", ...
0.0
-1
For IE8 and IE9.
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) { if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLowIE9() {\r\n var e = window.navigator.userAgent.toString().toUpperCase();\r\n var flag = false;\r\n if (e.indexOf(\"MSIE\") >= 0) {\r\n\r\n if (e.indexOf(\"MSIE 6.0\") > 0) flag = true;\r\n if (e.indexOf(\"MSIE 7.0\") > 0) flag = true;\r\n if (e.in...
[ "0.71892583", "0.7018611", "0.6990977", "0.6990977", "0.67857254", "0.6689359", "0.65084034", "0.64540815", "0.64540815", "0.6431494", "0.6362608", "0.63479495", "0.62849253", "0.6247649", "0.6229919", "0.6197086", "0.61709774", "0.6158672", "0.61451566", "0.61313784", "0.611...
0.0
-1
SECTION: handle `click` event
function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (elem.type ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick( event ){ }", "handleClick() {}", "function handleClick(){\n console.log(\"clicked\");\n}", "function handleClick(event)\n{\n}", "click() { }", "function clickHandler(){\n console.log('I am clicked');\n}", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSect...
[ "0.8123866", "0.7879277", "0.7531671", "0.7500634", "0.7475805", "0.7402668", "0.73915786", "0.7379595", "0.7379595", "0.7331232", "0.7330436", "0.7245654", "0.72390676", "0.72122186", "0.7116352", "0.7082111", "0.7062615", "0.7056091", "0.7017624", "0.7006748", "0.6982211", ...
0.0
-1
IE8 does not implement getModifierState so we simply map it to the only modifier keys exposed by the event itself, does not support Lockkeys. Currently, all major browsers except Chrome seems to support Lockkeys.
function modifierStateGetter(keyArg) { var syntheticEvent = this; var nativeEvent = syntheticEvent.nativeEvent; if (nativeEvent.getModifierState) { return nativeEvent.getModifierState(keyArg); } var keyProp = modifierKeyToProp[keyArg]; return keyProp ? !!nativeEvent[keyProp] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifierStateGetter(keyArg){var syntheticEvent=this;var nativeEvent=syntheticEvent.nativeEvent;if(nativeEvent.getModifierState){return nativeEvent.getModifierState(keyArg);}var keyProp=modifierKeyToProp[keyArg];return keyProp?!!nativeEvent[keyProp]:false;}", "function modifierStateGetter(keyArg){var syn...
[ "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.73103", "0.72735363", "0.7215798", "0.7187312", "0.7187312", "0.71068054", "0.70859236", "0.70859236", "0.69601", ...
0.0
-1
`ReactInstanceMap` maintains a mapping from a public facing stateful instance (key) and the internal representation (value). This allows public methods to accept the user facing instance as an argument and map them back to internal methods. Note that this module is currently shared and assumed to be stateless. If this ...
function get(key) { return key._reactInternalFiber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapWrapper(key)\n{\n\tthis.key = key;\n}", "function Map() {\n this.container = new Object();\n}", "function Map() {\r\n this.keys = [];\r\n this.values = [];\r\n}", "function Map() {\n\tthis.keys = [];\n\tthis.values = [];\n\n\t// add a key / value pair to map\n\tthis.add = function(key, v...
[ "0.56226665", "0.54416645", "0.5437218", "0.5427679", "0.52922314", "0.52269", "0.5219736", "0.51513004", "0.5148289", "0.51441056", "0.51216936", "0.51147085", "0.5111892", "0.51110727", "0.50542724", "0.5044242", "0.5023131", "0.5023131", "0.4996279", "0.4996279", "0.499627...
0.0
-1
Find the deepest React component completely containing the root of the passedin instance (for use when entire React trees are nested within each other). If React trees are not nested, returns null.
function findRootContainerNode(inst) { // TODO: It may be a good idea to cache this to prevent unnecessary DOM // traversal, but caching is difficult to do correctly without using a // mutation observer to listen for all DOM changes. while (inst.return) { inst = inst.return; } if (inst.tag !== HostRoot)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n ...
[ "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.68749243", "0.6796577", "0.6796577", "0.6796577", "0.6796577", "0.6796577", "0.6796577", "0...
0.0
-1
Used to store ancestor hierarchy in top level callback
function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) { if (callbackBookkeepingPool.length) { var instance = callbackBookkeepingPool.pop(); instance.topLevelType = topLevelType; instance.nativeEvent = nativeEvent; instance.targetInst = targetInst; return instance; } re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullAncestor(node, callback, baseVisitor, state) {\n if (!baseVisitor) { baseVisitor = base; }\n var ancestors = []\n ;(function c(node, st, override) {\n var type = override || node.type;\n var isNew = node !== ancestors[ancestors.length - 1];\n if (isNew) { ancestors.push(node); ...
[ "0.63650066", "0.63650066", "0.63517284", "0.6194851", "0.60661834", "0.59946203", "0.59337914", "0.5927715", "0.5798319", "0.57487017", "0.5732234", "0.56577903", "0.5634935", "0.5633306", "0.56213325", "0.5599346", "0.5596999", "0.5585871", "0.5580441", "0.5567022", "0.5566...
0.0
-1
Implements an host component that warns when `selected` is set.
function validateProps(element, props) { // TODO (yungsters): Remove support for `selected` in <option>. { if (props.selected != null && !didWarnSelectedSetOnOption) { warning(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.'); didWarnSelect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get _shouldUpdateSelection(){return this.selected!=null;}", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { ...
[ "0.5836068", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.57184714", "0.5654467", "0.55860525", "0.5576725", "0.55757415", "0.5562336", "0.5562336", "0.55441296", "...
0.5188575
81
Validation function for `value` and `defaultValue`.
function checkSelectPropTypes(props) { ReactControlledValuePropTypes.checkPropTypes('select', props, getCurrentFiberStackAddendum$3); for (var i = 0; i < valuePropNames.length; i++) { var propName = valuePropNames[i]; if (props[propName] == null) { continue; } var isArray = Array.isArray(prop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "'validateValue'(value) {}", "function checkValue(value, defaultValue) {\n return (value ? value : defaultValue)\n }", "function validateInput(\n value,\n { float, canBeNegative, canBeEmpty, defaultValue }\n) {\n if (`${value}`.length > 0) {\n const valueAsNumber = float ? parseFloat(value) : pa...
[ "0.7436162", "0.6856192", "0.65868", "0.6431272", "0.64279246", "0.64279246", "0.6416799", "0.6416799", "0.6416799", "0.6316331", "0.6230596", "0.6195563", "0.616348", "0.61238676", "0.6050824", "0.6044303", "0.6036909", "0.59743184", "0.59359854", "0.58691984", "0.58653325",...
0.0
-1
Implements a host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option will trigg...
function getHostProps$2(element, props) { return _assign({}, props, { value: undefined }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectValueType(props,propName,componentName){if(props[propName]==null){return null;}if(props.multiple){if(!Array.isArray(props[propName])){return new Error(\"The `\"+propName+\"` prop supplied to <select> must be an array if \"+\"`multiple` is true.\");}}else {if(Array.isArray(props[propName])){return ne...
[ "0.6098947", "0.60637647", "0.58246845", "0.58246845", "0.5734163", "0.57121176", "0.57060874", "0.57060874", "0.57060874", "0.57060874", "0.57060874", "0.5686245", "0.5681213", "0.56413835", "0.56330454", "0.56330454", "0.56330454", "0.56330454", "0.56330454", "0.56330454", ...
0.0
-1
Implements a host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is supplied (and not ...
function getHostProps$3(element, props) { var node = element; !(props.dangerouslySetInnerHTML == null) ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0; // Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is mutated...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set value(val) {\n if (this.#el) this.#el.value = val;\n else this.#value = val;\n }", "setValue(value){\n const thisWidget = this;\n const newValue = thisWidget.parseValue(value);\n \n /* TODO: Add validation */\n if(newValue !=thisWidget.value && thisWidget.isValid(newValue)){\n this...
[ "0.64194894", "0.5993452", "0.59779125", "0.59779125", "0.59779125", "0.59779125", "0.59779125", "0.59779125", "0.59779125", "0.5952545", "0.5928599", "0.5900086", "0.5880415", "0.5880415", "0.5880415", "0.5880415", "0.5880415", "0.5880415", "0.5880415", "0.5823071", "0.57661...
0.0
-1
Assumes there is no parent namespace.
function getIntrinsicNamespace(type) { switch (type) { case 'svg': return SVG_NAMESPACE; case 'math': return MATH_NAMESPACE; default: return HTML_NAMESPACE$1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParentObject(){\r\n var obj = parent;\r\n if (namespace !== \"\") {\r\n for (var i = 0, ii = namespace.split(\".\"); i < ii.length; i++) {\r\n obj = obj[ii[i]];\r\n }\r\n }\r\n return obj.easyXDM;\r\n}", "function namespaceHTMLInternal() {\n instructionState.lF...
[ "0.59294087", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.57438385", "0.56890935", "0.5673484", "0.56610936", "0.5640146", "0.5580239", "0.544239", "0.5442175", "0.5410278", "0.5397606", "0.53690296", "0.53592485", "0.5327534", "0.532705",...
0.0
-1
Operations for dealing with CSS properties. This creates a string that is expected to be equivalent to the style attribute generated by serverside rendering. It bypasses warnings and security checks so it's not safe to use this value for anything other than comparison. It is only used in DEV for SSR validation.
function createDangerousStringForStyles(styles) { { var serialized = ''; var delimiter = ''; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = styles[styleName]; if (styleValue != null) { var isCustomProperty = sty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get styles () {\n return css`${unsafeCSS(style)}`\n }", "get cssText() {\n var properties = [];\n for (var i = 0, length = this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (p...
[ "0.67464244", "0.661183", "0.6600644", "0.65224516", "0.65224516", "0.64343566", "0.64050084", "0.6367678", "0.6296773", "0.61987394", "0.6183087", "0.617019", "0.617019", "0.61692977", "0.6166631", "0.61150366", "0.6076142", "0.6076142", "0.60742265", "0.60742265", "0.607422...
0.0
-1
Calculate the diff between the two objects.
function diffProperties$1(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) { { validatePropertiesInDevelopment(tag, nextRawProps); } var updatePayload = null; var lastProps = void 0; var nextProps = void 0; switch (tag) { case 'input': lastProps = getHostProps(domElement, l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function diff(a, b) {\n totalDifference += Math.abs(a - b);\n }", "getDifference(other) {\n return {\n xDiff: other.x - this.x,\n yDiff: other.y - this.y,\n };\n }", "functi...
[ "0.73584795", "0.70092916", "0.6960951", "0.6865758", "0.6865758", "0.6865758", "0.6865758", "0.6865758", "0.6865758", "0.66720665", "0.6600449", "0.65714246", "0.65645313", "0.6558132", "0.65098464", "0.6492369", "0.6446226", "0.6443762", "0.6413908", "0.6397446", "0.6332192...
0.0
-1
Renderers that don't support persistence can reexport everything from this module.
function shim() { invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)", "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug...
[ "0.627087", "0.627087", "0.627087", "0.627087", "0.6055511", "0.6055511", "0.6055511", "0.6019565", "0.6019565", "0.6019565", "0.6019565", "0.5889982", "0.5829564", "0.5828152", "0.5709535", "0.5709535", "0.56598616", "0.5428593", "0.5428593", "0.5421229", "0.5421229", "0.5...
0.55839
54
1 unit of expiration time represents 10ms.
function msToExpirationTime(ms) { // Always add an offset so that we don't clash with the magic number for NoWork. return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_O...
[ "0.69083685", "0.69083685", "0.69083685", "0.69083685", "0.68177795", "0.68177795", "0.68177795", "0.6728504", "0.66832036", "0.66832036", "0.66832036", "0.6663674", "0.66431606", "0.66385615", "0.65983444", "0.65983444", "0.65983444", "0.6567885", "0.65556103", "0.65173113", ...
0.6494671
67
This is used to create an alternate fiber to do work on.
function createWorkInProgress(current, pendingProps, expirationTime) { var workInProgress = current.alternate; if (workInProgress === null) { // We use a double buffering pooling technique because we know that we'll // only ever need at most two versions of a tree. We pool the "other" unused // node tha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createFiber(func) {\n return this.createLaxFiber.apply(this, __arguments.withContext(this.LAX_EMPTY_CONTEXT, arguments));\n }", "function createWorkInProgress(current, pendingProps, expirationTime) {\n var workInProgress = current.alternate;\n if (workInProgress === null) {\n // We use a double bu...
[ "0.619161", "0.5820947", "0.5820947", "0.5820947", "0.5820947", "0.5820947", "0.5820947", "0.5820947", "0.57810336", "0.5733009", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "0.5643758", "...
0.561368
30
Used for stashing WIP properties to replay failed work in DEV.
function assignFiberPropertiesInDEV(target, source) { if (target === null) { // This Fiber's initial properties will always be overwritten. // We only use a Fiber to ensure the same hidden class so DEV isn't slow. target = createFiber(IndeterminateComponent, null, null, NoContext); } // This is inten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if (enableProfilerTimer && unitOfWork.mode & ProfileMode) {\n // Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n }", "function InternalBreakpointState() { }", "function InternalBreakpointState() {}", ...
[ "0.6011011", "0.54045147", "0.53980833", "0.53980833", "0.5266002", "0.5239496", "0.5219925", "0.51719093", "0.5114947", "0.50887054", "0.5083666", "0.5075196", "0.50734526", "0.5067331", "0.5053954", "0.50185883", "0.49673146", "0.4958323", "0.494461", "0.49131462", "0.49120...
0.0
-1
TODO: This should be lifted into the renderer.
function createFiberRoot(containerInfo, isAsync, hydrate) { // Cyclic construction. This cheats the type system right now because // stateNode is any. var uninitializedFiber = createHostRootFiber(isAsync); var root = { current: uninitializedFiber, containerInfo: containerInfo, pendingChildren: null,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static rendered () {}", "static rendered () {}", "render() {\n // Subclasses should override\n }", "render() {\n\n\t}", "render() {\n\n\t}", "function render() {\n\n\t\t\t}", "_render() {}", "_firstRendered() { }", "function TextRenderer(){}// no need for block level renderers", "function ren...
[ "0.704517", "0.704517", "0.69010174", "0.6737739", "0.6737739", "0.6670251", "0.6618646", "0.6586606", "0.6582253", "0.6540401", "0.65195984", "0.6474389", "0.64730567", "0.64730567", "0.64730567", "0.64297307", "0.64223486", "0.63653326", "0.63653326", "0.63407457", "0.63215...
0.0
-1
Invokes the mount lifecycles on a previously never rendered instance.
function mountClassInstance(workInProgress, renderExpirationTime) { var ctor = workInProgress.type; { checkClassInstance(workInProgress); } var instance = workInProgress.stateNode; var props = workInProgress.pendingProps; var unmaskedContext = getUnmaskedContext(workInProgress); instance.props = pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mount() {\n this.willMount();\n this.render();\n this.didMount();\n }", "componenetWillMount() { }", "function runMountCallback() {\n if (!hasMountCallbackRun && currentMountCallback) {\n hasMountCallbackRun = true;\n reflow(popper);\n currentMountCallback();\n...
[ "0.69563764", "0.676621", "0.6732734", "0.6719309", "0.649951", "0.6378189", "0.6375986", "0.6356537", "0.6339795", "0.6286211", "0.62473047", "0.6208389", "0.6208389", "0.6208389", "0.6208389", "0.6208389", "0.6208389", "0.61906123", "0.61906123", "0.6090201", "0.6086474", ...
0.0
-1
Invokes the update lifecycles and returns false if it shouldn't rerender.
function updateClassInstance(current, workInProgress, renderExpirationTime) { var ctor = workInProgress.type; var instance = workInProgress.stateNode; var oldProps = workInProgress.memoizedProps; var newProps = workInProgress.pendingProps; instance.props = oldProps; var oldContext = instance.context; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "needsUpdate() {\n // Call subclass lifecycle method\n return (\n this.internalState.needsUpdate ||\n this.hasUniformTransition() ||\n this.shouldUpdateState(this._getUpdateParams())\n );\n // End lifecycle method\n }", "shouldComponentUpdate(next_props){\n if (!next_props.update){\...
[ "0.7417363", "0.7368783", "0.7323216", "0.72973084", "0.7290934", "0.71080285", "0.7068321", "0.70315564", "0.702067", "0.6998804", "0.69619256", "0.69619256", "0.6941111", "0.6923462", "0.689142", "0.6843491", "0.6839045", "0.68324697", "0.6774192", "0.67656595", "0.67656595...
0.0
-1
This wrapper function exists because I expect to clone the code in each path to be able to optimize each path individually by branching early. This needs a compiler or we can do it manually. Helpers that don't need this branching live outside of this function.
function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { if (!shouldTrackSideEffects) { // Noop. return; } // Deletions are added in reversed order so we add it to the front. // At this point, the return fiber's effect list is empty except for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being tha...
[ "0.55674225", "0.53212273", "0.5182542", "0.518027", "0.5171562", "0.51550424", "0.51284516", "0.5106238", "0.5089448", "0.508023", "0.498055", "0.49449962", "0.49323848", "0.49047467", "0.48439628", "0.48303586", "0.48161054", "0.48044205", "0.4796409", "0.4795924", "0.47891...
0.0
-1
Warns if there is a duplicate or missing key
function warnOnInvalidKey(child, knownKeys) { { if (typeof child !== 'object' || child === null) { return knownKeys; } switch (child.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: warnForMissingKey(child); var key = child.key; if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDuplicates(error) {\n if (error.name === \"MongoError\" && error.code === 11000) {\n // check if the error from Mongodb is duplication error\n // eslint-disable-next-line no-useless-escape\n const regex = /index\\:\\ (?:.*\\.)?\\$?(?:([_a-z0-9]*)(?:_\\d*)|([_a-z0-9]*))\\s*dup key/i;\n c...
[ "0.64586234", "0.63743407", "0.62774295", "0.61566454", "0.61478174", "0.61425227", "0.61372644", "0.61251426", "0.61251426", "0.61219513", "0.6114083", "0.6114083", "0.6114083", "0.61133426", "0.61059004", "0.6096614", "0.60936666", "0.6082668", "0.5989997", "0.59782195", "0...
0.0
-1
This API will tag the children with the sideeffect of the reconciliation itself. They will be added to the sideeffect list as we pass through the children and the parent.
function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { // This function is not recursive. // If the top level item is an array, we treat it as a set of children, // not as a fragment. Nested arrays on the other hand will be treated as // fragment nodes. Recursion happe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) // Noop.\n return;\n // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's ...
[ "0.69689286", "0.6940482", "0.6940482", "0.6940482", "0.6940482", "0.6933627", "0.6933627", "0.6933627", "0.6933627", "0.6933627", "0.6933627", "0.6927816", "0.6927816", "0.6927816", "0.6927629", "0.6927629", "0.6927629", "0.6923651", "0.6921517", "0.69135743", "0.6900002", ...
0.0
-1
TODO: Remove this and use reconcileChildrenAtExpirationTime directly.
function reconcileChildren(current, workInProgress, nextChildren) { reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reconcileChildren(current,workInProgress,nextChildren){reconcileChildrenAtExpirationTime(current,workInProgress,nextChildren,workInProgress.expirationTime);}", "function reconcileChildren(current,workInProgress,nextChildren){reconcileChildrenAtExpirationTime(current,workInProgress,nextChildren,workInPro...
[ "0.823957", "0.823957", "0.823957", "0.823957", "0.823957", "0.78228706", "0.77402437", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7718201", "0.7...
0.7481744
60
TODO: Delete memoizeProps/State and move to reconcile/bailout instead
function memoizeProps(workInProgress, nextProps) { workInProgress.memoizedProps = nextProps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoizeProps(workInProgress, nextProps) {\n\t workInProgress.memoizedProps = nextProps;\n\t }", "function memoizeProps(workInProgress, nextProps) {\n workInProgress.memoizedProps = nextProps;\n }", "function memoizeProps(workInProgress, nextProps) {\n workInProgress.memoizedProps = ...
[ "0.67638755", "0.6755903", "0.6748187", "0.6748187", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", "0.6717509", ...
0.6671089
67
This module is forked in different environments. By default, return `true` to log errors to the console. Forks can return `false` if this isn't desirable.
function showErrorDialog(capturedError) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static runningOnNode ()\n\t\t{ let ud = \"undefined\";\n\n\t\t\tif (typeof process === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions.node )\n\t\t\t{ return false;\n\t\t\t}\n\t\...
[ "0.6476742", "0.59491473", "0.584118", "0.5588432", "0.5582435", "0.54698336", "0.54398966", "0.5429671", "0.5409681", "0.5409681", "0.5398092", "0.5377223", "0.53769946", "0.5359536", "0.5359536", "0.53345436", "0.52284026", "0.5201319", "0.5185094", "0.51222306", "0.5118625...
0.0
-1
Capture errors so they don't interrupt unmounting.
function safelyCallComponentWillUnmount(current, instance) { { invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance); if (hasCaughtError$1()) { var unmountError = clearCaughtError$1(); captureCommitPhaseError(current, unmountError); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "simulateUnmount() {\n this.volumeUnmountListener(this.volumeInfo_.volumeId);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "functi...
[ "0.6385105", "0.5921357", "0.5853079", "0.5853079", "0.5853079", "0.58470565", "0.58197415", "0.58197415", "0.58197415", "0.57672554", "0.5742686", "0.5742686", "0.5742686", "0.5742686", "0.5742686", "0.57321393", "0.57321393", "0.57321393", "0.5689659", "0.5689659", "0.56572...
0.0
-1
Useroriginating errors (lifecycles and refs) should not interrupt deletion, so don't let them throw. Hostoriginating errors should interrupt deletion, so it's okay
function commitUnmount(current) { if (typeof onCommitUnmount === 'function') { onCommitUnmount(current); } switch (current.tag) { case ClassComponent: { safelyDetachRef(current); var instance = current.stateNode; if (typeof instance.componentWillUnmount === 'function') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detach() {\n throw new Error('Not Implemented');\n }", "detach() {\n throw new Error('Not Implemented');\n }", "function deleteErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot delete data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Delete Success\") \n\t}\n}", "componentWillUnmount() {\n ...
[ "0.60742086", "0.60742086", "0.59141797", "0.59037095", "0.58821017", "0.58274007", "0.58048403", "0.5790703", "0.57566315", "0.57082933", "0.56811607", "0.5672898", "0.56346536", "0.56346536", "0.5631592", "0.5605371", "0.55458134", "0.55373806", "0.55373806", "0.55373806", ...
0.0
-1
Creates a unique async expiration time.
function computeUniqueAsyncExpiration() { var currentTime = recalculateCurrentTime(); var result = computeAsyncExpiration(currentTime); if (result <= lastUniqueAsyncExpiration) { // Since we assume the current time monotonically increases, we only hit // this branch when computeUniqueAsyncExpiration is fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeUniqueAsyncExpiration() {\n var currentTime = requestCurrentTime();\n var result = computeAsyncExpiration(currentTime);\n if (result <= lastUniqueAsyncExpiration) {\n // Since we assume the current time monotonically increases, we only hit\n // this branch when computeUniqueAsyncExpiration...
[ "0.680362", "0.680362", "0.680362", "0.680362", "0.680362", "0.680362", "0.680362", "0.680362", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026", "0.67935026"...
0.6765476
42
TODO: Rename this to scheduleTimeout or something
function suspendRoot(root, thenable, timeoutMs, suspendedTime) { // Schedule the timeout. if (timeoutMs >= 0 && nextLatestTimeoutMs < timeoutMs) { nextLatestTimeoutMs = timeoutMs; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schedule(delay = this.timeout) {\r\n this.cancel();\r\n this.timeoutToken = setTimeout(this.timeoutHandler, delay);\r\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "onTimeout() {}", "async setTimeout() {\n const TimeoutRequestsWindowTime = 5*60*1000;\n ...
[ "0.7186767", "0.6903256", "0.6726437", "0.642659", "0.64253235", "0.6383911", "0.62639284", "0.6259933", "0.62280244", "0.6226642", "0.6201523", "0.6201523", "0.617181", "0.61546135", "0.61085117", "0.6095036", "0.60944223", "0.60881335", "0.60881335", "0.6076965", "0.6067652...
0.0
-1
requestWork is called by the scheduler whenever a root receives an update. It's up to the renderer to call renderRoot at some point in the future.
function requestWork(root, expirationTime) { addRootToSchedule(root, expirationTime); if (isRendering) { // Prevent reentrancy. Remaining work will be scheduled at the end of // the currently rendering batch. return; } if (isBatchingUpdates) { // Flush work at the end of the batch. if (isU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're...
[ "0.7653651", "0.7653651", "0.7631918", "0.7631918", "0.7631918", "0.7145129", "0.7145129", "0.7145129", "0.7100897", "0.70825034", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70758003", "0.70...
0.7050717
33
When working on async work, the reconciler asks the renderer if it should yield execution. For DOM, we implement this with requestIdleCallback.
function shouldYield() { if (deadline === null) { return false; } if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { // Disregard deadline.didTimeout. Only expired work should be flushed // during a timeout. This path is only hit for non-expired work. return false; } deadlineDidExpir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onIdle (callback) {\n\t\tif (Object.keys (this.taskMap).length <= 0) {\n\t\t\tsetImmediate (callback);\n\t\t\treturn;\n\t\t}\n\t\tthis.statusEventEmitter.once (IdleEvent, callback);\n\t}", "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Rem...
[ "0.55923533", "0.5583884", "0.5583884", "0.5555731", "0.5555731", "0.5555731", "0.55458957", "0.5499496", "0.5457743", "0.5456889", "0.54464793", "0.54464793", "0.54398525", "0.5432785", "0.54193616", "0.5402261", "0.53944165", "0.5393767", "0.537789", "0.5373993", "0.5372762...
0.0
-1
TODO: Batching should be implemented at the renderer level, not inside the reconciler.
function batchedUpdates$1(fn, a) { var previousIsBatchingUpdates = isBatchingUpdates; isBatchingUpdates = true; try { return fn(a); } finally { isBatchingUpdates = previousIsBatchingUpdates; if (!isBatchingUpdates && !isRendering) { performSyncWork(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateBatches() {\n if (this.dirty === this.cacheDirty) {\n return;\n }\n if (this.graphicsData.length === 0) {\n return;\n }\n if (this.dirty !== this.cacheDirty) {\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data ...
[ "0.66131675", "0.6574288", "0.65535474", "0.65384126", "0.65384126", "0.6136533", "0.6087616", "0.6049396", "0.6025469", "0.5977921", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.5929122", "0.588165", "0.5860314", ...
0.0
-1
TODO: Batching should be implemented at the renderer level, not inside the reconciler.
function unbatchedUpdates(fn, a) { if (isBatchingUpdates && !isUnbatchingUpdates) { isUnbatchingUpdates = true; try { return fn(a); } finally { isUnbatchingUpdates = false; } } return fn(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateBatches() {\n if (this.dirty === this.cacheDirty) {\n return;\n }\n if (this.graphicsData.length === 0) {\n return;\n }\n if (this.dirty !== this.cacheDirty) {\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data ...
[ "0.66125363", "0.6573637", "0.65539813", "0.6537788", "0.6537788", "0.61356914", "0.60868585", "0.60497123", "0.6024147", "0.5976598", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.59277225", "0.58802736", "...
0.0
-1
TODO: Batching should be implemented at the renderer level, not within the reconciler.
function flushSync(fn, a) { !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0; var previousIsBatchingUpdates = isBatchingUpdates; isBatchingUpdates = true; try { return syncUpdates(fn, a); } finally { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateBatches() {\n if (this.dirty === this.cacheDirty) {\n return;\n }\n if (this.graphicsData.length === 0) {\n return;\n }\n if (this.dirty !== this.cacheDirty) {\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data ...
[ "0.6657742", "0.661365", "0.66131127", "0.6544255", "0.6544255", "0.6123046", "0.61036193", "0.6044233", "0.60355705", "0.5957277", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.59142876", "0.58709645", "0.5...
0.0
-1
Base class helpers for the updating state of a component.
function Component(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n BaseState.update.call(this);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "func...
[ "0.7217204", "0.67610246", "0.66769236", "0.66106635", "0.6540022", "0.65259355", "0.6489663", "0.64705694", "0.645821", "0.63847154", "0.6354757", "0.63347685", "0.63053316", "0.6304944", "0.62717897", "0.6266675", "0.621649", "0.6214279", "0.6194085", "0.6189877", "0.615812...
0.0
-1
Convenience component with default shallow equality check for sCU.
function PureComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useStrictEquality(b, a) {\n return a === b;\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "function defaultEqualityCheck(a, b) {\n return !a && !b || a === b;\n }", "equals() {\n return false;\n }", "equals() {\n return false;\n }", ...
[ "0.6083551", "0.579784", "0.5669391", "0.56581414", "0.56581414", "0.5631642", "0.55893344", "0.55893344", "0.55851346", "0.5546245", "0.548746", "0.5484109", "0.5481716", "0.5481716", "0.54722977", "0.54722977", "0.54722977", "0.5451884", "0.5451884", "0.5441116", "0.5398943...
0.0
-1
an immutable object with a single mutable value
function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "static set one(value) {}", "function makeImmutableObject(obj) {\n\t if (!globalConfig.us...
[ "0.6674448", "0.66609514", "0.6358345", "0.6347869", "0.6347869", "0.6263268", "0.6230736", "0.6136926", "0.61048114", "0.5915378", "0.5889688", "0.580687", "0.5776291", "0.5763881", "0.57248324", "0.56947106", "0.566211", "0.5636481", "0.56181127", "0.5606209", "0.5606209", ...
0.0
-1
Create and return a new ReactElement of the given type. See
function createElement(type, config, children) { var propName = void 0; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; } if (hasValidKey(config)) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=con...
[ "0.68920434", "0.6835192", "0.6767826", "0.6757532", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.65640503", "0.65581757", "0.6406998", "0.6406998", "0.6406998", "0.6406998", "0.6406998", "0.63805515",...
0.6344786
65