Lines Matching refs:item
749 * Each item to be serialized can have the following fields:
771 const queue = [{item: inValue}];
779 * serialized. Each item in the queue can have the following properties:
781 * item (required) - the input item to be serialized
784 * which the serialization of the current item will be added.
788 * depending on whether the item represents a key or a value
792 const {item, target, targetName} = queue.shift();
793 let type = typeName(item);
797 if (objectsSeen.has(item)) {
798 let outputValue = objectsSeen.get(item);
810 serialized.value = item;
813 if (item !== item) {
815 } else if (item === 0 && 1/item == Number.NEGATIVE_INFINITY) {
817 } else if (item === Number.POSITIVE_INFINITY) {
819 } else if (item === Number.NEGATIVE_INFINITY) {
822 serialized.value = item;
827 serialized.value = item.toString();
831 type: item.type,
832 objectId: item.objectId
836 serialized.value = item.uuid;
840 pattern: item.source,
841 flags: item.flags
845 serialized.value = Date.prototype.toJSON.call(item);
849 type: item.constructor.name,
850 name: item.name,
851 message: item.message,
852 lineNumber: item.lineNumber,
853 columnNumber: item.columnNumber,
854 fileName: item.fileName,
855 stack: item.stack,
861 for (let child of item) {
862 queue.push({item: child, target: serialized});
867 for (let [targetName, child] of Object.entries(item)) {
868 queue.push({item: child, target: serialized, targetName});
873 for (let [childKey, childValue] of item.entries()) {
874 queue.push({item: childKey, target: serialized, targetName: "key"});
875 queue.push({item: childValue, target: serialized, targetName: "value"});
883 objectsSeen.set(item, serialized);
927 let queue = [{item: obj, target: null}];
931 * deserialized. Each item in the queue has the following properties:
933 * item - The input item to be deserialised.
941 * output object. For maps, "key" if the item is a key in the output map,
945 const {item, target, targetName} = queue.shift();
946 const {type, value, objectId} = item;
1010 // The item.value.type property is the name of the error constructor.
1014 if (item.value.type in self &&
1015 typeof self[item.value.type] === "function") {
1016 result = new self[item.value.type](item.value.message);
1018 result = new Error(item.value.message);
1020 result.name = item.value.name;
1021 result.lineNumber = item.value.lineNumber;
1022 result.columnNumber = item.value.columnNumber;
1023 result.fileName = item.value.fileName;
1024 result.stack = item.value.stack;
1030 queue.push({item: child, target: newTarget});
1037 queue.push({item: child, target: newTarget});
1044 queue.push({item: child, target: newTarget, targetName});
1051 queue.push({item: key, target: newTarget, targetName: "key"});
1052 queue.push({item: child, target: newTarget, targetName: "value"});