refactor: remove some facades (#12335)
This commit is contained in:

committed by
Alex Rickabaugh

parent
0ecd9b2df0
commit
76dd026447
@ -8,8 +8,7 @@
|
||||
|
||||
import {CompileAnimationAnimateMetadata, CompileAnimationEntryMetadata, CompileAnimationGroupMetadata, CompileAnimationKeyframesSequenceMetadata, CompileAnimationMetadata, CompileAnimationSequenceMetadata, CompileAnimationStateDeclarationMetadata, CompileAnimationStateTransitionMetadata, CompileAnimationStyleMetadata, CompileAnimationWithStepsMetadata, CompileDirectiveMetadata} from '../compile_metadata';
|
||||
import {ListWrapper, StringMapWrapper} from '../facade/collection';
|
||||
import {isArray, isBlank, isPresent, isString, isStringMap} from '../facade/lang';
|
||||
import {Math} from '../facade/math';
|
||||
import {isBlank, isPresent} from '../facade/lang';
|
||||
import {ParseError} from '../parse_util';
|
||||
import {ANY_STATE, FILL_STYLE_FLAG} from '../private_import_core';
|
||||
|
||||
@ -97,7 +96,7 @@ function _parseAnimationDeclarationStates(
|
||||
var styleValues: Styles[] = [];
|
||||
stateMetadata.styles.styles.forEach(stylesEntry => {
|
||||
// TODO (matsko): change this when we get CSS class integration support
|
||||
if (isStringMap(stylesEntry)) {
|
||||
if (typeof stylesEntry === 'object' && stylesEntry !== null) {
|
||||
styleValues.push(stylesEntry as Styles);
|
||||
} else {
|
||||
errors.push(new AnimationParseError(
|
||||
@ -172,8 +171,7 @@ function _parseAnimationTransitionExpr(
|
||||
|
||||
function _normalizeAnimationEntry(entry: CompileAnimationMetadata | CompileAnimationMetadata[]):
|
||||
CompileAnimationMetadata {
|
||||
return isArray(entry) ? new CompileAnimationSequenceMetadata(<CompileAnimationMetadata[]>entry) :
|
||||
<CompileAnimationMetadata>entry;
|
||||
return Array.isArray(entry) ? new CompileAnimationSequenceMetadata(entry) : entry;
|
||||
}
|
||||
|
||||
function _normalizeStyleMetadata(
|
||||
@ -181,7 +179,7 @@ function _normalizeStyleMetadata(
|
||||
errors: AnimationParseError[]): {[key: string]: string | number}[] {
|
||||
var normalizedStyles: {[key: string]: string | number}[] = [];
|
||||
entry.styles.forEach(styleEntry => {
|
||||
if (isString(styleEntry)) {
|
||||
if (typeof styleEntry === 'string') {
|
||||
ListWrapper.addAll(
|
||||
normalizedStyles, _resolveStylesFromState(<string>styleEntry, stateStyles, errors));
|
||||
} else {
|
||||
@ -202,10 +200,10 @@ function _normalizeStyleSteps(
|
||||
|
||||
function _mergeAnimationStyles(
|
||||
stylesList: any[], newItem: {[key: string]: string | number} | string) {
|
||||
if (isStringMap(newItem) && stylesList.length > 0) {
|
||||
if (typeof newItem === 'object' && newItem !== null && stylesList.length > 0) {
|
||||
var lastIndex = stylesList.length - 1;
|
||||
var lastItem = stylesList[lastIndex];
|
||||
if (isStringMap(lastItem)) {
|
||||
if (typeof lastItem === 'object' && lastItem !== null) {
|
||||
stylesList[lastIndex] = StringMapWrapper.merge(
|
||||
<{[key: string]: string | number}>lastItem, <{[key: string]: string | number}>newItem);
|
||||
return;
|
||||
@ -292,7 +290,7 @@ function _resolveStylesFromState(
|
||||
`Unable to apply styles due to missing a state: "${normalizedStateName}"`));
|
||||
} else {
|
||||
value.styles.forEach(stylesEntry => {
|
||||
if (isStringMap(stylesEntry)) {
|
||||
if (typeof stylesEntry === 'object' && stylesEntry !== null) {
|
||||
styles.push(stylesEntry as Styles);
|
||||
}
|
||||
});
|
||||
@ -504,7 +502,7 @@ function _parseTimeExpression(
|
||||
var duration: number;
|
||||
var delay: number = 0;
|
||||
var easing: string = null;
|
||||
if (isString(exp)) {
|
||||
if (typeof exp === 'string') {
|
||||
const matches = exp.match(regex);
|
||||
if (matches === null) {
|
||||
errors.push(new AnimationParseError(`The provided timing value "${exp}" is invalid.`));
|
||||
|
@ -8,17 +8,17 @@
|
||||
|
||||
import {isDevMode} from '@angular/core';
|
||||
|
||||
import {isArray, isBlank, isPresent, isString} from '../src/facade/lang';
|
||||
import {isBlank, isPresent} from '../src/facade/lang';
|
||||
|
||||
export function assertArrayOfStrings(identifier: string, value: any) {
|
||||
if (!isDevMode() || isBlank(value)) {
|
||||
return;
|
||||
}
|
||||
if (!isArray(value)) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error(`Expected '${identifier}' to be an array of strings.`);
|
||||
}
|
||||
for (var i = 0; i < value.length; i += 1) {
|
||||
if (!isString(value[i])) {
|
||||
if (typeof value[i] !== 'string') {
|
||||
throw new Error(`Expected '${identifier}' to be an array of strings.`);
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ const INTERPOLATION_BLACKLIST_REGEXPS = [
|
||||
];
|
||||
|
||||
export function assertInterpolationSymbols(identifier: string, value: any): void {
|
||||
if (isPresent(value) && !(isArray(value) && value.length == 2)) {
|
||||
if (isPresent(value) && !(Array.isArray(value) && value.length == 2)) {
|
||||
throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
|
||||
} else if (isDevMode() && !isBlank(value)) {
|
||||
const start = value[0] as string;
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {ChangeDetectionStrategy, SchemaMetadata, Type, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
import {ListWrapper, MapWrapper} from './facade/collection';
|
||||
import {isPresent, isStringMap, normalizeBlank, normalizeBool} from './facade/lang';
|
||||
import {isPresent, normalizeBlank, normalizeBool} from './facade/lang';
|
||||
import {LifecycleHooks} from './private_import_core';
|
||||
import {CssSelector} from './selector';
|
||||
import {sanitizeIdentifier, splitAtColon} from './util';
|
||||
@ -594,7 +594,7 @@ function _normalizeArray(obj: any[]): any[] {
|
||||
}
|
||||
|
||||
export function isStaticSymbol(value: any): value is StaticSymbol {
|
||||
return isStringMap(value) && isPresent(value['name']) && isPresent(value['filePath']);
|
||||
return typeof value === 'object' && value !== null && value['name'] && value['filePath'];
|
||||
}
|
||||
|
||||
export interface StaticSymbol {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import {Injectable} from '@angular/core';
|
||||
import * as chars from '../chars';
|
||||
import {NumberWrapper, StringJoiner, isPresent} from '../facade/lang';
|
||||
import {NumberWrapper, isPresent} from '../facade/lang';
|
||||
|
||||
export enum TokenType {
|
||||
Character,
|
||||
@ -274,42 +274,41 @@ class _Scanner {
|
||||
}
|
||||
this.advance();
|
||||
}
|
||||
var str: string = this.input.substring(start, this.index);
|
||||
var value: number = simple ? NumberWrapper.parseIntAutoRadix(str) : parseFloat(str);
|
||||
const str: string = this.input.substring(start, this.index);
|
||||
const value: number = simple ? NumberWrapper.parseIntAutoRadix(str) : parseFloat(str);
|
||||
return newNumberToken(start, value);
|
||||
}
|
||||
|
||||
scanString(): Token {
|
||||
var start: number = this.index;
|
||||
var quote: number = this.peek;
|
||||
const start: number = this.index;
|
||||
const quote: number = this.peek;
|
||||
this.advance(); // Skip initial quote.
|
||||
|
||||
var buffer: StringJoiner;
|
||||
var marker: number = this.index;
|
||||
var input: string = this.input;
|
||||
let buffer: string = '';
|
||||
let marker: number = this.index;
|
||||
let input: string = this.input;
|
||||
|
||||
while (this.peek != quote) {
|
||||
if (this.peek == chars.$BACKSLASH) {
|
||||
if (buffer == null) buffer = new StringJoiner();
|
||||
buffer.add(input.substring(marker, this.index));
|
||||
buffer += input.substring(marker, this.index);
|
||||
this.advance();
|
||||
var unescapedCode: number;
|
||||
let unescapedCode: number;
|
||||
if (this.peek == chars.$u) {
|
||||
// 4 character hex code for unicode character.
|
||||
var hex: string = input.substring(this.index + 1, this.index + 5);
|
||||
const hex: string = input.substring(this.index + 1, this.index + 5);
|
||||
try {
|
||||
unescapedCode = NumberWrapper.parseInt(hex, 16);
|
||||
} catch (e) {
|
||||
return this.error(`Invalid unicode escape [\\u${hex}]`, 0);
|
||||
}
|
||||
for (var i: number = 0; i < 5; i++) {
|
||||
for (let i: number = 0; i < 5; i++) {
|
||||
this.advance();
|
||||
}
|
||||
} else {
|
||||
unescapedCode = unescape(this.peek);
|
||||
this.advance();
|
||||
}
|
||||
buffer.add(String.fromCharCode(unescapedCode));
|
||||
buffer += String.fromCharCode(unescapedCode);
|
||||
marker = this.index;
|
||||
} else if (this.peek == chars.$EOF) {
|
||||
return this.error('Unterminated quote', 0);
|
||||
@ -318,16 +317,10 @@ class _Scanner {
|
||||
}
|
||||
}
|
||||
|
||||
var last: string = input.substring(marker, this.index);
|
||||
const last: string = input.substring(marker, this.index);
|
||||
this.advance(); // Skip terminating quote.
|
||||
|
||||
// Compute the unescaped string value.
|
||||
var unescaped: string = last;
|
||||
if (buffer != null) {
|
||||
buffer.add(last);
|
||||
unescaped = buffer.toString();
|
||||
}
|
||||
return newStringToken(start, unescaped);
|
||||
return newStringToken(start, buffer + last);
|
||||
}
|
||||
|
||||
error(message: string, offset: number): Token {
|
||||
|
@ -11,7 +11,7 @@ import {AnimationAnimateMetadata, AnimationEntryMetadata, AnimationGroupMetadata
|
||||
import {assertArrayOfStrings, assertInterpolationSymbols} from './assertions';
|
||||
import * as cpl from './compile_metadata';
|
||||
import {DirectiveResolver} from './directive_resolver';
|
||||
import {isBlank, isPresent, isString, stringify} from './facade/lang';
|
||||
import {isBlank, isPresent, stringify} from './facade/lang';
|
||||
import {Identifiers, resolveIdentifierToken} from './identifiers';
|
||||
import {hasLifecycleHook} from './lifecycle_reflector';
|
||||
import {NgModuleResolver} from './ng_module_resolver';
|
||||
@ -569,7 +569,7 @@ export class CompileMetadataResolver {
|
||||
getTokenMetadata(token: any): cpl.CompileTokenMetadata {
|
||||
token = resolveForwardRef(token);
|
||||
let compileToken: cpl.CompileTokenMetadata;
|
||||
if (isString(token)) {
|
||||
if (typeof token === 'string') {
|
||||
compileToken = new cpl.CompileTokenMetadata({value: token});
|
||||
} else {
|
||||
compileToken = new cpl.CompileTokenMetadata({
|
||||
|
@ -6,14 +6,14 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {isBlank, isPresent, isString} from '../facade/lang';
|
||||
import {isBlank, isPresent} from '../facade/lang';
|
||||
|
||||
import * as o from './output_ast';
|
||||
|
||||
var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
|
||||
var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
|
||||
export var CATCH_ERROR_VAR = o.variable('error');
|
||||
export var CATCH_STACK_VAR = o.variable('stack');
|
||||
const _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
|
||||
const _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
|
||||
export const CATCH_ERROR_VAR = o.variable('error');
|
||||
export const CATCH_STACK_VAR = o.variable('stack');
|
||||
|
||||
export abstract class OutputEmitter {
|
||||
abstract emitStatements(moduleUrl: string, stmts: o.Statement[], exportedVars: string[]): string;
|
||||
@ -253,7 +253,7 @@ export abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.Ex
|
||||
visitLiteralExpr(ast: o.LiteralExpr, ctx: EmitterVisitorContext, absentValue: string = 'null'):
|
||||
any {
|
||||
var value = ast.value;
|
||||
if (isString(value)) {
|
||||
if (typeof value === 'string') {
|
||||
ctx.print(escapeIdentifier(value, this._escapeDollarInStrings));
|
||||
} else if (isBlank(value)) {
|
||||
ctx.print(absentValue);
|
||||
|
@ -8,9 +8,7 @@
|
||||
|
||||
|
||||
import {CompileIdentifierMetadata} from '../compile_metadata';
|
||||
import {isPresent, isString} from '../facade/lang';
|
||||
|
||||
|
||||
import {isPresent} from '../facade/lang';
|
||||
|
||||
//// Types
|
||||
export enum TypeModifier {
|
||||
@ -196,7 +194,7 @@ export class ReadVarExpr extends Expression {
|
||||
|
||||
constructor(name: string|BuiltinVar, type: Type = null) {
|
||||
super(type);
|
||||
if (isString(name)) {
|
||||
if (typeof name === 'string') {
|
||||
this.name = name;
|
||||
this.builtin = null;
|
||||
} else {
|
||||
@ -267,7 +265,7 @@ export class InvokeMethodExpr extends Expression {
|
||||
public receiver: Expression, method: string|BuiltinMethod, public args: Expression[],
|
||||
type: Type = null) {
|
||||
super(type);
|
||||
if (isString(method)) {
|
||||
if (typeof method === 'string') {
|
||||
this.name = method;
|
||||
this.builtin = null;
|
||||
} else {
|
||||
|
@ -6,13 +6,26 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {evalExpression, isPresent} from '../facade/lang';
|
||||
import {isPresent} from '../facade/lang';
|
||||
import {sanitizeIdentifier} from '../util';
|
||||
|
||||
import {EmitterVisitorContext} from './abstract_emitter';
|
||||
import {AbstractJsEmitterVisitor} from './abstract_js_emitter';
|
||||
import * as o from './output_ast';
|
||||
|
||||
function evalExpression(
|
||||
sourceUrl: string, expr: string, declarations: string, vars: {[key: string]: any}): any {
|
||||
const fnBody = `${declarations}\nreturn ${expr}\n//# sourceURL=${sourceUrl}`;
|
||||
const fnArgNames: string[] = [];
|
||||
const fnArgValues: any[] = [];
|
||||
for (const argName in vars) {
|
||||
fnArgNames.push(argName);
|
||||
fnArgValues.push(vars[argName]);
|
||||
}
|
||||
return new Function(...fnArgNames.concat(fnBody))(...fnArgValues);
|
||||
}
|
||||
|
||||
|
||||
export function jitStatements(
|
||||
sourceUrl: string, statements: o.Statement[], resultVar: string): any {
|
||||
var converter = new JitEmitterVisitor();
|
||||
|
@ -8,24 +8,20 @@
|
||||
|
||||
|
||||
import {CompileIdentifierMetadata} from '../compile_metadata';
|
||||
import {isArray, isBlank, isPresent} from '../facade/lang';
|
||||
import {isBlank, isPresent} from '../facade/lang';
|
||||
|
||||
import {AbstractEmitterVisitor, CATCH_ERROR_VAR, CATCH_STACK_VAR, EmitterVisitorContext, OutputEmitter} from './abstract_emitter';
|
||||
import * as o from './output_ast';
|
||||
import {ImportGenerator} from './path_util';
|
||||
|
||||
var _debugModuleUrl = 'asset://debug/lib';
|
||||
const _debugModuleUrl = 'asset://debug/lib';
|
||||
|
||||
export function debugOutputAstAsTypeScript(ast: o.Statement | o.Expression | o.Type | any[]):
|
||||
string {
|
||||
var converter = new _TsEmitterVisitor(_debugModuleUrl);
|
||||
var ctx = EmitterVisitorContext.createRoot([]);
|
||||
var asts: any[];
|
||||
if (isArray(ast)) {
|
||||
asts = <any[]>ast;
|
||||
} else {
|
||||
asts = [ast];
|
||||
}
|
||||
const converter = new _TsEmitterVisitor(_debugModuleUrl);
|
||||
const ctx = EmitterVisitorContext.createRoot([]);
|
||||
const asts: any[] = Array.isArray(ast) ? ast : [ast];
|
||||
|
||||
asts.forEach((ast) => {
|
||||
if (ast instanceof o.Statement) {
|
||||
ast.visitStatement(converter, ctx);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
import {CompileDiDependencyMetadata, CompileDirectiveMetadata, CompileNgModuleMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTokenMetadata, CompileTypeMetadata} from './compile_metadata';
|
||||
import {ListWrapper, MapWrapper} from './facade/collection';
|
||||
import {isArray, isBlank, isPresent, normalizeBlank} from './facade/lang';
|
||||
import {isBlank, isPresent, normalizeBlank} from './facade/lang';
|
||||
import {Identifiers, resolveIdentifierToken} from './identifiers';
|
||||
import {ParseError, ParseSourceSpan} from './parse_util';
|
||||
import {AttrAst, DirectiveAst, ProviderAst, ProviderAstType, ReferenceAst} from './template_parser/template_ast';
|
||||
@ -418,7 +418,7 @@ function _normalizeProviders(
|
||||
}
|
||||
if (isPresent(providers)) {
|
||||
providers.forEach((provider) => {
|
||||
if (isArray(provider)) {
|
||||
if (Array.isArray(provider)) {
|
||||
_normalizeProviders(<any[]>provider, sourceSpan, targetErrors, targetProviders);
|
||||
} else {
|
||||
let normalizeProvider: CompileProviderMetadata;
|
||||
|
@ -11,7 +11,7 @@ import {Inject, Injectable, OpaqueToken, Optional, SchemaMetadata, SecurityConte
|
||||
import {CompileDirectiveMetadata, CompilePipeMetadata, CompileTemplateMetadata, CompileTokenMetadata, removeIdentifierDuplicates} from '../compile_metadata';
|
||||
import {AST, ASTWithSource, BindingPipe, EmptyExpr, Interpolation, ParserError, RecursiveAstVisitor, TemplateBinding} from '../expression_parser/ast';
|
||||
import {Parser} from '../expression_parser/parser';
|
||||
import {isPresent, isString} from '../facade/lang';
|
||||
import {isPresent} from '../facade/lang';
|
||||
import {I18NHtmlParser} from '../i18n/i18n_html_parser';
|
||||
import {Identifiers, identifierToken, resolveIdentifierToken} from '../identifiers';
|
||||
import * as html from '../ml_parser/ast';
|
||||
@ -844,7 +844,7 @@ class TemplateParseVisitor implements html.Visitor {
|
||||
if (hostProps) {
|
||||
Object.keys(hostProps).forEach(propName => {
|
||||
const expression = hostProps[propName];
|
||||
if (isString(expression)) {
|
||||
if (typeof expression === 'string') {
|
||||
const exprAst = this._parseBinding(expression, sourceSpan);
|
||||
targetPropertyAsts.push(
|
||||
this._createElementPropertyAst(elementName, propName, exprAst, sourceSpan));
|
||||
@ -863,7 +863,7 @@ class TemplateParseVisitor implements html.Visitor {
|
||||
if (hostListeners) {
|
||||
Object.keys(hostListeners).forEach(propName => {
|
||||
const expression = hostListeners[propName];
|
||||
if (isString(expression)) {
|
||||
if (typeof expression === 'string') {
|
||||
this._parseEventOrAnimationEvent(propName, expression, sourceSpan, [], targetEventAsts);
|
||||
} else {
|
||||
this._reportError(
|
||||
|
@ -7,12 +7,12 @@
|
||||
*/
|
||||
|
||||
import {CompileTokenMetadata} from './compile_metadata';
|
||||
import {isArray, isBlank, isPresent, isPrimitive, isStrictStringMap} from './facade/lang';
|
||||
import {isBlank, isPresent, isPrimitive, isStrictStringMap} from './facade/lang';
|
||||
import * as o from './output/output_ast';
|
||||
|
||||
export const MODULE_SUFFIX = '';
|
||||
|
||||
var CAMEL_CASE_REGEXP = /([A-Z])/g;
|
||||
const CAMEL_CASE_REGEXP = /([A-Z])/g;
|
||||
|
||||
export function camelCaseToDashCase(input: string): string {
|
||||
return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());
|
||||
@ -37,15 +37,19 @@ export function sanitizeIdentifier(name: string): string {
|
||||
}
|
||||
|
||||
export function visitValue(value: any, visitor: ValueVisitor, context: any): any {
|
||||
if (isArray(value)) {
|
||||
if (Array.isArray(value)) {
|
||||
return visitor.visitArray(<any[]>value, context);
|
||||
} else if (isStrictStringMap(value)) {
|
||||
return visitor.visitStringMap(<{[key: string]: any}>value, context);
|
||||
} else if (isBlank(value) || isPrimitive(value)) {
|
||||
return visitor.visitPrimitive(value, context);
|
||||
} else {
|
||||
return visitor.visitOther(value, context);
|
||||
}
|
||||
|
||||
if (isStrictStringMap(value)) {
|
||||
return visitor.visitStringMap(<{[key: string]: any}>value, context);
|
||||
}
|
||||
|
||||
if (isBlank(value) || isPrimitive(value)) {
|
||||
return visitor.visitPrimitive(value, context);
|
||||
}
|
||||
|
||||
return visitor.visitOther(value, context);
|
||||
}
|
||||
|
||||
export interface ValueVisitor {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
import * as cdAst from '../expression_parser/ast';
|
||||
import {isArray, isBlank, isPresent} from '../facade/lang';
|
||||
import {isBlank, isPresent} from '../facade/lang';
|
||||
import {Identifiers, resolveIdentifier} from '../identifiers';
|
||||
import * as o from '../output/output_ast';
|
||||
|
||||
@ -471,7 +471,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
|
||||
}
|
||||
|
||||
function flattenStatements(arg: any, output: o.Statement[]) {
|
||||
if (isArray(arg)) {
|
||||
if (Array.isArray(arg)) {
|
||||
(<any[]>arg).forEach((entry) => flattenStatements(entry, output));
|
||||
} else {
|
||||
output.push(arg);
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {AST, AstVisitor, Binary, BindingPipe, Chain, Conditional, FunctionCall, ImplicitReceiver, Interpolation, KeyedRead, KeyedWrite, LiteralArray, LiteralMap, LiteralPrimitive, MethodCall, PrefixNot, PropertyRead, PropertyWrite, Quote, SafeMethodCall, SafePropertyRead} from '../../src/expression_parser/ast';
|
||||
import {isString} from '../../src/facade/lang';
|
||||
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/ml_parser/interpolation_config';
|
||||
|
||||
class Unparser implements AstVisitor {
|
||||
@ -133,7 +132,7 @@ class Unparser implements AstVisitor {
|
||||
}
|
||||
|
||||
visitLiteralPrimitive(ast: LiteralPrimitive, context: any) {
|
||||
if (isString(ast.value)) {
|
||||
if (typeof ast.value === 'string') {
|
||||
this._expression += `"${ast.value.replace( Unparser._quoteRegExp, '\"')}"`;
|
||||
} else {
|
||||
this._expression += `${ast.value}`;
|
||||
|
Reference in New Issue
Block a user