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 pushHostContainer(fiber, nextRootInstance) { // Push current root instance onto the stack; // This allows us to reset root when portals are popped. push$2(rootInstanceStackCursor, nextRootInstance, fiber); var nextRootContext = getRootHostContext(nextRootInstance); // Track the context an...
Warns if there is a duplicate or missing key
pushHostContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function popHostContainer(fiber) { pop$2(contextStackCursor, fiber); pop$2(contextFiberStackCursor, fiber); pop$2(rootInstanceStackCursor, fiber); }
Warns if there is a duplicate or missing key
popHostContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getHostContext() { var context = requiredContext(contextStackCursor.current); return context; }
Warns if there is a duplicate or missing key
getHostContext
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function pushHostContext(fiber) { var rootInstance = requiredContext(rootInstanceStackCursor.current); var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(context, fiber.type, rootInstance); // Don't push this Fiber's context unless it's unique. if (cont...
Warns if there is a duplicate or missing key
pushHostContext
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function popHostContext(fiber) { // Do not pop unless this Fiber provided the current context. // pushHostContext() only pushes Fibers that provide unique contexts. if (contextFiberStackCursor.current !== fiber) { return; } pop$2(contextStackCursor, fiber); pop$2(contextFiberStackCursor, ...
Warns if there is a duplicate or missing key
popHostContext
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function resetHostContainer() { contextStackCursor.current = NO_CONTEXT; rootInstanceStackCursor.current = NO_CONTEXT; }
Warns if there is a duplicate or missing key
resetHostContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
ReactFiberHydrationContext = function (config) { var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild =...
Warns if there is a duplicate or missing key
ReactFiberHydrationContext
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; nextHydratableInstance = getFirstHydratableChild(parentInstance); hydrationParentFiber = fiber; isHydrating = true; return true; }
Warns if there is a duplicate or missing key
enterHydrationState
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function deleteHydratableInstance(returnFiber, instance) { { switch (returnFiber.tag) { case HostRoot$10: didNotHydrateInstance(returnFiber.stateNode.containerInfo, instance); break; case HostComponent$10: didNotHydrateInstance(returnFiber.stateNode, instance); ...
Warns if there is a duplicate or missing key
deleteHydratableInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function insertNonHydratedInstance(returnFiber, fiber) { fiber.effectTag |= Placement$6; { var parentInstance; switch (returnFiber.tag) { // TODO: Currently we don't warn for insertions into the root because // we always insert into the root in the non-hydrating case. We just ...
Warns if there is a duplicate or missing key
insertNonHydratedInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function canHydrate(fiber, nextInstance) { switch (fiber.tag) { case HostComponent$10: { var type = fiber.type; var props = fiber.pendingProps; return canHydrateInstance(nextInstance, type, props); } case HostText$8: { var text = fiber.pend...
Warns if there is a duplicate or missing key
canHydrate
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function tryToClaimNextHydratableInstance(fiber) { if (!isHydrating) { return; } var nextInstance = nextHydratableInstance; if (!nextInstance) { // Nothing to hydrate. Make it an insertion. insertNonHydratedInstance(hydrationParentFiber, fiber); isHydrating = false; hydrati...
Warns if there is a duplicate or missing key
tryToClaimNextHydratableInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { var instance = fiber.stateNode; var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component. fiber.updat...
Warns if there is a duplicate or missing key
prepareToHydrateHostInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function prepareToHydrateHostTextInstance(fiber) { var textInstance = fiber.stateNode; var shouldUpdate = hydrateTextInstance(textInstance, fiber.memoizedProps, fiber); return shouldUpdate; }
Warns if there is a duplicate or missing key
prepareToHydrateHostTextInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function popToNextHostParent(fiber) { var parent = fiber['return']; while (parent !== null && parent.tag !== HostComponent$10 && parent.tag !== HostRoot$10) { parent = parent['return']; } hydrationParentFiber = parent; }
Warns if there is a duplicate or missing key
popToNextHostParent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function popHydrationState(fiber) { if (fiber !== hydrationParentFiber) { // We're deeper than the current hydration context, inside an inserted // tree. return false; } if (!isHydrating) { // If we're not currently hydrating but we're in a hydration context, then // we were an...
Warns if there is a duplicate or missing key
popHydrationState
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function resetHydrationState() { hydrationParentFiber = null; nextHydratableInstance = null; isHydrating = false; }
Warns if there is a duplicate or missing key
resetHydrationState
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getLeafNode(node) { while (node && node.firstChild) { node = node.firstChild; } return node; }
Given any node return the first leaf node without children. @param {DOMElement|DOMTextNode} node @return {DOMElement|DOMTextNode}
getLeafNode
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getSiblingNode(node) { while (node) { if (node.nextSibling) { return node.nextSibling; } node = node.parentNode; } }
Get the next sibling within a container. This will walk up the DOM if a node's siblings have been exhausted. @param {DOMElement|DOMTextNode} node @return {?DOMElement|DOMTextNode}
getSiblingNode
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getNodeForCharacterOffset(root, offset) { var node = getLeafNode(root); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType === TEXT_NODE$3) { nodeEnd = nodeStart + node.textContent.length; if (nodeStart <= offset && nodeEnd >= offset) { return { nod...
Get object describing the nodes which contain characters at offset. @param {DOMElement|DOMTextNode} root @param {number} offset @return {?object}
getNodeForCharacterOffset
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getTextContentAccessor() { if (!contentKey && ExecutionEnvironment.canUseDOM) { // Prefer textContent to innerText because many browsers support both but // SVG <text> elements don't support innerText even when <div> does. contentKey = 'textContent' in document.documentElement ? 'textContent' : '...
Gets the key used to access text content on a DOM node. @return {?string} Key used to access text content. @internal
getTextContentAccessor
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isCollapsed(anchorNode, anchorOffset, focusNode$$1, focusOffset) { return anchorNode === focusNode$$1 && anchorOffset === focusOffset; }
While `isCollapsed` is available on the Selection object and `collapsed` is available on the Range object, IE11 sometimes gets them wrong. If the anchor/focus nodes and offsets are the same, the range is collapsed.
isCollapsed
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function setModernOffsets(node, offsets) { if (!window.getSelection) { return; } var selection = window.getSelection(); var length = node[getTextContentAccessor_1()].length; var start = Math.min(offsets.start, length); var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // I...
In modern non-IE browsers, we can support both forward and backward selections. Note: IE10+ supports the Selection object, but it does not support the `extend` method, which means that even in modern IE, it's not possible to programmatically create a backward selection. Thus, for all IE versions, we use the old IE API...
setModernOffsets
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isInDocument(node) { return containsNode(document.documentElement, node); }
@param {DOMElement|DOMTextNode} node @param {object} offsets
isInDocument
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.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/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
updatedAncestorInfo$1 = function (oldInfo, tag, instance) { var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo); var info = { tag: tag, instance: instance }; if (inScopeTags.indexOf(tag) !== -1) { ancestorInfo.aTagInScope = null; ancestorInfo.buttonTagInScope = null; ancestorInfo...
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...
updatedAncestorInfo$1
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
findOwnerStack = function (instance) { if (!instance) { return []; } var stack = []; do { stack.push(instance); } while (instance = instance._currentElement._owner); stack.reverse(); return stack; }
Given a ReactCompositeComponent instance, return a list of its recursive owners, starting at the root and ending with the instance itself.
findOwnerStack
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
getOwnerInfo = function (childInstance, childTag, ancestorInstance, ancestorTag, isParent) { var childOwner = childInstance && childInstance._currentElement._owner; var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner; var childOwners = findOwnerStack(childOwner); var ancesto...
Given a ReactCompositeComponent instance, return a list of its recursive owners, starting at the root and ending with the instance itself.
getOwnerInfo
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getParent(inst) { if (inst._hostParent !== undefined) { return inst._hostParent; } if (typeof inst.tag === 'number') { do { inst = inst['return']; // TODO: If this is a HostRoot we might want to bail out. // That is depending on if we want nested subtrees (layers) to bubble ...
Given a ReactCompositeComponent instance, return a list of its recursive owners, starting at the root and ending with the instance itself.
getParent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
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...
Return the lowest common ancestor of A and B, or null if they are in different trees.
getLowestCommonAncestor
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isAncestor(instA, instB) { while (instB) { if (instA === instB || instA === instB.alternate) { return true; } instB = getParent(instB); } return false; }
Return if A is an ancestor of B.
isAncestor
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getParentInstance(inst) { return getParent(inst); }
Return the parent instance of the passed-in instance.
getParentInstance
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
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); } }
Simulates the traversal of a two-phase, capture/bubble event dispatch.
traverseTwoPhase
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function traverseEnterLeave(from, to, fn, argFrom, argTo) { var common = from && to ? getLowestCommonAncestor(from, to) : null; var pathFrom = []; while (from && from !== common) { pathFrom.push(from); from = getParent(from); } var pathTo = []; while (to && to !== common) { pathTo.push(to); ...
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.
traverseEnterLeave
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function listenerAtPhase(inst, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(inst, registrationName); }
Some event types have a notion of different registration names for different "phases" of propagation. This finds listeners by a given phase.
listenerAtPhase
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateDirectionalDispatches(inst, phase, event) { { warning$29(inst, 'Dispatching inst must not be null'); } var listener = listenerAtPhase(inst, event, phase); if (listener) { event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener); event._dispatchInstances = ac...
Tags a `SyntheticEvent` with dispatched listeners. Creating this function here, allows us to not have to bind or create functions for each event. Mutating the event's members allows us to not have to create a wrapping "dispatch" object that pairs the event with the listener.
accumulateDirectionalDispatches
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateTwoPhaseDispatchesSingle(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } }
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 tar...
accumulateTwoPhaseDispatchesSingle
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { var targetInst = event._targetInst; var parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null; ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateD...
Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
accumulateTwoPhaseDispatchesSingleSkipTarget
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
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_1(e...
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.
accumulateDispatches
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateDirectDispatchesSingle(event) { if (event && event.dispatchConfig.registrationName) { accumulateDispatches(event._targetInst, null, event); } }
Accumulates dispatches on an `SyntheticEvent`, but only for the `dispatchMarker`. @param {SyntheticEvent} event
accumulateDirectDispatchesSingle
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateTwoPhaseDispatches(events) { forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingle); }
Accumulates dispatches on an `SyntheticEvent`, but only for the `dispatchMarker`. @param {SyntheticEvent} event
accumulateTwoPhaseDispatches
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateTwoPhaseDispatchesSkipTarget(events) { forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingleSkipTarget); }
Accumulates dispatches on an `SyntheticEvent`, but only for the `dispatchMarker`. @param {SyntheticEvent} event
accumulateTwoPhaseDispatchesSkipTarget
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateEnterLeaveDispatches(leave, enter, from, to) { ReactTreeTraversal.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); }
Accumulates dispatches on an `SyntheticEvent`, but only for the `dispatchMarker`. @param {SyntheticEvent} event
accumulateEnterLeaveDispatches
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function accumulateDirectDispatches(events) { forEachAccumulated_1(events, accumulateDirectDispatchesSingle); }
Accumulates dispatches on an `SyntheticEvent`, but only for the `dispatchMarker`. @param {SyntheticEvent} event
accumulateDirectDispatches
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { { // these have a getter/setter for warnings delete this.nativeEvent; delete this.preventDefault; delete this.stopPropagation; } this.dispatchConfig = dispatchConfig; this._targetInst = targetInst; this.nati...
Synthetic events are dispatched by event plugins, typically in response to a top-level event delegation handler. These systems should generally use pooling to reduce the frequency of garbage collection. The system should check `isPersistent` to determine whether the event should be released into the pool after being d...
SyntheticEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getPooledWarningPropertyDefinition(propName, getVal) { var isFunction = typeof getVal === 'function'; return { configurable: true, set: set, get: get }; function set(val) { var action = isFunction ? 'setting the method' : 'setting the property'; warn(action, 'This is effectively a ...
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
getPooledWarningPropertyDefinition
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function set(val) { var action = isFunction ? 'setting the method' : 'setting the property'; warn(action, 'This is effectively a no-op'); return val; }
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
set
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function get() { var action = isFunction ? 'accessing the method' : 'accessing the property'; var result = isFunction ? 'This is a no-op function' : 'This is set to null'; warn(action, result); return getVal; }
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
get
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function warn(action, result) { var warningCondition = false; warning$30(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist...
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
warn
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { var EventConstructor = this; if (EventConstructor.eventPool.length) { var instance = EventConstructor.eventPool.pop(); EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); return instance; }...
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
getPooledEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function releasePooledEvent(event) { var EventConstructor = this; !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0; event.destructor(); if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { EventConstructor.eventPo...
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
releasePooledEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function addEventPoolingTo(EventConstructor) { EventConstructor.eventPool = []; EventConstructor.getPooled = getPooledEvent; EventConstructor.release = releasePooledEvent; }
Helper to nullify syntheticEvent instance properties when destructing @param {String} propName @param {?object} getVal @return {object} defineProperty object
addEventPoolingTo
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticCompositionEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticInputEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isPresto() { var opera = window.opera; return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; }
Opera <= 12 includes TextEvent in window, but does not fire text input events. Rely on keypress instead.
isPresto
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
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); }
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, select-all, etc.) even though no character is inserted.
isKeypressCommand
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getCompositionEventType(topLevelType) { switch (topLevelType) { case 'topCompositionStart': return eventTypes.compositionStart; case 'topCompositionEnd': return eventTypes.compositionEnd; case 'topCompositionUpdate': return eventTypes.compositionUpdate; } }
Translate native top level events into event types. @param {string} topLevelType @return {object}
getCompositionEventType
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isFallbackCompositionStart(topLevelType, nativeEvent) { return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE; }
Does our fallback best-guess model think this event signifies that composition has begun? @param {string} topLevelType @param {object} nativeEvent @return {boolean}
isFallbackCompositionStart
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isFallbackCompositionEnd(topLevelType, nativeEvent) { switch (topLevelType) { case 'topKeyUp': // Command keys insert or clear IME input. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; case 'topKeyDown': // Expect IME keyCode on each keydown. If we get any other // c...
Does our fallback mode think that this event is the end of composition? @param {string} topLevelType @param {object} nativeEvent @return {boolean}
isFallbackCompositionEnd
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getDataFromCustomEvent(nativeEvent) { var detail = nativeEvent.detail; if (typeof detail === 'object' && 'data' in detail) { return detail.data; } return null; }
Google Input Tools provides composition data via a CustomEvent, with the `data` property populated in the `detail` object. If this is available on the event object, use it. If not, this is a plain composition event and we have nothing special to extract. @param {object} nativeEvent @return {?string}
getDataFromCustomEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getNativeBeforeInputChars(topLevelType, nativeEvent) { switch (topLevelType) { case 'topCompositionEnd': return getDataFromCustomEvent(nativeEvent); case 'topKeyPress': /** * If native `textInput` events are available, our goal is to make * use of them. However, there is a s...
@param {TopLevelTypes} topLevelType Record from `BrowserEventConstants`. @param {object} nativeEvent Native browser event. @return {?string} The string corresponding to this `beforeInput` event.
getNativeBeforeInputChars
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getFallbackBeforeInputChars(topLevelType, nativeEvent) { // If we are currently composing (IME) and using a fallback to do so, // try to extract the composed characters from the fallback object. // If composition event is available, we extract a string only at // compositionevent, otherwise extract it ...
For browsers that do not provide the `textInput` event, extract the appropriate string to use for SyntheticInputEvent. @param {string} topLevelType Record from `BrowserEventConstants`. @param {object} nativeEvent Native browser event. @return {?string} The fallback string for this `beforeInput` event.
getFallbackBeforeInputChars
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { var chars; if (canUseTextInputEvent) { chars = getNativeBeforeInputChars(topLevelType, nativeEvent); } else { chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); } // If no characters are being i...
Extract a SyntheticInputEvent for `beforeInput`, based on either native `textInput` or fallback behavior. @return {?object} A SyntheticInputEvent.
extractBeforeInputEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isTextInputElement(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); if (nodeName === 'input') { return !!supportedInputTypes[elem.type]; } if (nodeName === 'textarea') { return true; } return false; }
@see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
isTextInputElement
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function createAndAccumulateChangeEvent(inst, nativeEvent, target) { var event = SyntheticEvent_1.getPooled(eventTypes$1.change, inst, nativeEvent, target); event.type = 'change'; // Flag this event loop as needing state restore. ReactControlledComponent_1.enqueueStateRestore(target); EventPropagators_1.accum...
@see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
createAndAccumulateChangeEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElement.attachEvent('onpropertychange', handlePropertyChange); }
(For IE <=9) Starts tracking propertychange events on the passed-in element and override the value property so that we can distinguish user events from value changes in JS.
startWatchingForValueChange
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function stopWatchingForValueChange() { if (!activeElement) { return; } activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementInst = null; }
(For IE <=9) Removes the event listeners from the currently-tracked element, if any exists.
stopWatchingForValueChange
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } if (getInstIfValueChanged(activeElementInst)) { manualDispatchChangeEvent(nativeEvent); } }
(For IE <=9) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
handlePropertyChange
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { if (topLevelType === 'topFocus') { // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases ...
(For IE <=9) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
handleEventsForInputEventPolyfill
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) { if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. ...
(For IE <=9) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
getTargetInstForInputEventPolyfill
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticEvent}
SyntheticUIEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
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; }
Translation from modifier key to the associated property in the event. @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
modifierStateGetter
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getEventModifierState(nativeEvent) { return modifierStateGetter; }
Translation from modifier key to the associated property in the event. @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
getEventModifierState
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticMouseEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getSelection(node) { if ('selectionStart' in node && ReactInputSelection_1.hasSelectionCapabilities(node)) { return { start: node.selectionStart, end: node.selectionEnd }; } else if (window.getSelection) { var selection = window.getSelection(); return { anchorNode: selecti...
Get an object which is a unique representation of the current selection. The return value will not be consistent across nodes or browsers, but two identical selections on the same node will return identical objects. @param {DOMElement} node @return {object}
getSelection
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function constructSelectEvent(nativeEvent, nativeEventTarget) { // Ensure we have the right element, and that the user is not dragging a // selection (this matches native `select` event behavior). In HTML5, select // fires only on input and textarea thus if there's no focused element we // won't dispatch. if ...
Poll selection to see whether it's changed. @param {object} nativeEvent @return {?SyntheticEvent}
constructSelectEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticEvent}
SyntheticAnimationEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticClipboardEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticFocusEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getEventCharCode(nativeEvent) { var charCode; var keyCode = nativeEvent.keyCode; if ('charCode' in nativeEvent) { charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`. if (charCode === 0 && keyCode === 13) { charCode = 13; } }...
`charCode` represents the actual "character code" and is safe to use with `String.fromCharCode`. As such, only keys that correspond to printable characters produce a valid `charCode`, the only exception to this is Enter. The Tab-key is considered non-printable and does not have a `charCode`, presumably because it does ...
getEventCharCode
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getEventKey(nativeEvent) { if (nativeEvent.key) { // Normalize inconsistent values reported by browsers due to // implementations of a working draft specification. // FireFox implements `key` but returns `MozPrintableKey` for all // printable characters (normalized to `Unidentified`), ignore...
@param {object} nativeEvent Native browser event. @return {string} Normalized `key` property.
getEventKey
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticKeyboardEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticMouseEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticDragEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticUIEvent}
SyntheticTouchEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticEvent}
SyntheticTransitionEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticMouseEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticMouseEvent}
SyntheticWheelEvent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
capitalize = function (token) { return token[1].toUpperCase(); }
This is a list of all SVG attributes that need special casing, namespacing, or boolean value assignment. When adding attributes to this list, be sure to also add them to the `possibleStandardNames` module to ensure casing and incorrect name warnings. SVG Attributes List: https://www.w3.org/TR/SVG/attindex.html SMIL S...
capitalize
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function isValidContainer(node) { return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable ')); }
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
isValidContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getReactRootElementInContainer(container) { if (!container) { return null; } if (container.nodeType === DOCUMENT_NODE) { return container.documentElement; } else { return container.firstChild; } }
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
getReactRootElementInContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function shouldHydrateDueToLegacyHeuristic(container) { var rootElement = getReactRootElementInContainer(container); return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME)); }
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
shouldHydrateDueToLegacyHeuristic
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function shouldAutoFocusHostComponent(type, props) { switch (type) { case 'button': case 'input': case 'select': case 'textarea': return !!props.autoFocus; } return false; }
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
shouldAutoFocusHostComponent
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function renderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; { if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) { var hostInstance = DOMRende...
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
renderSubtreeIntoContainer
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function createPortal(children, container) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; // TODO: pass ReactDOM portal implementation as third argument return ReactPortal....
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
createPortal
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function hyphenateStyleName(string) { return hyphenate(string).replace(msPattern, '-ms-'); }
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
hyphenateStyleName
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function hyphenate(string) { return string.replace(_uppercasePattern, '-$1').toLowerCase(); }
Hyphenates a camelcased string, for example: > hyphenate('backgroundColor') < "background-color" For CSS style names, use `hyphenateStyleName` instead which works properly with all vendor prefixes, including `ms`. @param {string} string @return {string}
hyphenate
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function camelize(string) { return string.replace(_hyphenPattern, function (_, character) { return character.toUpperCase(); }); }
Camelcases a hyphenated string, for example: > camelize('background-color') < "backgroundColor" @param {string} string @return {string}
camelize
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } }
Returns the iterator method function contained on the iterable object. Be sure to invoke the function with the iterable as context: var iteratorFn = getIteratorFn(myIterable); if (iteratorFn) { var iterator = iteratorFn.call(myIterable); ... } @param {?object} maybeIterable @return {?function...
getIteratorFn
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function PropTypeError(message) { this.message = message; this.stack = ''; }
We use an Error-like object for backward compatibility as people may call PropTypes directly and inspect their output. However, we don't use real Errors anymore. We don't inspect their stack anyway, and creating them is prohibitively expensive if they are created too often, such as what happens in oneOfType() for any t...
PropTypeError
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentNam...
We use an Error-like object for backward compatibility as people may call PropTypes directly and inspect their output. However, we don't use real Errors anymore. We don't inspect their stack anyway, and creating them is prohibitively expensive if they are created too often, such as what happens in oneOfType() for any t...
createChainableTypeChecker
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { // New behavior only for users of `...
We use an Error-like object for backward compatibility as people may call PropTypes directly and inspect their output. However, we don't use real Errors anymore. We don't inspect their stack anyway, and creating them is prohibitively expensive if they are created too often, such as what happens in oneOfType() for any t...
checkType
javascript
agermanidis/livepython
dist/main.js
https://github.com/agermanidis/livepython/blob/master/dist/main.js
MIT