-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [#1508] Fixes problem where the release build failed
- Loading branch information
1 parent
6f99ffd
commit d79bfc8
Showing
18 changed files
with
181 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Document from '../nodes/document/Document.js'; | ||
import Node from './node/Node.js'; | ||
import * as PropertySymbol from '../PropertySymbol.js'; | ||
|
||
/** | ||
* Node factory used for setting the owner document to nodes. | ||
*/ | ||
export default class NodeFactory { | ||
public static ownerDocuments: Document[] = []; | ||
|
||
/** | ||
* Creates a node instance with the given owner document. | ||
* | ||
* @param ownerDocument Owner document. | ||
* @param nodeClass Node class. | ||
* @param [args] Node arguments. | ||
* @returns Node instance. | ||
*/ | ||
public static createNode<T extends Node>( | ||
ownerDocument: Document, | ||
nodeClass: new (...args) => T, | ||
...args: any[] | ||
): T { | ||
if (!nodeClass[PropertySymbol.ownerDocument]) { | ||
this.ownerDocuments.push(ownerDocument); | ||
} | ||
return new nodeClass(...args); | ||
} | ||
|
||
/** | ||
* Pulls an owner document from the queue. | ||
* | ||
* @returns Document. | ||
*/ | ||
public static pullOwnerDocument(): Document { | ||
return this.ownerDocuments.pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.