MCPcopy Create free account
hub / github.com/facebook/react / taintObjectReference

Function taintObjectReference

packages/react/src/ReactTaint.js:115–138  ·  view source on GitHub ↗
(
  message: ?string,
  object: Reference,
)

Source from the content-addressed store, hash-verified

113}
114
115export function taintObjectReference(
116 message: ?string,
117 object: Reference,
118): void {
119 if (!enableTaint) {
120 throw new Error('Not implemented.');
121 }
122 // eslint-disable-next-line react-internal/safe-string-coercion
123 message = '' + (message || defaultMessage);
124 if (typeof object === 'string' || typeof object === 'bigint') {
125 throw new Error(
126 'Only objects or functions can be passed to taintObjectReference. Try taintUniqueValue instead.',
127 );
128 }
129 if (
130 object === null ||
131 (typeof object !== 'object' && typeof object !== 'function')
132 ) {
133 throw new Error(
134 'Only objects or functions can be passed to taintObjectReference.',
135 );
136 }
137 TaintRegistryObjects.set(object, message);
138}

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected