mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Reorganize existing tests
This commit is contained in:
parent
a1437652ab
commit
bd3d160ba1
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
es6id: 12.2.8.5
|
||||||
|
description: Function invocation in expression position of TemplateLiteral
|
||||||
|
info: >
|
||||||
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
function fn() { return 'result'; }
|
||||||
|
|
||||||
|
assert.sameValue(`foo ${fn()} bar`, 'foo result bar');
|
@ -1,11 +1,16 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
es6id: 12.2.8
|
es6id: 12.2.8.5
|
||||||
description: >
|
description: MemberExpression in expression position of TemplateLiteral
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
info: >
|
||||||
ToString abstract operation.
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var object = {
|
var object = {
|
||||||
number: 5,
|
number: 5,
|
||||||
string: 'stringValue'
|
string: 'stringValue'
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
es6id: 12.2.8.5
|
||||||
|
description: Method invocation in expression position of TemplateLiteral
|
||||||
|
info: >
|
||||||
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
|
---*/
|
||||||
|
var object = {
|
||||||
|
fn: function() { return 'result'; }
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.sameValue(`foo ${object.fn()} bar`, 'foo result bar');
|
@ -1,11 +1,16 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
es6id: 12.2.8
|
es6id: 12.2.8.5
|
||||||
description: >
|
description: Object reference in expression position of TemplateLiteral
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
info: >
|
||||||
ToString abstract operation.
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var plain = {};
|
var plain = {};
|
||||||
var custom = {
|
var custom = {
|
||||||
toString: function() {
|
toString: function() {
|
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
es6id: 12.2.8.5
|
||||||
|
description: Primitive value in expression position of TemplateLiteral
|
||||||
|
info: >
|
||||||
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(`foo ${5} bar`, 'foo 5 bar', 'number value');
|
||||||
|
assert.sameValue(`foo ${'string'} bar`, 'foo string bar', 'string value');
|
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
es6id: 12.2.8.5
|
||||||
|
description: Template literal in expression position of TemplateLiteral
|
||||||
|
info: >
|
||||||
|
TemplateLiteral : TemplateHead Expression TemplateSpans
|
||||||
|
|
||||||
|
1. Let head be the TV of TemplateHead as defined in 11.8.6.
|
||||||
|
2. Let sub be the result of evaluating Expression.
|
||||||
|
3. Let middle be ToString(sub).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(`foo ${`bar ${5} baz`} qux`, 'foo bar 5 baz qux');
|
@ -1,11 +0,0 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
es6id: 12.2.8
|
|
||||||
description: >
|
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
|
||||||
ToString abstract operation.
|
|
||||||
---*/
|
|
||||||
function fn() { return 'result'; }
|
|
||||||
|
|
||||||
assert.sameValue(`foo ${fn()} bar`, 'foo result bar');
|
|
@ -1,13 +0,0 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
es6id: 12.2.8
|
|
||||||
description: >
|
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
|
||||||
ToString abstract operation.
|
|
||||||
---*/
|
|
||||||
var object = {
|
|
||||||
fn: function() { return 'result'; }
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.sameValue(`foo ${object.fn()} bar`, 'foo result bar');
|
|
@ -1,11 +0,0 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
es6id: 12.2.8
|
|
||||||
description: >
|
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
|
||||||
ToString abstract operation.
|
|
||||||
---*/
|
|
||||||
|
|
||||||
assert.sameValue(`foo ${5} bar`, 'foo 5 bar', 'number value');
|
|
||||||
assert.sameValue(`foo ${'string'} bar`, 'foo string bar', 'string value');
|
|
@ -1,9 +0,0 @@
|
|||||||
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
es6id: 12.2.8
|
|
||||||
description: >
|
|
||||||
Expressions should be evaluated and converted to Strings according to the
|
|
||||||
ToString abstract operation.
|
|
||||||
---*/
|
|
||||||
assert.sameValue(`foo ${`bar ${5} baz`} qux`, 'foo bar 5 baz qux');
|
|
Loading…
x
Reference in New Issue
Block a user