Skip to content

Commit 0af3349

Browse files
committed
chore: limit cloning of parent
1 parent 84a1e41 commit 0af3349

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/ContextParser.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,13 @@ must be one of ${Util.CONTAINERS.join(', ')}`, ERROR_CODES.INVALID_CONTAINER_MAP
663663
options: IParseOptions = {}, ioptions: { skipValidation?: boolean } = {}): Promise<JsonLdContextNormalized> {
664664
const {
665665
baseIRI,
666-
parentContext: parentContextInitial,
666+
parentContext,
667667
external,
668668
processingMode = ContextParser.DEFAULT_PROCESSING_MODE,
669669
normalizeLanguageTags,
670670
ignoreProtection,
671671
minimalProcessing,
672672
} = options;
673-
let parentContext = parentContextInitial;
674673
const remoteContexts = options.remoteContexts || {};
675674

676675
// Avoid remote context overflows
@@ -748,9 +747,6 @@ must be one of ${Util.CONTAINERS.join(', ')}`, ERROR_CODES.INVALID_CONTAINER_MAP
748747

749748
// Make a deep clone of the given context, to avoid modifying it.
750749
context = <IJsonLdContextNormalizedRaw> {...context};
751-
if (parentContext && !minimalProcessing) {
752-
parentContext = <IJsonLdContextNormalizedRaw> {...parentContext};
753-
}
754750

755751
// According to the JSON-LD spec, @base must be ignored from external contexts.
756752
if (external) {
@@ -1003,4 +999,3 @@ export interface IParseOptions {
1003999
*/
10041000
ignoreScopedContexts?: boolean;
10051001
}
1006-

0 commit comments

Comments
 (0)