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-3"; | 71 var SECTION = "15.5.4.5-3"; |
72 var VERSION = "ECMA_1"; | 72 var VERSION = "ECMA_1"; |
73 startTest(); | 73 startTest(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(4)", 0x006
6, noo.charCodeAt(4) ); | 122 new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(4)", 0x006
6, noo.charCodeAt(4) ); |
123 | 123 |
124 test(); | 124 test(); |
125 | 125 |
126 | 126 |
127 function MyObject (v) { | 127 function MyObject (v) { |
128 this.value = v; | 128 this.value = v; |
129 this.toString = new Function ( "return this.value +\"\"" ); | 129 this.toString = new Function ( "return this.value +\"\"" ); |
130 this.charCodeAt = String.prototype.charCodeAt; | 130 this.charCodeAt = String.prototype.charCodeAt; |
131 } | 131 } |
OLD | NEW |