michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * If ToNumber(value) is NaN, ToInteger(value) returns +0 michael@0: * michael@0: * @path ch09/9.4/S9.4_A1.js michael@0: * @description Check what position is defined by Number.NaN in string "abc": "abc".charAt(Number.NaN) michael@0: */ michael@0: michael@0: // CHECK#1 michael@0: if ("abc".charAt(Number.NaN) !== "a") { michael@0: $ERROR('#1: "abc".charAt(Number.NaN) === "a". Actual: ' + ("abc".charAt(Number.NaN))); michael@0: } michael@0: michael@0: // CHECK#2 michael@0: if ("abc".charAt("x") !== "a") { michael@0: $ERROR('#2: "abc".charAt("x") === "a". Actual: ' + ("abc".charAt("x"))); michael@0: } michael@0: