Skip to content
Snippets Groups Projects
Commit bd7c280e authored by André Bargull's avatar André Bargull
Browse files

Rename and consolidate tests in reserved-words directory

parent 053d63fd
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 724 deletions
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-2
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: break, case, do
---*/
var tokenCodes = {};
tokenCodes['break'] = 0;
tokenCodes['case'] = 1;
tokenCodes['do'] = 2;
var arr = [
'break',
'case',
'do'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-3
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: instanceof, typeof, else
---*/
var tokenCodes = {};
tokenCodes['instanceof'] = 0;
tokenCodes['typeof'] = 1;
tokenCodes['else'] = 2;
var arr = [
'instanceof',
'typeof',
'else'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-4
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: new, var, catch
---*/
var tokenCodes = {};
tokenCodes['new'] = 0;
tokenCodes['var'] = 1;
tokenCodes['catch'] = 2;
var arr = [
'new',
'var',
'catch'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-5
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: finally, return, void
---*/
var tokenCodes = {};
tokenCodes['finally'] = 0;
tokenCodes['return'] = 1;
tokenCodes['void'] = 2;
var arr = [
'finally',
'return',
'void'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-6
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: continue, for, switch
---*/
var tokenCodes = {};
tokenCodes['continue'] = 0;
tokenCodes['for'] = 1;
tokenCodes['switch'] = 2;
var arr = [
'continue',
'for',
'switch'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-7
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: while, debugger, function
---*/
var tokenCodes = {};
tokenCodes['while'] = 0;
tokenCodes['debugger'] = 1;
tokenCodes['function'] = 2;
var arr = [
'while',
'debugger',
'function'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-8
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: this, with, default
---*/
var tokenCodes = {};
tokenCodes['this'] = 0;
tokenCodes['with'] = 1;
tokenCodes['default'] = 2;
var arr = [
'this',
'with',
'default'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-3-9
description: >
Allow reserved words as property names by index
assignment,verified with hasOwnProperty: if, throw, delete
---*/
var tokenCodes = {};
tokenCodes['if'] = 0;
tokenCodes['throw'] = 1;
tokenCodes['delete'] = 2;
var arr = [
'if',
'throw',
'delete'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-1
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: null, true, false
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set null(value) {
test0 = value;
},
get null() {
return test0;
},
set true(value) {
test1 = value;
},
get true() {
return test1;
},
set false(value) {
test2 = value;
},
get false(){
return test2;
}
};
var arr = [
'null',
'true',
'false'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-10
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: in, try, class
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set in(value){
test0 = value;
},
get in(){
return test0;
},
set try(value){
test1 = value;
},
get try(){
return test1
},
set class(value){
test2 = value;
},
get class(){
return test2;
}
};
var arr = [
'in',
'try',
'class'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-11
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: enum, extends, super
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set enum(value){
test0 = value;
},
get enum(){
return test0;
},
set extends(value){
test1 = value;
},
get extends(){
return test1;
},
set super(value){
test2 = value;
},
get super(){
return test2;
}
};
var arr = [
'enum',
'extends',
'super'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-12
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: const, export, import
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set const(value){
test0 = value;
},
get const(){
return test0;
},
set export(value){
test1 = value;
},
get export(){
return test1
},
set import(value){
test2 = value;
},
get import(){
return test2
}
};
var arr = [
'const',
'export',
'import'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-13
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: implements, let, private
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set implements(value){
test0 = value;
},
get implements(){
return test0;
},
set let(value){
test1 = value;
},
get let(){
return test1
},
set private(value){
test2 = value;
},
get private(){
return test2;
}
};
var arr = [
'implements',
'let',
'private'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-14
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: public, yield, interface
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set public(value){
test0 = value;
},
get public(){
return test0;
},
set yield(value){
test1 = value;
},
get yield(){
return test1;
},
set interface(value){
test2 = value;
},
get interface(){
return test2;
}
};
var arr = [
'public',
'yield',
'interface'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-15
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: package, protected, static
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set package(value){
test0 = value;
},
get package(){
return test0;
},
set protected(value){
test1 = value;
},
get protected(){
return test1
},
set static(value){
test2 = value;
},
get static(){
return test2;
}
};
var arr = [
'package',
'protected',
'static'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-16
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: undefined, NaN, Infinity
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set undefined(value){
test0 = value;
},
get undefined(){
return test0;
},
set NaN(value){
test1 = value;
},
get NaN(){
return test1;
},
set Infinity(value){
test2 = value;
},
get Infinity(){
return test2;
}
};
var arr = [
'undefined',
'NaN',
'Infinity'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-2
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: break, case, do
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set break(value){
test0 = value;
},
get break(){
return test0;
},
set case(value){
test1 = value;
},
get case(){
return test1;
},
set do(value){
test2 = value;
},
get do(){
return test2;
}
};
var arr = [
'break',
'case',
'do'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-3
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: instanceof, typeof, else
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set instanceof(value){
test0 = value;
},
get instanceof(){
return test0;
},
set typeof(value){
test1 = value;
},
get typeof(){
return test1;
},
set else(value){
test2 = value;
},
get else(){
return test2;
}
};
var arr = [
'instanceof',
'typeof',
'else'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-4
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: new, var, catch
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set new(value){
test0 = value;
},
get new(){
return test0;
},
set var(value){
test1 = value;
},
get var(){
return test1;
},
set catch(value){
test2 = value;
},
get catch(){
return test2;
}
};
var arr = [
'new',
'var',
'catch'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.6.1-4-5
description: >
Allow reserved words as property names by set function within an
object, verified with hasOwnProperty: finally, return, void
---*/
var test0 = 0, test1 = 1, test2 = 2;
var tokenCodes = {
set finally(value){
test0 = value;
},
get finally(){
return test0;
},
set return(value){
test1 = value;
},
get return(){
return test1;
},
set void(value){
test2 = value;
},
get void(){
return test2;
}
};
var arr = [
'finally',
'return',
'void'
];
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment