diff --git a/test/language/expressions/delete/11.4.1-2-1.js b/test/language/expressions/delete/11.4.1-2-1.js deleted file mode 100644 index 19a1de7fddc7f2c8e207bb23fa78a1d71a83afa6..0000000000000000000000000000000000000000 --- a/test/language/expressions/delete/11.4.1-2-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4.1-2-1 -description: delete operator returns true when deleting a non-reference (number) ----*/ - - var d = delete 42; - -assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-2-3.js b/test/language/expressions/delete/11.4.1-2-3.js deleted file mode 100644 index dbd9737074c81f61186ad93521ff7d5ae7f447d2..0000000000000000000000000000000000000000 --- a/test/language/expressions/delete/11.4.1-2-3.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4.1-2-3 -description: > - delete operator returns true when deleting a non-reference - (boolean) ----*/ - - var d = delete true; - -assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-2-4.js b/test/language/expressions/delete/11.4.1-2-4.js deleted file mode 100644 index fbad9c12f32d815781b4009eec41f357536b42ed..0000000000000000000000000000000000000000 --- a/test/language/expressions/delete/11.4.1-2-4.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4.1-2-4 -description: delete operator returns true when deleting a non-reference (string) ----*/ - - var d = delete "abc"; - -assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-2-5.js b/test/language/expressions/delete/11.4.1-2-5.js deleted file mode 100644 index cbceca7dae38408f588ccc26e66aac9e3141633f..0000000000000000000000000000000000000000 --- a/test/language/expressions/delete/11.4.1-2-5.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4.1-2-5 -description: delete operator returns true when deleting a non-reference (obj) ----*/ - - var d = delete {a:0} ; - -assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-2-6.js b/test/language/expressions/delete/11.4.1-2-6.js deleted file mode 100644 index 97cfc995cb48f7f04fc06ce96863dbc73c7712a7..0000000000000000000000000000000000000000 --- a/test/language/expressions/delete/11.4.1-2-6.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4.1-2-6 -description: delete operator returns true when deleting a non-reference (null) ----*/ - - var d = delete null; - -assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/non-reference-return-true.js b/test/language/expressions/delete/non-reference-return-true.js new file mode 100644 index 0000000000000000000000000000000000000000..6fa643f32f1a4db384517885405edf0cf33eeb98 --- /dev/null +++ b/test/language/expressions/delete/non-reference-return-true.js @@ -0,0 +1,34 @@ +// Copyright (c) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-delete-operator-runtime-semantics-evaluation +description: > + The delete expression should return true if the right hand UnaryExpression is not a Reference +info: | + Runtime Semantics: Evaluation + UnaryExpression : delete UnaryExpression + + 1. Let ref be the result of evaluating UnaryExpression. + 2. ReturnIfAbrupt(ref). + 3. If Type(ref) is not Reference, return true. +---*/ + +var a = { b: 42 }; +assert.sameValue(delete void a.b, true, 'delete void a.b'); +assert.sameValue(delete void 0, true, 'delete void 0'); +assert.sameValue(delete typeof 0, true, 'delete typeof 0'); +assert.sameValue(delete delete 0, true, 'delete delete 0'); +assert.sameValue(delete void typeof +-~!0, true, 'delete void typeof +-~!0'); +assert.sameValue(delete {x:1}, true, 'delete {x:1}'); +assert.sameValue(delete null, true, 'delete null'); +assert.sameValue(delete true, true, 'delete true'); +assert.sameValue(delete false, true, 'delete false'); +assert.sameValue(delete 0, true, 'delete 0'); +assert.sameValue(delete 1, true, 'delete 1'); +assert.sameValue(delete '', true, 'delete ""'); +assert.sameValue(delete 'Test262', true, 'delete "Test262"'); +assert.sameValue(delete typeof +-~!0, true, 'delete typeof +-~!0'); +assert.sameValue(delete +-~!0, true, 'delete +-~!0'); +assert.sameValue(delete -~!0, true, 'delete -~!0'); +assert.sameValue(delete ~!0, true, 'delete ~!0'); +assert.sameValue(delete !0, true, 'delete !0');