From: daiwei Date: Wed, 14 Jan 2026 00:43:21 +0000 (+0800) Subject: style(runtime-vapor): remove spaces in NO_SIDE_EFFECTS pragma comments X-Git-Tag: v3.6.0-beta.4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e05882f993a786352a62c937d7c8e94cd020d519;p=thirdparty%2Fvuejs%2Fcore.git style(runtime-vapor): remove spaces in NO_SIDE_EFFECTS pragma comments --- diff --git a/packages/runtime-vapor/src/apiDefineComponent.ts b/packages/runtime-vapor/src/apiDefineComponent.ts index db6a0d0b58..8286e6088c 100644 --- a/packages/runtime-vapor/src/apiDefineComponent.ts +++ b/packages/runtime-vapor/src/apiDefineComponent.ts @@ -212,7 +212,7 @@ export function defineVaporComponent< InferredProps > -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function defineVaporComponent(comp: any, extraOptions?: any) { if (isFunction(comp)) { // #8236: extend call and options.name access are considered side-effects diff --git a/packages/runtime-vapor/src/dom/node.ts b/packages/runtime-vapor/src/dom/node.ts index 4144aa7a08..e22b5c6be1 100644 --- a/packages/runtime-vapor/src/dom/node.ts +++ b/packages/runtime-vapor/src/dom/node.ts @@ -1,22 +1,22 @@ import type { ChildItem, InsertionParent } from '../insertionState' import { isComment, locateEndAnchor } from './hydration' -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function createElement(tagName: string): HTMLElement { return document.createElement(tagName) } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function createTextNode(value = ''): Text { return document.createTextNode(value) } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function createComment(data: string): Comment { return document.createComment(data) } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function querySelector(selectors: string): Element | null { return document.querySelector(selectors) } @@ -26,13 +26,13 @@ export function parentNode(node: Node): ParentNode | null { return node.parentNode } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ const _txt: typeof _child = _child /** * Hydration-specific version of `txt`. */ -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ const __txt = (node: ParentNode): Node => { let n = node.firstChild! @@ -45,7 +45,7 @@ const __txt = (node: ParentNode): Node => { return n } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function _child(node: InsertionParent): Node { return node.firstChild! } @@ -53,12 +53,12 @@ export function _child(node: InsertionParent): Node { /** * Hydration-specific version of `child`. */ -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function __child(node: ParentNode, logicalIndex: number = 0): Node { return locateChildByLogicalIndex(node as InsertionParent, logicalIndex)! } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function _nthChild(node: InsertionParent, i: number): Node { return node.childNodes[i] } @@ -66,12 +66,12 @@ export function _nthChild(node: InsertionParent, i: number): Node { /** * Hydration-specific version of `nthChild`. */ -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function __nthChild(node: Node, logicalIndex: number): Node { return locateChildByLogicalIndex(node as InsertionParent, logicalIndex)! } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function _next(node: Node): Node { return node.nextSibling! } @@ -79,7 +79,7 @@ export function _next(node: Node): Node { /** * Hydration-specific version of `next`. */ -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function __next(node: Node, logicalIndex: number): Node { return locateChildByLogicalIndex( node.parentNode! as InsertionParent, @@ -91,25 +91,25 @@ type DelegatedFunction any> = T & { impl: T } -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export const txt: DelegatedFunction = (...args) => { return txt.impl(...args) } txt.impl = _txt -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export const child: DelegatedFunction = (...args) => { return child.impl(...args) } child.impl = _child -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export const next: DelegatedFunction = (...args) => { return next.impl(...args) } next.impl = _next -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export const nthChild: DelegatedFunction = (...args) => { return nthChild.impl(...args) } diff --git a/packages/runtime-vapor/src/dom/template.ts b/packages/runtime-vapor/src/dom/template.ts index 803ce1e868..026167b97b 100644 --- a/packages/runtime-vapor/src/dom/template.ts +++ b/packages/runtime-vapor/src/dom/template.ts @@ -4,7 +4,7 @@ import { _child, createTextNode } from './node' let t: HTMLTemplateElement -/* @__NO_SIDE_EFFECTS__ */ +/*@__NO_SIDE_EFFECTS__*/ export function template(html: string, root?: boolean, ns?: Namespace) { let node: Node return (): Node & { $root?: true } => {