mirror of https://github.com/tc39/test262.git
Add tests to handle revised template literals (#764)
This commit is contained in:
parent
19a4278eb0
commit
9d8d8b6920
|
@ -0,0 +1,70 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Invalid unicode escape sequence in tagged template literals are allowed
|
||||
esid: sec-template-literal-lexical-components
|
||||
---*/
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\01');
|
||||
})`\01`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\1');
|
||||
})`\1`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\1');
|
||||
})`\xg`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\1');
|
||||
})`\xAg`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u0');
|
||||
})`\u0`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u0g');
|
||||
})`\u0g`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u00g');
|
||||
})`\u00g`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u000g');
|
||||
})`\u000g`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u{g');
|
||||
})`\u{g`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u{0');
|
||||
})`\u{0`;
|
||||
|
||||
(strs => {
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u{10FFFFF}');
|
||||
})`\u{10FFFFF}`;
|
||||
|
||||
((strs, val) => {
|
||||
assert.sameValue(val, 'inner');
|
||||
assert.sameValue(strs[0], undefined, 'Cooked template value should be undefined for illegal escape sequences');
|
||||
assert.sameValue(strs.raw[0], '\\u{10FFFFF}');
|
||||
|
||||
assert.sameValue(strs[1], 'right');
|
||||
assert.sameValue(strs.raw[1], 'right');
|
||||
})`\u{10FFFFF}${'inner'}right`;
|
|
@ -1,11 +1,8 @@
|
|||
// Copyright (C) 2014 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 11.8.6.1
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid hexidecimal character escape sequence
|
||||
info: >
|
||||
The TV of TemplateCharacter :: \ EscapeSequence is the SV of
|
||||
EscapeSequence.
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid hexidecimal character escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\x0G`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid hexidecimal character escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\xG`;
|
|
@ -1,11 +1,8 @@
|
|||
// Copyright (C) 2014 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 11.8.6
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
info: >
|
||||
The TV of TemplateCharacter :: \ EscapeSequence is the SV of
|
||||
EscapeSequence.
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u0g`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u00g`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u000g`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u{g`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u{0`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u{10FFFFF}`;
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (C) 2016 Tim Disney. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-template-literal-lexical-components
|
||||
description: Invalid unicode escape sequence
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
`\u{10FFFFF}${'inner'}right`;
|
Loading…
Reference in New Issue