code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( Array.isArray( value ) ) {
easing = value[ 1 ];
... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | propFilter | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = Animation.prefilters.length,
deferred = jQuery.Deferred().always( function() {
// Don't match elem in the :animated selector
delete tick.elem;
} ),
tick = function() {
if ( stopped ) {
return false;
... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | Animation | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// Support: Android 2.3 only
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp = remai... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | tick | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
// Empty animations, or finishing resolves immediately
if ( empty || dataPriv.get( this, "finish" ) ) {
anim.stop( true );
}
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | doAnimation | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | stopQueue | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function stripAndCollapse( value ) {
var tokens = value.match( rnothtmlwhite ) || [];
return tokens.join( " " );
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | stripAndCollapse | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function getClass( elem ) {
return elem.getAttribute && elem.getAttribute( "class" ) || "";
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | getClass | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | handler | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( Array.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scala... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | buildParams | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
add = function( key, valueOrFunction ) {
// If value is a function, invoke it and use its return value
var value = jQuery.isFunction( valueOrFunction ) ?
valueOrFunction() :
valueOrFunction;
s[ s.length ] = encodeURIComponent( key ) + "=" +
encodeURIComponent( value == null ? "" : value );
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | add | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeE... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | addToPrefiltersOrTransports | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | inspectPrefiltersOrTransports | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if ( typeof dataTypeOrTransport === "string" &&
!seekingTransport && !... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | inspect | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
ret... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | ajaxExtend | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process
while ( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType ||... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | ajaxHandleResponses | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.c... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | ajaxConvert | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Ignore repeat invocations
if ( completed ) {
return;
}
completed = true;
// Clear timeout if it exists
if ( timeoutTimer ) {
window.cle... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | done | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _addEvent(object, type, callback) {
if (object.addEventListener) {
object.addEventListener(type, callback, false);
return;
}
object.attachEvent('on' + type, callback);
} | cross browser add event method
@param {Element|HTMLDocument} object
@param {string} type
@param {Function} callback
@returns void | _addEvent | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _characterFromEvent(e) {
// for keypress events we should return the character as is
if (e.type == 'keypress') {
var character = String.fromCharCode(e.which);
// if the shift key is not pressed then it is safe to assume
// that we want the character to be l... | takes the event and returns the key character
@param {Event} e
@return {string} | _characterFromEvent | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
} | checks if two arrays are equal
@param {Array} modifiers1
@param {Array} modifiers2
@returns {boolean} | _modifiersMatch | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _eventModifiers(e) {
var modifiers = [];
if (e.shiftKey) {
modifiers.push('shift');
}
if (e.altKey) {
modifiers.push('alt');
}
if (e.ctrlKey) {
modifiers.push('ctrl');
}
if (e.metaKey) {
modifier... | takes a key event and figures out what the modifiers are
@param {Event} e
@returns {Array} | _eventModifiers | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _preventDefault(e) {
if (e.preventDefault) {
e.preventDefault();
return;
}
e.returnValue = false;
} | prevents default for this event
@param {Event} e
@returns void | _preventDefault | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _stopPropagation(e) {
if (e.stopPropagation) {
e.stopPropagation();
return;
}
e.cancelBubble = true;
} | stops propogation for this event
@param {Event} e
@returns void | _stopPropagation | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _isModifier(key) {
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
} | determines if the keycode specified is a modifier key or not
@param {string} key
@returns {boolean} | _isModifier | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
// pull out the numeric keypad from here cause keypress should
// be able to detect the keys from the character
if (key > 95 && key < 112) {
... | reverses the map lookup so that we can look for specific keys
to see what can and can't use keypress
@return {Object} | _getReverseMap | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _pickBestAction(key, modifiers, action) {
// if no action was picked in we should try to pick the one
// that we think would work best for this key
if (!action) {
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
}
// modifier keys don't work as expe... | picks the best action based on the key combination
@param {string} key - character for key
@param {Array} modifiers
@param {string=} action passed in | _pickBestAction | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _keysFromString(combination) {
if (combination === '+') {
return ['+'];
}
combination = combination.replace(/\+{2}/g, '+plus');
return combination.split('+');
} | Converts from a string key combination to an array
@param {string} combination like "command+shift+l"
@return {Array} | _keysFromString | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _getKeyInfo(combination, action) {
var keys;
var key;
var i;
var modifiers = [];
// take the keys from this pattern and figure out what the actual
// pattern is all about
keys = _keysFromString(combination);
for (i = 0; i < keys.length; ++i) {
... | Gets info for a specific key combination
@param {string} combination key combination ("command+s" or "a" or "*")
@param {string=} action
@returns {Object} | _getKeyInfo | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _belongsTo(element, ancestor) {
if (element === null || element === document) {
return false;
}
if (element === ancestor) {
return true;
}
return _belongsTo(element.parentNode, ancestor);
} | Gets info for a specific key combination
@param {string} combination key combination ("command+s" or "a" or "*")
@param {string=} action
@returns {Object} | _belongsTo | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function Mousetrap(targetElement) {
var self = this;
targetElement = targetElement || document;
if (!(self instanceof Mousetrap)) {
return new Mousetrap(targetElement);
}
/**
* element to attach key events to
*
* @type {Element}
... | Gets info for a specific key combination
@param {string} combination key combination ("command+s" or "a" or "*")
@param {string=} action
@returns {Object} | Mousetrap | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false,
key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
... | resets all sequence counters except for the ones passed in
@param {Object} doNotReset
@returns void | _resetSequences | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
var i;
var callback;
var matches = [];
var action = e.type;
// if there are no events related to this keycode
if (!self._callbacks[character]) {
retu... | finds all callbacks that match based on the keycode, modifiers,
and action
@param {string} character
@param {Array} modifiers
@param {Event|Object} e
@param {string=} sequenceName - name of the sequence we are looking for
@param {string=} combination
@param {number=} level
@returns {Array} | _getMatches | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _fireCallback(callback, e, combo, sequence) {
// if this event should not happen stop here
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
return;
}
if (callback(e, combo) === false) {
_preventDefault(e);
... | actually calls the callback function
if your callback function returns false this will use the jquery
convention - prevent default and stop propogation on the event
@param {Function} callback
@param {Event} e
@returns void | _fireCallback | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _handleKeyEvent(e) {
// normalize e.which for key events
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
if (typeof e.which !== 'number') {
e.which = e.keyCode;
}
var character = _cha... | handles a keydown event
@param {Event} e
@returns void | _handleKeyEvent | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1000);
} | called to set a 1 second timeout on the specified sequence
this is so after each key press in the sequence you have 1 second
to press the next key before you have to start over
@returns void | _resetSequenceTimer | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _bindSequence(combo, keys, callback, action) {
// start off by adding a sequence level record for this combination
// and setting the level to 0
_sequenceLevels[combo] = 0;
/**
* callback to increase the sequence level for this sequence and reset
... | binds a key sequence to an event
@param {string} combo - combo specified in bind call
@param {Array} keys
@param {Function} callback
@param {string=} action
@returns void | _bindSequence | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
} | callback to increase the sequence level for this sequence and reset
all other sequences that were active
@param {string} nextAction
@returns {Function} | _increaseSequence | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _callbackAndReset(e) {
_fireCallback(callback, e, combo);
// we should ignore the next key up if the action is key down
// or keypress. this is so if you finish a sequence and
// release the key the final key will not trigger a keyup
... | wraps the specified callback inside of another function in order
to reset all sequence counters as soon as this sequence is done
@param {Event} e
@returns void | _callbackAndReset | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function _bindSingle(combination, callback, action, sequenceName, level) {
// store a direct mapped reference for use with Mousetrap.trigger
self._directMap[combination + ':' + action] = callback;
// make sure multiple spaces in a row become a single space
combination =... | binds a single keyboard combination
@param {string} combination
@param {Function} callback
@param {string=} action
@param {string=} sequenceName - name of sequence if part of sequence
@param {number=} level - what part of the sequence the command is
@returns void | _bindSingle | javascript | agermanidis/livepython | dist/main.js | https://github.com/agermanidis/livepython/blob/master/dist/main.js | MIT |
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} els... | Use invariant() to assert state which your program assumes to be true.
Provide sprintf-style format (only %s is supported) and arguments
to provide information about what broke and what you were
expecting.
The invariant message will be stripped in production, but the invariant
will remain to ensure logic does not dif... | invariant | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
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... | 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. | shallowEqual | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
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 (... | Checks if a given DOM node contains or is another DOM node. | containsNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisible,
// not enabled, or of a type that does not accept the focus." for all kinds of
// reasons that are too expensive and fragile to test.
try {
node.focus();
} catch (e) {}
} | @param {DOMElement} node input/textarea to focus | focusNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getActiveElement(doc) /*?DOMElement*/{
doc = doc || (typeof document !== 'undefined' ? document : undefined);
if (typeof doc === 'undefined') {
return null;
}
try {
return doc.activeElement || doc.body;
} catch (e) {
return doc.body;
}
} | Same as document.activeElement but wraps in a try-catch block. In IE it is
not safe to call document.activeElement if there is nothing focused.
The activeElement will be null only if the document or document body is not
yet defined.
@param {?DOMDocument} doc Defaults to current document.
@return {?DOMElement} | getActiveElement | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
printWarning = function (format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});... | Forked from fbjs/warning:
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
Only change is we use console.warn instead of console.error,
and do nothing when 'console' is not supported.
This really simplifies the code.
---
Similar to invariant but only... | printWarning | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function ReactComponent(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_1;
} | Base class helpers for the updating state of a component. | ReactComponent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
defineDeprecationWarning = function (methodName, info) {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function () {
lowPriorityWarning_1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
return undefined;
}
});
} | Deprecated APIs. These APIs used to exist on classic React classes but since
we would like to deprecate them, we're not going to move them over to this
modern base class. Instead, we define a getter that warns if it's accessed. | defineDeprecationWarning | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function ReactPureComponent(props, context, updater) {
// Duplicated from ReactComponent.
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_1;
} | Base class helpers for the updating state of a component. | ReactPureComponent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function ReactAsyncComponent(props, context, updater) {
// Duplicated from ReactComponent.
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_1;
} | Base class helpers for the updating state of a component. | ReactAsyncComponent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allow us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE$1,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// ... | Factory method to create a new React element. This no longer adheres to
the class pattern, so do not use new to call it. Also, no instanceof check
will work. Instead test $$typeof field against Symbol.for('react.element') to check
if something is a React Element.
@param {*} type
@param {*} key
@param {string|object} r... | ReactElement | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = ('' + key).replace(escapeRegex, function (match) {
return escaperLookup[match];
});
return '$' + escapedString;
} | Escape and wrap key so it is safe to use as a reactid
@param {string} key to be escaped.
@return {string} the escaped key. | escape | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
} | TODO: Test that a single child and an array with one item have the same key
pattern. | escapeUserProvidedKey | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
if (traverseContextPool.length) {
var traverseContext = traverseContextPool.pop();
traverseContext.result = mapResult;
traverseContext.keyPrefix = keyPrefix;
traverseContext.func = mapFunction;
traverseContext.conte... | TODO: Test that a single child and an array with one item have the same key
pattern. | getPooledTraverseContext | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function releaseTraverseContext(traverseContext) {
traverseContext.result = null;
traverseContext.keyPrefix = null;
traverseContext.func = null;
traverseContext.context = null;
traverseContext.count = 0;
if (traverseContextPool.length < POOL_SIZE) {
traverseContextPool.push(traverseContext);
}
} | TODO: Test that a single child and an array with one item have the same key
pattern. | releaseTraverseContext | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' ||
// The fol... | @param {?*} children Children tree container.
@param {!string} nameSoFar Name of the key path so far.
@param {!function} callback Callback to invoke with each child found.
@param {?*} traverseContext Used to pass information throughout the traversal
process.
@return {!number} The number of children in this subtree. | traverseAllChildrenImpl | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext);
} | Traverses children that are typically specified as `props.children`, but
might also be specified through attributes:
- `traverseAllChildren(this.props.children, ...)`
- `traverseAllChildren(this.props.leftPanelChildren, ...)`
The `traverseContext` is an optional argument that is passed through the
entire traversal. I... | traverseAllChildren | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (typeof component === 'object' && component !== null && component.key != null) {
// Explicit key
return escape(component.key);
}
/... | Generate a key string that identifies a component within a set.
@param {*} component A component that could contain a manual key.
@param {number} index Index that is used if a manual key is not provided.
@return {string} | getComponentKey | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func,
context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
} | Generate a key string that identifies a component within a set.
@param {*} component A component that could contain a manual key.
@param {number} index Index that is used if a manual key is not provided.
@return {string} | forEachSingleChild | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
releaseTraverseContext(traverseContext);... | Iterates through children that are typically specified as `props.children`.
See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
The provided forEachFunc(child, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} forEachFunc
@p... | forEachChildren | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result,
keyPrefix = bookKeeping.keyPrefix,
func = bookKeeping.func,
context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
... | Iterates through children that are typically specified as `props.children`.
See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
The provided forEachFunc(child, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} forEachFunc
@p... | mapSingleChildIntoContext | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = '';
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
}
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleC... | Iterates through children that are typically specified as `props.children`.
See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
The provided forEachFunc(child, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} forEachFunc
@p... | mapIntoWithKeyPrefixInternal | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
} | Maps children that are typically specified as `props.children`.
See https://facebook.github.io/react/docs/react-api.html#react.children.map
The provided mapFunction(child, key, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} func The map function.
@p... | mapChildren | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function countChildren(children, context) {
return traverseAllChildren(children, emptyFunction.thatReturnsNull, null);
} | Count the number of children that are typically specified as
`props.children`.
See https://facebook.github.io/react/docs/react-api.html#react.children.count
@param {?*} children Children tree container.
@return {number} The number of children. | countChildren | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
return result;
} | Flatten a children object (typically specified as `props.children`) and
return an array with appropriately re-keyed children.
See https://facebook.github.io/react/docs/react-api.html#react.children.toarray | toArray | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function onlyChild(children) {
!ReactElement_1.isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
return children;
} | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://facebook.github.io/react/docs/react-api.html#react.children.only
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this h... | onlyChild | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getCurrentComponentErrorInfo(parentType) {
var info = getDeclarationErrorAddendum();
if (!info) {
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
if (parentName) {
info = '\n\nCheck the top-level render call using <' + parentName + '>... | Warn if there's no key explicitly set on dynamic arrays of children or
object keys are not valid. This allows us to keep track of children between
updates. | getCurrentComponentErrorInfo | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validateExplicitKey(element, parentType) {
if (!element._store || element._store.validated || element.key != null) {
return;
}
element._store.validated = true;
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
re... | Warn if the element doesn't have an explicit key assigned to it.
This element is in an array. The array could grow and shrink or be
reordered. All children that haven't already been validated are required to
have a "key" property assigned to it. Error statuses are cached so a warning
will only be shown once.
@internal... | validateExplicitKey | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validateChildKeys(node, parentType) {
if (typeof node !== 'object') {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (ReactElement_1.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if... | Ensure that every element either is passed in a static location, in an
array with an explicit keys property defined, or in an object literal
with valid key property.
@internal
@param {ReactNode} node Statically passed child of any type.
@param {*} parentType node's parent's type. | validateChildKeys | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validatePropTypes(element) {
var componentClass = element.type;
if (typeof componentClass !== 'function') {
return;
}
var name = componentClass.displayName || componentClass.name;
var propTypes = componentClass.propTypes;
if (propTypes) {
currentlyValidatingElement = element;
checkProp... | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | validatePropTypes | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isNative(fn) {
// Based on isNative() from Lodash
var funcToString = Function.prototype.toString;
var reIsNative = RegExp('^' + funcToString
// Take an example native function source for comparison
.call(Object.prototype.hasOwnProperty)
// Strip regex characters so we can use it for regex
.replac... | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | isNative | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
getKeyFromID = function (id) {
return '.' + id;
} | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | getKeyFromID | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
getIDFromKey = function (key) {
return parseInt(key.substr(1), 10);
} | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | getIDFromKey | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function purgeDeep(id) {
var item = getItem(id);
if (item) {
var childIDs = item.childIDs;
removeItem(id);
childIDs.forEach(purgeDeep);
}
} | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | purgeDeep | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getDisplayName$1(element) {
if (element == null) {
return '#empty';
} else if (typeof element === 'string' || typeof element === 'number') {
return '#text';
} else if (typeof element.type === 'string') {
return element.type;
} else {
return element.type.displayName || element.type.name ... | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | getDisplayName$1 | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function describeID(id) {
var name = ReactComponentTreeHook.getDisplayName(id);
var element = ReactComponentTreeHook.getElement(id);
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var ownerName = void 0;
if (ownerID) {
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
}
warning$4(elem... | Given an element, validate that its props follow the propTypes definition,
provided by the type.
@param {ReactElement} element | describeID | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isTextNode(object) {
return isNode(object) && object.nodeType == 3;
} | @param {*} object The object to check.
@return {boolean} Whether or not the object is a DOM text node. | isTextNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isNode(object) {
var doc = object ? object.ownerDocument || object : document;
var defaultView = doc.defaultView || window;
return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object... | @param {*} object The object to check.
@return {boolean} Whether or not the object is a DOM node. | isNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
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... | Recomputes the plugin list using the injected plugins and plugin ordering.
@private | recomputePluginOrdering | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
EventPluginRegistry.eventNameDispatchConf... | Publishes an event so that it can be dispatched by the supplied plugin.
@param {object} dispatchConfig Dispatch configuration for the event.
@param {object} PluginModule Plugin publishing the event.
@return {boolean} True if the event was successfully published.
@private | publishEventForPlugin | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function publishRegistrationName(registrationName, pluginModule, eventName) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
EventPluginRegistry.registration... | Publishes a registration name that is used to identify dispatched events.
@param {string} registrationName Registration name to add.
@param {object} PluginModule Plugin publishing the event.
@private | publishRegistrationName | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
} | Injects plugins to be used by `EventPluginHub`. The plugin names must be
in the ordering injected by `injectEventPluginOrder`.
Plugins can be injected as part of page initialization or on-the-fly.
@param {object} injectedNamesToPlugins Map from names to plugin modules.
@internal
@see {EventPluginHub.injection.injectE... | checkMask | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function shouldPrecacheNode(node, nodeID) {
return node.nodeType === ELEMENT_NODE$1 && node.getAttribute(ATTR_NAME) === '' + nodeID || node.nodeType === COMMENT_NODE$1 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === COMMENT_NODE$1 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
} | Check if a given node should be cached. | shouldPrecacheNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getRenderedHostOrTextFromComponent(component) {
var rendered;
while (rendered = component._renderedComponent) {
component = rendered;
}
return component;
} | Drill down (through composites and empty components) until we get a host or
host text component.
This is pretty polymorphic but unavoidable with the current structure we have
for `_renderedChildren`. | getRenderedHostOrTextFromComponent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function precacheNode(inst, node) {
var hostInst = getRenderedHostOrTextFromComponent(inst);
hostInst._hostNode = node;
node[internalInstanceKey] = hostInst;
} | Populate `_hostNode` on the rendered host/text component with the given
DOM node. The passed `inst` can be a composite. | precacheNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function precacheFiberNode$1(hostInst, node) {
node[internalInstanceKey] = hostInst;
} | Populate `_hostNode` on the rendered host/text component with the given
DOM node. The passed `inst` can be a composite. | precacheFiberNode$1 | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function uncacheNode(inst) {
var node = inst._hostNode;
if (node) {
delete node[internalInstanceKey];
inst._hostNode = null;
}
} | Populate `_hostNode` on the rendered host/text component with the given
DOM node. The passed `inst` can be a composite. | uncacheNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function precacheChildNodes(inst, node) {
if (inst._flags & Flags.hasCachedChildNodes) {
return;
}
var children = inst._renderedChildren;
var childNode = node.firstChild;
outer: for (var name in children) {
if (!children.hasOwnProperty(name)) {
continue;
}
var childInst = children[name];... | Populate `_hostNode` on each child of `inst`, assuming that the children
match up with the DOM (element) children of `node`.
We cache entire levels at once to avoid an n^2 problem where we access the
children of a node sequentially and have to walk from the start to our target
node every time.
Since we update `_rende... | precacheChildNodes | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getClosestInstanceFromNode(node) {
if (node[internalInstanceKey]) {
return node[internalInstanceKey];
}
// Walk up the tree until we find an ancestor whose instance we have cached.
var parents = [];
while (!node[internalInstanceKey]) {
parents.push(node);
if (node.parentNode) {
nod... | Given a DOM node, return the closest ReactDOMComponent or
ReactDOMTextComponent instance ancestor. | getClosestInstanceFromNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getInstanceFromNode(node) {
var inst = node[internalInstanceKey];
if (inst) {
if (inst.tag === HostComponent || inst.tag === HostText) {
return inst;
} else if (inst._hostNode === node) {
return inst;
} else {
return null;
}
}
inst = getClosestInstanceFromNode(node);
... | Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
instance, or null if the node was not rendered by this React. | getInstanceFromNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getNodeFromInstance(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 the... | Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
DOM node. | getNodeFromInstance | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getFiberCurrentPropsFromNode(node) {
return node[internalEventHandlersKey] || null;
} | Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
DOM node. | getFiberCurrentPropsFromNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function updateFiberProps$1(node, props) {
node[internalEventHandlersKey] = props;
} | Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
DOM node. | updateFiberProps$1 | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) {
ReactErrorUtils._hasCaughtError = false;
ReactErrorUtils._caughtError = null;
var funcArgs = Array.prototype.slice.call(arguments, 3);
try {
func.apply(context, funcArgs);
} catch (error) {
ReactErrorUtils._caughtError = error;... | During execution of guarded functions we will capture the first error which
we will rethrow to be handled by the top level error handler. | invokeGuardedCallback | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
// Keeps track of whether the user-provided callback threw an error. We
// set this to true at the beginning, then set it to false right after
// calling the function. If the function errors, `didError` will never be
/... | During execution of guarded functions we will capture the first error which
we will rethrow to be handled by the top level error handler. | invokeGuardedCallbackDev | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function callCallback() {
// We immediately remove the callback from event listeners so that
// nested `invokeGuardedCallback` calls do not clash. Otherwise, a
// nested call would trigger the fake event handlers of any call higher
// in the stack.
fakeNode.removeEventListener(ev... | During execution of guarded functions we will capture the first error which
we will rethrow to be handled by the top level error handler. | callCallback | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function onError(event) {
error = event.error;
didSetError = true;
if (error === null && event.colno === 0 && event.lineno === 0) {
isCrossOriginError = true;
}
} | During execution of guarded functions we will capture the first error which
we will rethrow to be handled by the top level error handler. | onError | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
rethrowCaughtError = function () {
if (ReactErrorUtils._hasRethrowError) {
var error = ReactErrorUtils._rethrowError;
ReactErrorUtils._rethrowError = null;
ReactErrorUtils._hasRethrowError = false;
throw error;
}
} | During execution of guarded functions we will capture the first error which
we will rethrow to be handled by the top level error handler. | rethrowCaughtError | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isEndish(topLevelType) {
return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
} | - `ComponentTree`: [required] Module that can convert between React instances
and actual node references. | isEndish | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isMoveish(topLevelType) {
return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
} | - `ComponentTree`: [required] Module that can convert between React instances
and actual node references. | isMoveish | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isStartish(topLevelType) {
return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
} | - `ComponentTree`: [required] Module that can convert between React instances
and actual node references. | isStartish | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.