Fixing tests of internal test suite.

This commit is contained in:
Ruben Ayrapetyan
2014-11-06 17:39:24 +03:00
parent e33e6a77cb
commit 7c488ea11a
21 changed files with 50 additions and 25 deletions
@@ -30,4 +30,4 @@ for (prop in Object)
if (delete Object.prototype)
configurable = true;
assert(writable || enumerable || configurable);
assert(!writable && !enumerable && !configurable);
@@ -26,4 +26,4 @@ var object2 = {
Object.freeze(object1);
assert(Object.isExtensible(object1) && !Object.isExtensible(object2));
assert(!Object.isExtensible(object1) && Object.isExtensible(object2));
@@ -13,9 +13,18 @@
// limitations under the License.
var a = new String("qwe");
names = Object.getOwnPropertyNames(a);
assert(names instanceof Array &&
names[0] === "0" &&
names[1] === "1" &&
names[2] === "2" &&
names[3] === "length");
assert(names instanceof Array);
var is_0 = false, is_1 = false, is_2 = false, is_length = false;
for (var i = 0; i <= 3; i++)
{
if (names[i] === "0") { is_0 = true; }
if (names[i] === "1") { is_1 = true; }
if (names[i] === "2") { is_2 = true; }
if (names[i] === "length") { is_length = true; }
}
assert (is_0 && is_1 && is_2 && is_length);
@@ -23,4 +23,5 @@ veryUsefulObject.method = function () {
return "asdf";
}
assert(veryUsefulObject.property && veryUsefulObject.method());
assert(veryUsefulObject.property === undefined);
assert(veryUsefulObject.method === undefined);
@@ -49,4 +49,4 @@ for (p in emptyObject) {
if (delete emptyObject.myProperty)
isConfigurable = true;
assert(isWritable || isEnumerable || isConfigurable);
assert(!isWritable && !isEnumerable && !isConfigurable);