chore: use webpack-compatible pure annotation

This commit is contained in:
Evan You 2019-10-15 12:22:32 -04:00
parent 7de3aee317
commit 74d501829c
4 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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)

View File

@ -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)

View File

@ -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,