| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 2. Call ToInteger(pos) | 53 2. Call ToInteger(pos) |
| 54 3. Compute the number of characters in result(1). | 54 3. Compute the number of characters in result(1). |
| 55 4. If Result(2) is less than 0 or is not less than | 55 4. If Result(2) is less than 0 or is not less than |
| 56 Result(3), return NaN. | 56 Result(3), return NaN. |
| 57 5. Return a value of Number type, of positive sign, whose | 57 5. Return a value of Number type, of positive sign, whose |
| 58 magnitude is the Unicode encoding of one character | 58 magnitude is the Unicode encoding of one character |
| 59 from result 1, namely the characer at position Result | 59 from result 1, namely the characer at position Result |
| 60 (2), where the first character in Result(1) is | 60 (2), where the first character in Result(1) is |
| 61 considered to be at position 0. | 61 considered to be at position 0. |
| 62 | 62 |
| 63 Note that the charCodeAt funciton is intentionally | 63 Note that the charCodeAt function is intentionally |
| 64 generic; it does not require that its this value be a | 64 generic; it does not require that its this value be a |
| 65 String object. Therefore it can be transferred to other | 65 String object. Therefore it can be transferred to other |
| 66 kinds of objects for use as a method. | 66 kinds of objects for use as a method. |
| 67 | 67 |
| 68 Author: christine@netscape.com | 68 Author: christine@netscape.com |
| 69 Date: 2 october 1997 | 69 Date: 2 october 1997 |
| 70 */ | 70 */ |
| 71 var SECTION = "15.5.4.5-5"; | 71 var SECTION = "15.5.4.5-5"; |
| 72 var VERSION = "ECMA_1"; | 72 var VERSION = "ECMA_1"; |
| 73 startTest(); | 73 startTest(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN,
eval("x=new String();x.charCodeAt(Number.NaN)") ); | 98 new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN,
eval("x=new String();x.charCodeAt(Number.NaN)") ); |
| 99 new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFIN
ITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.POSITIVE_INFIN
ITY)") ); | 99 new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFIN
ITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.POSITIVE_INFIN
ITY)") ); |
| 100 new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFIN
ITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NEGATIVE_INFIN
ITY)") ); | 100 new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFIN
ITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NEGATIVE_INFIN
ITY)") ); |
| 101 | 101 |
| 102 for ( var j = 0; j < 255; j++ ) { | 102 for ( var j = 0; j < 255; j++ ) { |
| 103 new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", j, TEST_STRING
.charCodeAt(j) ); | 103 new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", j, TEST_STRING
.charCodeAt(j) ); |
| 104 } | 104 } |
| 105 | 105 |
| 106 test(); | 106 test(); |
| OLD | NEW |