2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
A property name P (in the form of a string value) is an array index
|
|
|
|
if and only if ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal to 2^32 - 1
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.4_A1.1_T7
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Checking for Number object
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK#1
|
2015-04-29 17:36:28 +02:00
|
|
|
var x = [];
|
2011-09-07 08:35:18 +02:00
|
|
|
x[new Number(0)] = 0;
|
|
|
|
if (x[0] !== 0) {
|
2018-02-15 23:40:02 +01:00
|
|
|
$ERROR('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0]));
|
|
|
|
}
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK#2
|
2015-04-29 17:36:28 +02:00
|
|
|
var y = [];
|
2011-09-07 08:35:18 +02:00
|
|
|
y[new Number(1)] = 1;
|
|
|
|
if (y[1] !== 1) {
|
2018-02-15 23:40:02 +01:00
|
|
|
$ERROR('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1]));
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#3
|
2015-04-29 17:36:28 +02:00
|
|
|
var z = [];
|
2011-09-07 08:35:18 +02:00
|
|
|
z[new Number(1.1)] = 1;
|
|
|
|
if (z["1.1"] !== 1) {
|
2018-02-15 23:40:02 +01:00
|
|
|
$ERROR('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
|
2014-07-22 01:09:02 +02:00
|
|
|
}
|