mirror of https://github.com/sveltejs/svelte
parent
5895c637b0
commit
2a15f2f796
@ -1,16 +0,0 @@
|
||||
/** @import { AST } from '#compiler' */
|
||||
|
||||
/**
|
||||
* @param {any} transparent
|
||||
* @returns {AST.Fragment}
|
||||
*/
|
||||
export function create_fragment(transparent = false) {
|
||||
return {
|
||||
type: 'Fragment',
|
||||
nodes: [],
|
||||
metadata: {
|
||||
transparent,
|
||||
dynamic: false
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
/** @import { AST } from '#compiler' */
|
||||
import * as e from '../../../../errors.js';
|
||||
|
||||
/**
|
||||
* @param {AST.SvelteBody | AST.SvelteDocument | AST.SvelteOptionsRaw | AST.SvelteWindow} node
|
||||
*/
|
||||
export function disallow_children(node) {
|
||||
const { nodes } = node.fragment;
|
||||
|
||||
if (nodes.length > 0) {
|
||||
const first = nodes[0];
|
||||
const last = nodes[nodes.length - 1];
|
||||
|
||||
e.svelte_meta_invalid_content({ start: first.start, end: last.end }, node.name);
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Pushes all `items` into `array` using `push`, therefore mutating the array.
|
||||
* We do this for memory and perf reasons, and because `array.push(...items)` would
|
||||
* run into a "max call stack size exceeded" error with too many items (~65k).
|
||||
* @template T
|
||||
* @param {T[]} array
|
||||
* @param {T[]} items
|
||||
*/
|
||||
export function push_array(array, items) {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
array.push(items[i]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue