mirror of https://github.com/tc39/test262.git
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.
|
||||
// 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.
|
||||
es6id: 12.2.8.5
|
||||
description: MemberExpression 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 = {
|
||||
number: 5,
|
||||
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.
|
||||
// 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.
|
||||
es6id: 12.2.8.5
|
||||
description: Object reference 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 plain = {};
|
||||
var custom = {
|
||||
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…
Reference in New Issue