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 abort(request, reason) { try { var abortableTasks = request.abortableTasks; abortableTasks.forEach(function(task) { return abortTask(task, request, reason); }); abortableTasks.clear(); if (request.destination !== null) { flushCompletedQueues(request, request.destination); } } catch (error2) { logRecoverableError(request, error2); fatalError(request, error2); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
abort
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function renderToStringImpl(children, options, generateStaticMarkup, abortReason) { var didFatal = false; var fatalError2 = null; var result = ""; var destination = { push: function(chunk) { if (chunk !== null) { result += chunk; } return true; }, destroy: function(error2) { didFatal = true; fatalError2 = error2; } }; var readyToStream = false; function onShellReady() { readyToStream = true; } var request = createRequest(children, createResponseState$1(generateStaticMarkup, options ? options.identifierPrefix : void 0), createRootFormatContext(), Infinity, onError, void 0, onShellReady, void 0, void 0); startWork(request); abort(request, abortReason); startFlowing(request, destination); if (didFatal) { throw fatalError2; } if (!readyToStream) { throw new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition."); } return result; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderToStringImpl
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function onShellReady() { readyToStream = true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
onShellReady
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function renderToString(children, options) { return renderToStringImpl(children, options, false, 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderToString
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function renderToStaticMarkup(children, options) { return renderToStringImpl(children, options, true, 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderToStaticMarkup
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function renderToNodeStream() { throw new Error("ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead."); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderToNodeStream
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function renderToStaticNodeStream() { throw new Error("ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead."); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderToStaticNodeStream
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function warn(format) { { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning("warn", format, args); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warn
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning("error", format, args); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
error
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function printWarning(level, format, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { format += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return String(item); }); argsWithFormat.unshift("Warning: " + format); Function.prototype.apply.call(console[level], console, argsWithFormat); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
printWarning
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function beginWriting(destination) { currentView = new Uint8Array(VIEW_SIZE); writtenBytes = 0; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
beginWriting
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeChunk(destination, chunk) { if (chunk.length === 0) { return; } if (chunk.length > VIEW_SIZE) { if (writtenBytes > 0) { destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes)); currentView = new Uint8Array(VIEW_SIZE); writtenBytes = 0; } destination.enqueue(chunk); return; } var bytesToWrite = chunk; var allowableBytes = currentView.length - writtenBytes; if (allowableBytes < bytesToWrite.length) { if (allowableBytes === 0) { destination.enqueue(currentView); } else { currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes); destination.enqueue(currentView); bytesToWrite = bytesToWrite.subarray(allowableBytes); } currentView = new Uint8Array(VIEW_SIZE); writtenBytes = 0; } currentView.set(bytesToWrite, writtenBytes); writtenBytes += bytesToWrite.length; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeChunk
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeChunkAndReturn(destination, chunk) { writeChunk(destination, chunk); return true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeChunkAndReturn
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function completeWriting(destination) { if (currentView && writtenBytes > 0) { destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes)); currentView = null; writtenBytes = 0; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
completeWriting
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function stringToChunk(content) { return textEncoder.encode(content); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
stringToChunk
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function stringToPrecomputedChunk(content) { return textEncoder.encode(content); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
stringToPrecomputedChunk
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function closeWithError(destination, error2) { if (typeof destination.error === "function") { destination.error(error2); } else { destination.close(); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
closeWithError
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function typeName(value) { { var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; return type; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
typeName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
willCoercionThrow
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function testStringCoercion(value) { return "" + value; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
testStringCoercion
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function checkAttributeStringCoercion(value, attributeName) { { if (willCoercionThrow(value)) { error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); return testStringCoercion(value); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkAttributeStringCoercion
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); return testStringCoercion(value); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkCSSPropertyStringCoercion
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function checkHtmlStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkHtmlStringCoercion
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } illegalAttributeNameCache[attributeName] = true; { error("Invalid attribute name: `%s`", attributeName); } return false; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
isAttributeNameSafe
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case "function": case "symbol": return true; case "boolean": { if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { var prefix2 = name.toLowerCase().slice(0, 5); return prefix2 !== "data-" && prefix2 !== "aria-"; } } default: return false; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
shouldRemoveAttributeWithWarning
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getPropertyInfo
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL2; this.removeEmptyString = removeEmptyString; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
PropertyInfoRecord
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
capitalize = function(token) { return token[1].toUpperCase(); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
capitalize
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function prefixKey(prefix2, key) { return prefix2 + key.charAt(0).toUpperCase() + key.substring(1); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
prefixKey
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."); } if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkControlledValueProps
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function isCustomComponent(tagName, props) { if (tagName.indexOf("-") === -1) { return typeof props.is === "string"; } switch (tagName) { case "annotation-xml": case "color-profile": case "font-face": case "font-face-src": case "font-face-uri": case "font-face-format": case "font-face-name": case "missing-glyph": return false; default: return true; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
isCustomComponent
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function validateProperty(tagName, name) { { if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { return true; } if (rARIACamel.test(name)) { var ariaName = "aria-" + name.slice(4).toLowerCase(); var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; if (correctName == null) { error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name); warnedProperties[name] = true; return true; } if (name !== correctName) { error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName); warnedProperties[name] = true; return true; } } if (rARIA.test(name)) { var lowerCasedName = name.toLowerCase(); var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; if (standardName == null) { warnedProperties[name] = true; return false; } if (name !== standardName) { error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName); warnedProperties[name] = true; return true; } } } return true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateProperty
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function warnInvalidARIAProps(type, props) { { var invalidProps = []; for (var key in props) { var isValid = validateProperty(type, key); if (!isValid) { invalidProps.push(key); } } var unknownPropString = invalidProps.map(function(prop) { return "`" + prop + "`"; }).join(", "); if (invalidProps.length === 1) { error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); } else if (invalidProps.length > 1) { error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnInvalidARIAProps
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function validateProperties(type, props) { if (isCustomComponent(type, props)) { return; } warnInvalidARIAProps(type, props); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateProperties
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function validateProperties$1(type, props) { { if (type !== "input" && type !== "textarea" && type !== "select") { return; } if (props != null && props.value === null && !didWarnValueNull) { didWarnValueNull = true; if (type === "select" && props.multiple) { error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type); } else { error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type); } } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateProperties$1
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnUnknownProperties = function(type, props, eventRegistry) { { var unknownProps = []; for (var key in props) { var isValid = validateProperty$1(type, key, props[key], eventRegistry); if (!isValid) { unknownProps.push(key); } } var unknownPropString = unknownProps.map(function(prop) { return "`" + prop + "`"; }).join(", "); if (unknownProps.length === 1) { error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type); } else if (unknownProps.length > 1) { error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnUnknownProperties
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function validateProperties$2(type, props, eventRegistry) { if (isCustomComponent(type, props)) { return; } warnUnknownProperties(type, props, eventRegistry); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateProperties$2
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
camelize = function(string) { return string.replace(hyphenPattern, function(_, character) { return character.toUpperCase(); }); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
camelize
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnHyphenatedStyleName = function(name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error( "Unsupported style property %s. Did you mean %s?", name, // As Andi Smith suggests // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix // is converted to lowercase `ms`. camelize(name.replace(msPattern, "ms-")) ); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnHyphenatedStyleName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnBadVendoredStyleName = function(name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1)); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnBadVendoredStyleName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnStyleValueWithSemicolon = function(name, value) { if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { return; } warnedStyleValues[value] = true; error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, "")); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnStyleValueWithSemicolon
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnStyleValueIsNaN = function(name, value) { if (warnedForNaNValue) { return; } warnedForNaNValue = true; error("`NaN` is an invalid value for the `%s` css style property.", name); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnStyleValueIsNaN
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
warnStyleValueIsInfinity = function(name, value) { if (warnedForInfinityValue) { return; } warnedForInfinityValue = true; error("`Infinity` is an invalid value for the `%s` css style property.", name); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnStyleValueIsInfinity
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function escapeHtml(string) { { checkHtmlStringCoercion(string); } var str = "" + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ""; var index; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: escape = "&quot;"; break; case 38: escape = "&amp;"; break; case 39: escape = "&#x27;"; break; case 60: escape = "&lt;"; break; case 62: escape = "&gt;"; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
escapeHtml
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function escapeTextForBrowser(text) { if (typeof text === "boolean" || typeof text === "number") { return "" + text; } return escapeHtml(text); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
escapeTextForBrowser
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function hyphenateStyleName(name) { return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern$1, "-ms-"); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
hyphenateStyleName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
sanitizeURL
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function isArray(a) { return isArrayImpl(a); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
isArray
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function escapeBootstrapScriptContent(scriptText) { { checkHtmlStringCoercion(scriptText); } return ("" + scriptText).replace(scriptRegex, scriptReplacer); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
escapeBootstrapScriptContent
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
scriptReplacer = function(match, prefix2, s, suffix) { return "" + prefix2 + (s === "s" ? "\\u0073" : "\\u0053") + suffix; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
scriptReplacer
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function createResponseState(identifierPrefix, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules) { var idPrefix = identifierPrefix === void 0 ? "" : identifierPrefix; var inlineScriptWithNonce = nonce === void 0 ? startInlineScript : stringToPrecomputedChunk('<script nonce="' + escapeTextForBrowser(nonce) + '">'); var bootstrapChunks = []; if (bootstrapScriptContent !== void 0) { bootstrapChunks.push(inlineScriptWithNonce, stringToChunk(escapeBootstrapScriptContent(bootstrapScriptContent)), endInlineScript); } if (bootstrapScripts !== void 0) { for (var i = 0; i < bootstrapScripts.length; i++) { bootstrapChunks.push(startScriptSrc, stringToChunk(escapeTextForBrowser(bootstrapScripts[i])), endAsyncScript); } } if (bootstrapModules !== void 0) { for (var _i = 0; _i < bootstrapModules.length; _i++) { bootstrapChunks.push(startModuleSrc, stringToChunk(escapeTextForBrowser(bootstrapModules[_i])), endAsyncScript); } } return { bootstrapChunks, startInlineScript: inlineScriptWithNonce, placeholderPrefix: stringToPrecomputedChunk(idPrefix + "P:"), segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"), boundaryPrefix: idPrefix + "B:", idPrefix, nextSuspenseID: 0, sentCompleteSegmentFunction: false, sentCompleteBoundaryFunction: false, sentClientRenderFunction: false }; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createResponseState
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function createFormatContext(insertionMode, selectedValue) { return { insertionMode, selectedValue }; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createFormatContext
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function createRootFormatContext(namespaceURI) { var insertionMode = namespaceURI === "http://www.w3.org/2000/svg" ? SVG_MODE : namespaceURI === "http://www.w3.org/1998/Math/MathML" ? MATHML_MODE : ROOT_HTML_MODE; return createFormatContext(insertionMode, null); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createRootFormatContext
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getChildFormatContext(parentContext, type, props) { switch (type) { case "select": return createFormatContext(HTML_MODE, props.value != null ? props.value : props.defaultValue); case "svg": return createFormatContext(SVG_MODE, null); case "math": return createFormatContext(MATHML_MODE, null); case "foreignObject": return createFormatContext(HTML_MODE, null); case "table": return createFormatContext(HTML_TABLE_MODE, null); case "thead": case "tbody": case "tfoot": return createFormatContext(HTML_TABLE_BODY_MODE, null); case "colgroup": return createFormatContext(HTML_COLGROUP_MODE, null); case "tr": return createFormatContext(HTML_TABLE_ROW_MODE, null); } if (parentContext.insertionMode >= HTML_TABLE_MODE) { return createFormatContext(HTML_MODE, null); } if (parentContext.insertionMode === ROOT_HTML_MODE) { return createFormatContext(HTML_MODE, null); } return parentContext; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getChildFormatContext
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function assignSuspenseBoundaryID(responseState) { var generatedID = responseState.nextSuspenseID++; return stringToPrecomputedChunk(responseState.boundaryPrefix + generatedID.toString(16)); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
assignSuspenseBoundaryID
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function makeId(responseState, treeId, localId) { var idPrefix = responseState.idPrefix; var id = ":" + idPrefix + "R" + treeId; if (localId > 0) { id += "H" + localId.toString(32); } return id + ":"; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
makeId
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function encodeHTMLTextNode(text) { return escapeTextForBrowser(text); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
encodeHTMLTextNode
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushTextInstance(target, text, responseState, textEmbedded) { if (text === "") { return textEmbedded; } if (textEmbedded) { target.push(textSeparator); } target.push(stringToChunk(encodeHTMLTextNode(text))); return true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushTextInstance
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushSegmentFinale(target, responseState, lastPushedText, textEmbedded) { if (lastPushedText && textEmbedded) { target.push(textSeparator); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushSegmentFinale
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function processStyleName(styleName) { var chunk = styleNameCache.get(styleName); if (chunk !== void 0) { return chunk; } var result = stringToPrecomputedChunk(escapeTextForBrowser(hyphenateStyleName(styleName))); styleNameCache.set(styleName, result); return result; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
processStyleName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStyle(target, responseState, style) { if (typeof style !== "object") { throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."); } var isFirst = true; for (var styleName in style) { if (!hasOwnProperty.call(style, styleName)) { continue; } var styleValue = style[styleName]; if (styleValue == null || typeof styleValue === "boolean" || styleValue === "") { continue; } var nameChunk = void 0; var valueChunk = void 0; var isCustomProperty = styleName.indexOf("--") === 0; if (isCustomProperty) { nameChunk = stringToChunk(escapeTextForBrowser(styleName)); { checkCSSPropertyStringCoercion(styleValue, styleName); } valueChunk = stringToChunk(escapeTextForBrowser(("" + styleValue).trim())); } else { { warnValidStyle$1(styleName, styleValue); } nameChunk = processStyleName(styleName); if (typeof styleValue === "number") { if (styleValue !== 0 && !hasOwnProperty.call(isUnitlessNumber, styleName)) { valueChunk = stringToChunk(styleValue + "px"); } else { valueChunk = stringToChunk("" + styleValue); } } else { { checkCSSPropertyStringCoercion(styleValue, styleName); } valueChunk = stringToChunk(escapeTextForBrowser(("" + styleValue).trim())); } } if (isFirst) { isFirst = false; target.push(styleAttributeStart, nameChunk, styleAssign, valueChunk); } else { target.push(styleSeparator, nameChunk, styleAssign, valueChunk); } } if (!isFirst) { target.push(attributeEnd); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStyle
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushAttribute(target, responseState, name, value) { switch (name) { case "style": { pushStyle(target, responseState, value); return; } case "defaultValue": case "defaultChecked": case "innerHTML": case "suppressContentEditableWarning": case "suppressHydrationWarning": return; } if ( // shouldIgnoreAttribute // We have already filtered out null/undefined and reserved words. name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N") ) { return; } var propertyInfo = getPropertyInfo(name); if (propertyInfo !== null) { switch (typeof value) { case "function": case "symbol": return; case "boolean": { if (!propertyInfo.acceptsBooleans) { return; } } } var attributeName = propertyInfo.attributeName; var attributeNameChunk = stringToChunk(attributeName); switch (propertyInfo.type) { case BOOLEAN: if (value) { target.push(attributeSeparator, attributeNameChunk, attributeEmptyString); } return; case OVERLOADED_BOOLEAN: if (value === true) { target.push(attributeSeparator, attributeNameChunk, attributeEmptyString); } else if (value === false) ; else { target.push(attributeSeparator, attributeNameChunk, attributeAssign, stringToChunk(escapeTextForBrowser(value)), attributeEnd); } return; case NUMERIC: if (!isNaN(value)) { target.push(attributeSeparator, attributeNameChunk, attributeAssign, stringToChunk(escapeTextForBrowser(value)), attributeEnd); } break; case POSITIVE_NUMERIC: if (!isNaN(value) && value >= 1) { target.push(attributeSeparator, attributeNameChunk, attributeAssign, stringToChunk(escapeTextForBrowser(value)), attributeEnd); } break; default: if (propertyInfo.sanitizeURL) { { checkAttributeStringCoercion(value, attributeName); } value = "" + value; sanitizeURL(value); } target.push(attributeSeparator, attributeNameChunk, attributeAssign, stringToChunk(escapeTextForBrowser(value)), attributeEnd); } } else if (isAttributeNameSafe(name)) { switch (typeof value) { case "function": case "symbol": return; case "boolean": { var prefix2 = name.toLowerCase().slice(0, 5); if (prefix2 !== "data-" && prefix2 !== "aria-") { return; } } } target.push(attributeSeparator, stringToChunk(name), attributeAssign, stringToChunk(escapeTextForBrowser(value)), attributeEnd); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushAttribute
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushInnerHTML(target, innerHTML, children) { if (innerHTML != null) { if (children != null) { throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); } if (typeof innerHTML !== "object" || !("__html" in innerHTML)) { throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."); } var html = innerHTML.__html; if (html !== null && html !== void 0) { { checkHtmlStringCoercion(html); } target.push(stringToChunk("" + html)); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushInnerHTML
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function checkSelectProp(props, propName) { { var value = props[propName]; if (value != null) { var array = isArray(value); if (props.multiple && !array) { error("The `%s` prop supplied to <select> must be an array if `multiple` is true.", propName); } else if (!props.multiple && array) { error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.", propName); } } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkSelectProp
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartSelect(target, props, responseState) { { checkControlledValueProps("select", props); checkSelectProp(props, "value"); checkSelectProp(props, "defaultValue"); if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnDefaultSelectValue) { error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"); didWarnDefaultSelectValue = true; } } target.push(startChunkForTag("select")); var children = null; var innerHTML = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; case "defaultValue": case "value": break; default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTag); pushInnerHTML(target, innerHTML, children); return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartSelect
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function flattenOptionChildren(children) { var content = ""; React3.Children.forEach(children, function(child) { if (child == null) { return; } content += child; { if (!didWarnInvalidOptionChildren && typeof child !== "string" && typeof child !== "number") { didWarnInvalidOptionChildren = true; error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."); } } }); return content; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
flattenOptionChildren
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartOption(target, props, responseState, formatContext) { var selectedValue = formatContext.selectedValue; target.push(startChunkForTag("option")); var children = null; var value = null; var selected = null; var innerHTML = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "selected": selected = propValue; { if (!didWarnSelectedSetOnOption) { error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."); didWarnSelectedSetOnOption = true; } } break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; case "value": value = propValue; default: pushAttribute(target, responseState, propKey, propValue); break; } } } if (selectedValue != null) { var stringValue; if (value !== null) { { checkAttributeStringCoercion(value, "value"); } stringValue = "" + value; } else { { if (innerHTML !== null) { if (!didWarnInvalidOptionInnerHTML) { didWarnInvalidOptionInnerHTML = true; error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."); } } } stringValue = flattenOptionChildren(children); } if (isArray(selectedValue)) { for (var i = 0; i < selectedValue.length; i++) { { checkAttributeStringCoercion(selectedValue[i], "value"); } var v = "" + selectedValue[i]; if (v === stringValue) { target.push(selectedMarkerAttribute); break; } } } else { { checkAttributeStringCoercion(selectedValue, "select.value"); } if ("" + selectedValue === stringValue) { target.push(selectedMarkerAttribute); } } } else if (selected) { target.push(selectedMarkerAttribute); } target.push(endOfStartTag); pushInnerHTML(target, innerHTML, children); return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartOption
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushInput(target, props, responseState) { { checkControlledValueProps("input", props); if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnDefaultChecked) { error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", "A component", props.type); didWarnDefaultChecked = true; } if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnDefaultInputValue) { error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", "A component", props.type); didWarnDefaultInputValue = true; } } target.push(startChunkForTag("input")); var value = null; var defaultValue = null; var checked = null; var defaultChecked = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": case "dangerouslySetInnerHTML": throw new Error("input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."); case "defaultChecked": defaultChecked = propValue; break; case "defaultValue": defaultValue = propValue; break; case "checked": checked = propValue; break; case "value": value = propValue; break; default: pushAttribute(target, responseState, propKey, propValue); break; } } } if (checked !== null) { pushAttribute(target, responseState, "checked", checked); } else if (defaultChecked !== null) { pushAttribute(target, responseState, "checked", defaultChecked); } if (value !== null) { pushAttribute(target, responseState, "value", value); } else if (defaultValue !== null) { pushAttribute(target, responseState, "value", defaultValue); } target.push(endOfStartTagSelfClosing); return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushInput
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartTextArea(target, props, responseState) { { checkControlledValueProps("textarea", props); if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnDefaultTextareaValue) { error("Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components"); didWarnDefaultTextareaValue = true; } } target.push(startChunkForTag("textarea")); var value = null; var defaultValue = null; var children = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "value": value = propValue; break; case "defaultValue": defaultValue = propValue; break; case "dangerouslySetInnerHTML": throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>."); default: pushAttribute(target, responseState, propKey, propValue); break; } } } if (value === null && defaultValue !== null) { value = defaultValue; } target.push(endOfStartTag); if (children != null) { { error("Use the `defaultValue` or `value` props instead of setting children on <textarea>."); } if (value != null) { throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children."); } if (isArray(children)) { if (children.length > 1) { throw new Error("<textarea> can only have at most one child."); } { checkHtmlStringCoercion(children[0]); } value = "" + children[0]; } { checkHtmlStringCoercion(children); } value = "" + children; } if (typeof value === "string" && value[0] === "\n") { target.push(leadingNewline); } if (value !== null) { { checkAttributeStringCoercion(value, "value"); } target.push(stringToChunk(encodeHTMLTextNode("" + value))); } return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartTextArea
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushSelfClosing(target, props, tag, responseState) { target.push(startChunkForTag(tag)); for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": case "dangerouslySetInnerHTML": throw new Error(tag + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."); default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTagSelfClosing); return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushSelfClosing
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartMenuItem(target, props, responseState) { target.push(startChunkForTag("menuitem")); for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": case "dangerouslySetInnerHTML": throw new Error("menuitems cannot have `children` nor `dangerouslySetInnerHTML`."); default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTag); return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartMenuItem
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartTitle(target, props, responseState) { target.push(startChunkForTag("title")); var children = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": throw new Error("`dangerouslySetInnerHTML` does not make sense on <title>."); default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTag); { var child = Array.isArray(children) && children.length < 2 ? children[0] || null : children; if (Array.isArray(children) && children.length > 1) { error("A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"); } else if (child != null && child.$$typeof != null) { error("A title element received a React element for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"); } else if (child != null && typeof child !== "string" && typeof child !== "number") { error("A title element received a value that was not a string or number for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"); } } return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartTitle
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartGenericElement(target, props, tag, responseState) { target.push(startChunkForTag(tag)); var children = null; var innerHTML = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTag); pushInnerHTML(target, innerHTML, children); if (typeof children === "string") { target.push(stringToChunk(encodeHTMLTextNode(children))); return null; } return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartGenericElement
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartCustomElement(target, props, tag, responseState) { target.push(startChunkForTag(tag)); var children = null; var innerHTML = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; case "style": pushStyle(target, responseState, propValue); break; case "suppressContentEditableWarning": case "suppressHydrationWarning": break; default: if (isAttributeNameSafe(propKey) && typeof propValue !== "function" && typeof propValue !== "symbol") { target.push(attributeSeparator, stringToChunk(propKey), attributeAssign, stringToChunk(escapeTextForBrowser(propValue)), attributeEnd); } break; } } } target.push(endOfStartTag); pushInnerHTML(target, innerHTML, children); return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartCustomElement
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartPreformattedElement(target, props, tag, responseState) { target.push(startChunkForTag(tag)); var children = null; var innerHTML = null; for (var propKey in props) { if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (propValue == null) { continue; } switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, responseState, propKey, propValue); break; } } } target.push(endOfStartTag); if (innerHTML != null) { if (children != null) { throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); } if (typeof innerHTML !== "object" || !("__html" in innerHTML)) { throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."); } var html = innerHTML.__html; if (html !== null && html !== void 0) { if (typeof html === "string" && html.length > 0 && html[0] === "\n") { target.push(leadingNewline, stringToChunk(html)); } else { { checkHtmlStringCoercion(html); } target.push(stringToChunk("" + html)); } } } if (typeof children === "string" && children[0] === "\n") { target.push(leadingNewline); } return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartPreformattedElement
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function startChunkForTag(tag) { var tagStartChunk = validatedTagCache.get(tag); if (tagStartChunk === void 0) { if (!VALID_TAG_REGEX.test(tag)) { throw new Error("Invalid tag: " + tag); } tagStartChunk = stringToPrecomputedChunk("<" + tag); validatedTagCache.set(tag, tagStartChunk); } return tagStartChunk; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
startChunkForTag
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushStartInstance(target, type, props, responseState, formatContext) { { validateProperties(type, props); validateProperties$1(type, props); validateProperties$2(type, props, null); if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."); } if (formatContext.insertionMode !== SVG_MODE && formatContext.insertionMode !== MATHML_MODE) { if (type.indexOf("-") === -1 && typeof props.is !== "string" && type.toLowerCase() !== type) { error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type); } } } switch (type) { case "select": return pushStartSelect(target, props, responseState); case "option": return pushStartOption(target, props, responseState, formatContext); case "textarea": return pushStartTextArea(target, props, responseState); case "input": return pushInput(target, props, responseState); case "menuitem": return pushStartMenuItem(target, props, responseState); case "title": return pushStartTitle(target, props, responseState); case "listing": case "pre": { return pushStartPreformattedElement(target, props, type, responseState); } case "area": case "base": case "br": case "col": case "embed": case "hr": case "img": case "keygen": case "link": case "meta": case "param": case "source": case "track": case "wbr": { return pushSelfClosing(target, props, type, responseState); } case "annotation-xml": case "color-profile": case "font-face": case "font-face-src": case "font-face-uri": case "font-face-format": case "font-face-name": case "missing-glyph": { return pushStartGenericElement(target, props, type, responseState); } case "html": { if (formatContext.insertionMode === ROOT_HTML_MODE) { target.push(DOCTYPE); } return pushStartGenericElement(target, props, type, responseState); } default: { if (type.indexOf("-") === -1 && typeof props.is !== "string") { return pushStartGenericElement(target, props, type, responseState); } else { return pushStartCustomElement(target, props, type, responseState); } } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushStartInstance
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function pushEndInstance(target, type, props) { switch (type) { case "area": case "base": case "br": case "col": case "embed": case "hr": case "img": case "input": case "keygen": case "link": case "meta": case "param": case "source": case "track": case "wbr": { break; } default: { target.push(endTag1, stringToChunk(type), endTag2); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushEndInstance
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeCompletedRoot(destination, responseState) { var bootstrapChunks = responseState.bootstrapChunks; var i = 0; for (; i < bootstrapChunks.length - 1; i++) { writeChunk(destination, bootstrapChunks[i]); } if (i < bootstrapChunks.length) { return writeChunkAndReturn(destination, bootstrapChunks[i]); } return true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeCompletedRoot
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writePlaceholder(destination, responseState, id) { writeChunk(destination, placeholder1); writeChunk(destination, responseState.placeholderPrefix); var formattedID = stringToChunk(id.toString(16)); writeChunk(destination, formattedID); return writeChunkAndReturn(destination, placeholder2); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writePlaceholder
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeStartCompletedSuspenseBoundary(destination, responseState) { return writeChunkAndReturn(destination, startCompletedSuspenseBoundary); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeStartCompletedSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeStartPendingSuspenseBoundary(destination, responseState, id) { writeChunk(destination, startPendingSuspenseBoundary1); if (id === null) { throw new Error("An ID must have been assigned before we can complete the boundary."); } writeChunk(destination, id); return writeChunkAndReturn(destination, startPendingSuspenseBoundary2); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeStartPendingSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeStartClientRenderedSuspenseBoundary(destination, responseState, errorDigest, errorMesssage, errorComponentStack) { var result; result = writeChunkAndReturn(destination, startClientRenderedSuspenseBoundary); writeChunk(destination, clientRenderedSuspenseBoundaryError1); if (errorDigest) { writeChunk(destination, clientRenderedSuspenseBoundaryError1A); writeChunk(destination, stringToChunk(escapeTextForBrowser(errorDigest))); writeChunk(destination, clientRenderedSuspenseBoundaryErrorAttrInterstitial); } { if (errorMesssage) { writeChunk(destination, clientRenderedSuspenseBoundaryError1B); writeChunk(destination, stringToChunk(escapeTextForBrowser(errorMesssage))); writeChunk(destination, clientRenderedSuspenseBoundaryErrorAttrInterstitial); } if (errorComponentStack) { writeChunk(destination, clientRenderedSuspenseBoundaryError1C); writeChunk(destination, stringToChunk(escapeTextForBrowser(errorComponentStack))); writeChunk(destination, clientRenderedSuspenseBoundaryErrorAttrInterstitial); } } result = writeChunkAndReturn(destination, clientRenderedSuspenseBoundaryError2); return result; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeStartClientRenderedSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeEndCompletedSuspenseBoundary(destination, responseState) { return writeChunkAndReturn(destination, endSuspenseBoundary); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeEndCompletedSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeEndPendingSuspenseBoundary(destination, responseState) { return writeChunkAndReturn(destination, endSuspenseBoundary); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeEndPendingSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeEndClientRenderedSuspenseBoundary(destination, responseState) { return writeChunkAndReturn(destination, endSuspenseBoundary); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeEndClientRenderedSuspenseBoundary
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeStartSegment(destination, responseState, formatContext, id) { switch (formatContext.insertionMode) { case ROOT_HTML_MODE: case HTML_MODE: { writeChunk(destination, startSegmentHTML); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentHTML2); } case SVG_MODE: { writeChunk(destination, startSegmentSVG); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentSVG2); } case MATHML_MODE: { writeChunk(destination, startSegmentMathML); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentMathML2); } case HTML_TABLE_MODE: { writeChunk(destination, startSegmentTable); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentTable2); } case HTML_TABLE_BODY_MODE: { writeChunk(destination, startSegmentTableBody); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentTableBody2); } case HTML_TABLE_ROW_MODE: { writeChunk(destination, startSegmentTableRow); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentTableRow2); } case HTML_COLGROUP_MODE: { writeChunk(destination, startSegmentColGroup); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, stringToChunk(id.toString(16))); return writeChunkAndReturn(destination, startSegmentColGroup2); } default: { throw new Error("Unknown insertion mode. This is a bug in React."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeStartSegment
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeEndSegment(destination, formatContext) { switch (formatContext.insertionMode) { case ROOT_HTML_MODE: case HTML_MODE: { return writeChunkAndReturn(destination, endSegmentHTML); } case SVG_MODE: { return writeChunkAndReturn(destination, endSegmentSVG); } case MATHML_MODE: { return writeChunkAndReturn(destination, endSegmentMathML); } case HTML_TABLE_MODE: { return writeChunkAndReturn(destination, endSegmentTable); } case HTML_TABLE_BODY_MODE: { return writeChunkAndReturn(destination, endSegmentTableBody); } case HTML_TABLE_ROW_MODE: { return writeChunkAndReturn(destination, endSegmentTableRow); } case HTML_COLGROUP_MODE: { return writeChunkAndReturn(destination, endSegmentColGroup); } default: { throw new Error("Unknown insertion mode. This is a bug in React."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeEndSegment
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeCompletedSegmentInstruction(destination, responseState, contentSegmentID) { writeChunk(destination, responseState.startInlineScript); if (!responseState.sentCompleteSegmentFunction) { responseState.sentCompleteSegmentFunction = true; writeChunk(destination, completeSegmentScript1Full); } else { writeChunk(destination, completeSegmentScript1Partial); } writeChunk(destination, responseState.segmentPrefix); var formattedID = stringToChunk(contentSegmentID.toString(16)); writeChunk(destination, formattedID); writeChunk(destination, completeSegmentScript2); writeChunk(destination, responseState.placeholderPrefix); writeChunk(destination, formattedID); return writeChunkAndReturn(destination, completeSegmentScript3); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeCompletedSegmentInstruction
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeCompletedBoundaryInstruction(destination, responseState, boundaryID, contentSegmentID) { writeChunk(destination, responseState.startInlineScript); if (!responseState.sentCompleteBoundaryFunction) { responseState.sentCompleteBoundaryFunction = true; writeChunk(destination, completeBoundaryScript1Full); } else { writeChunk(destination, completeBoundaryScript1Partial); } if (boundaryID === null) { throw new Error("An ID must have been assigned before we can complete the boundary."); } var formattedContentID = stringToChunk(contentSegmentID.toString(16)); writeChunk(destination, boundaryID); writeChunk(destination, completeBoundaryScript2); writeChunk(destination, responseState.segmentPrefix); writeChunk(destination, formattedContentID); return writeChunkAndReturn(destination, completeBoundaryScript3); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeCompletedBoundaryInstruction
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function writeClientRenderBoundaryInstruction(destination, responseState, boundaryID, errorDigest, errorMessage, errorComponentStack) { writeChunk(destination, responseState.startInlineScript); if (!responseState.sentClientRenderFunction) { responseState.sentClientRenderFunction = true; writeChunk(destination, clientRenderScript1Full); } else { writeChunk(destination, clientRenderScript1Partial); } if (boundaryID === null) { throw new Error("An ID must have been assigned before we can complete the boundary."); } writeChunk(destination, boundaryID); writeChunk(destination, clientRenderScript1A); if (errorDigest || errorMessage || errorComponentStack) { writeChunk(destination, clientRenderErrorScriptArgInterstitial); writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorDigest || ""))); } if (errorMessage || errorComponentStack) { writeChunk(destination, clientRenderErrorScriptArgInterstitial); writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorMessage || ""))); } if (errorComponentStack) { writeChunk(destination, clientRenderErrorScriptArgInterstitial); writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorComponentStack))); } return writeChunkAndReturn(destination, clientRenderScript2); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
writeClientRenderBoundaryInstruction
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function escapeJSStringsForInstructionScripts(input) { var escaped = JSON.stringify(input); return escaped.replace(regexForJSStringsInScripts, function(match) { switch (match) { case "<": return "\\u003c"; case "\u2028": return "\\u2028"; case "\u2029": return "\\u2029"; default: { throw new Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"); } } }); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
escapeJSStringsForInstructionScripts
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === "function") { return maybeIterator; } return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getIteratorFn
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ""; return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getWrappedName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getContextName(type) { return type.displayName || "Context"; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getContextName
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } } } return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getComponentNameFromType
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function disableLogs() { { if (disabledDepth === 0) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
disableLogs
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } if (disabledDepth < 0) { error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
reenableLogs
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === void 0) { try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ""; } } return "\n" + prefix + name; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeBuiltInComponentFrame
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT
function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; ReactCurrentDispatcher.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { c--; } for (; s >= 1 && c >= 0; s--, c--) { if (sampleLines[s] !== controlLines[c]) { if (s !== 1 || c !== 1) { do { s--; c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); if (fn.displayName && _frame.includes("<anonymous>")) { _frame = _frame.replace("<anonymous>", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeNativeComponentFrame
javascript
wasmerio/winterjs
tests/complex.js
https://github.com/wasmerio/winterjs/blob/master/tests/complex.js
MIT