1# Copyright 2013 the V8 project authors. All rights reserved. 2# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12# 13# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24Test the JavaScript ToNumber operation. 25 26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29PASS +undefined is NaN 30PASS +null is 0 31PASS +false is 0 32PASS +true is 1 33PASS +2 is 2 34PASS +'' is 0 35PASS +' ' is 0 36PASS +' 1' is 1 37PASS +'1 ' is 1 38PASS +'x1' is NaN 39PASS +'1x' is NaN 40PASS +'0x1' is 1 41PASS +'1x0' is NaN 42PASS +(nullCharacter + '1') is NaN 43PASS +('1' + nullCharacter) is NaN 44PASS +('1' + nullCharacter + '1') is NaN 45PASS +(nonASCIICharacter + '1') is NaN 46PASS +('1' + nonASCIICharacter) is NaN 47PASS +('1' + nonASCIICharacter + '1') is NaN 48PASS +('1' + nonASCIINonSpaceCharacter) is NaN 49PASS +(nonASCIINonSpaceCharacter + '1') is NaN 50PASS +('1' + nonASCIINonSpaceCharacter + '1') is NaN 51PASS +(illegalUTF16Sequence + '1') is NaN 52PASS +('1' + illegalUTF16Sequence) is NaN 53PASS +('1' + illegalUTF16Sequence + '1') is NaN 54PASS +'inf' is NaN 55PASS +'infinity' is NaN 56PASS +'Inf' is NaN 57PASS +'+inf' is NaN 58PASS +'+infinity' is NaN 59PASS +'+Inf' is NaN 60PASS +'-inf' is NaN 61PASS +'-infinity' is NaN 62PASS +'-Inf' is NaN 63PASS +'Infinity' is Infinity 64PASS +'+Infinity' is Infinity 65PASS +'-Infinity' is -Infinity 66PASS +'++1' is NaN 67PASS +'AB' is NaN 68PASS +'0xAB' is 171 69PASS +'1e1' is 10 70PASS +'1E1' is 10 71PASS +tab is 0 72PASS +nbsp is 0 73PASS +ff is 0 74PASS +vt is 0 75PASS +cr is 0 76PASS +lf is 0 77PASS +ls is 0 78PASS +ps is 0 79PASS +oghamSpaceMark is 0 80PASS +mongolianVowelSeparator is 0 81PASS +enQuad is 0 82PASS +emQuad is 0 83PASS +enSpace is 0 84PASS +emSpace is 0 85PASS +threePerEmSpace is 0 86PASS +fourPerEmSpace is 0 87PASS +sixPerEmSpace is 0 88PASS +figureSpace is 0 89PASS +punctuationSpace is 0 90PASS +thinSpace is 0 91PASS +hairSpace is 0 92PASS +narrowNoBreakSpace is 0 93PASS +mediumMathematicalSpace is 0 94PASS +ideographicSpace is 0 95PASS +(tab + '1') is 1 96PASS +(nbsp + '1') is 1 97PASS +(ff + '1') is 1 98PASS +(vt + '1') is 1 99PASS +(cr + '1') is 1 100PASS +(lf + '1') is 1 101PASS +(ls + '1') is 1 102PASS +(ps + '1') is 1 103PASS +(oghamSpaceMark + '1') is 1 104PASS +(mongolianVowelSeparator + '1') is 1 105PASS +(enQuad + '1') is 1 106PASS +(emQuad + '1') is 1 107PASS +(enSpace + '1') is 1 108PASS +(emSpace + '1') is 1 109PASS +(threePerEmSpace + '1') is 1 110PASS +(fourPerEmSpace + '1') is 1 111PASS +(sixPerEmSpace + '1') is 1 112PASS +(figureSpace + '1') is 1 113PASS +(punctuationSpace + '1') is 1 114PASS +(thinSpace + '1') is 1 115PASS +(hairSpace + '1') is 1 116PASS +(narrowNoBreakSpace + '1') is 1 117PASS +(mediumMathematicalSpace + '1') is 1 118PASS +(ideographicSpace + '1') is 1 119PASS +('1' + tab) is 1 120PASS +('1' + nbsp) is 1 121PASS +('1' + ff) is 1 122PASS +('1' + vt) is 1 123PASS +('1' + cr) is 1 124PASS +('1' + lf) is 1 125PASS +('1' + ls) is 1 126PASS +('1' + ps) is 1 127PASS +('1' + oghamSpaceMark) is 1 128PASS +('1' + mongolianVowelSeparator) is 1 129PASS +('1' + enQuad) is 1 130PASS +('1' + emQuad) is 1 131PASS +('1' + enSpace) is 1 132PASS +('1' + emSpace) is 1 133PASS +('1' + threePerEmSpace) is 1 134PASS +('1' + fourPerEmSpace) is 1 135PASS +('1' + sixPerEmSpace) is 1 136PASS +('1' + figureSpace) is 1 137PASS +('1' + punctuationSpace) is 1 138PASS +('1' + thinSpace) is 1 139PASS +('1' + hairSpace) is 1 140PASS +('1' + narrowNoBreakSpace) is 1 141PASS +('1' + mediumMathematicalSpace) is 1 142PASS +('1' + ideographicSpace) is 1 143PASS +('1' + tab + '1') is NaN 144PASS +('1' + nbsp + '1') is NaN 145PASS +('1' + ff + '1') is NaN 146PASS +('1' + vt + '1') is NaN 147PASS +('1' + cr + '1') is NaN 148PASS +('1' + lf + '1') is NaN 149PASS +('1' + ls + '1') is NaN 150PASS +('1' + ps + '1') is NaN 151PASS +('1' + oghamSpaceMark + '1') is NaN 152PASS +('1' + mongolianVowelSeparator + '1') is NaN 153PASS +('1' + enQuad + '1') is NaN 154PASS +('1' + emQuad + '1') is NaN 155PASS +('1' + enSpace + '1') is NaN 156PASS +('1' + emSpace + '1') is NaN 157PASS +('1' + threePerEmSpace + '1') is NaN 158PASS +('1' + fourPerEmSpace + '1') is NaN 159PASS +('1' + sixPerEmSpace + '1') is NaN 160PASS +('1' + figureSpace + '1') is NaN 161PASS +('1' + punctuationSpace + '1') is NaN 162PASS +('1' + thinSpace + '1') is NaN 163PASS +('1' + hairSpace + '1') is NaN 164PASS +('1' + narrowNoBreakSpace + '1') is NaN 165PASS +('1' + mediumMathematicalSpace + '1') is NaN 166PASS +('1' + ideographicSpace + '1') is NaN 167PASS successfullyParsed is true 168 169TEST COMPLETE 170 171