tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S9.3.1_A3_T2.js (1476B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    The MV of StringNumericLiteral ::: StrWhiteSpaceopt StrNumericLiteral
      7    StrWhiteSpaceopt is the MV of StrNumericLiteral, no matter whether white
      8    space is present or not
      9 es5id: 9.3.1_A3_T2
     10 description: dynamic string
     11 ---*/
     12 
     13 function dynaString(s1, s2) {
     14  return String(s1) + String(s2);
     15 }
     16 
     17 assert.sameValue(
     18  Number(dynaString("\u0009\u000C\u0020\u00A0\u000B", "\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")),
     19  0
     20 );
     21 
     22 assert.sameValue(
     23  +(dynaString("\u0009\u000C\u0020\u00A0\u000A\u000D\u2028\u2029\u000B12345", "67890\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")),
     24  1234567890
     25 );
     26 
     27 assert.sameValue(
     28  Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")),
     29  Infinity
     30 );
     31 
     32 assert.sameValue(
     33  Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029-Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")),
     34  -Infinity
     35 );
     36 
     37 reportCompare(0, 0);