Просмотр исходного кода

chore: use webpack-compatible pure annotation

Evan You 6 лет назад
Родитель
Сommit
74d501829c

+ 1 - 1
packages/compiler-core/src/transforms/transformExpression.ts

@@ -25,7 +25,7 @@ import {
 } from '../utils'
 import { isGloballyWhitelisted, makeMap } from '@vue/shared'
 
-const isLiteralWhitelisted = /*@__PURE__*/ makeMap('true,false,null,this')
+const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
 
 export const transformExpression: NodeTransform = (node, context) => {
   if (node.type === NodeTypes.INTERPOLATION) {

+ 3 - 3
packages/shared/src/element.ts

@@ -23,6 +23,6 @@ const SVG_TAGS =
 const VOID_TAGS =
   'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'
 
-export const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS)
-export const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS)
-export const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS)
+export const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS)
+export const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS)
+export const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS)

+ 1 - 1
packages/shared/src/globalsWhitelist.ts

@@ -5,4 +5,4 @@ const GLOBALS_WHITE_LISTED =
   'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
   'Object,Boolean,String,RegExp,Map,Set,JSON,Intl'
 
-export const isGloballyWhitelisted = /*@__PURE__*/ makeMap(GLOBALS_WHITE_LISTED)
+export const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED)

+ 1 - 1
packages/shared/src/makeMap.ts

@@ -1,7 +1,7 @@
 // Make a map and return a function for checking if a key
 // is in that map.
 //
-// IMPORTANT: all calls of this function must be prefixed with /*@__PURE__*/
+// IMPORTANT: all calls of this function must be prefixed with /*#__PURE__*/
 // So that rollup can tree-shake them if necessary.
 export function makeMap(
   str: string,