fix(animations): always quote string map key values in AOT code (#13602)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
c0f750af4e
commit
f49ab56160
@ -113,6 +113,14 @@ export function main() {
|
||||
expect(emitStmt(o.literalMap([['someKey', o.literal(1)]]).toStmt())).toEqual(`{someKey: 1};`);
|
||||
});
|
||||
|
||||
it('should apply quotes to each entry within a map produced with literalMap when true', () => {
|
||||
expect(
|
||||
emitStmt(
|
||||
o.literalMap([['a', o.literal('a')], ['*', o.literal('star')]], null, true).toStmt())
|
||||
.replace(/\s+/gm, ''))
|
||||
.toEqual(`{'a':'a','*':'star'};`);
|
||||
});
|
||||
|
||||
it('should support blank literals', () => {
|
||||
expect(emitStmt(o.literal(null).toStmt())).toEqual('(null as any);');
|
||||
expect(emitStmt(o.literal(undefined).toStmt())).toEqual('(undefined as any);');
|
||||
|
Reference in New Issue
Block a user