| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 Number.prototype[7]; | 140 Number.prototype[7]; |
| 141 | 141 |
| 142 String.prototype.TypeOfThis = TypeOfThis; | 142 String.prototype.TypeOfThis = TypeOfThis; |
| 143 Boolean.prototype.TypeOfThis = TypeOfThis; | 143 Boolean.prototype.TypeOfThis = TypeOfThis; |
| 144 Number.prototype.TypeOfThis = TypeOfThis; | 144 Number.prototype.TypeOfThis = TypeOfThis; |
| 145 Boolean.prototype[7] = TypeOfThis; | 145 Boolean.prototype[7] = TypeOfThis; |
| 146 Number.prototype[7] = TypeOfThis; | 146 Number.prototype[7] = TypeOfThis; |
| 147 | 147 |
| 148 RunTests(); | 148 RunTests(); |
| 149 | 149 |
| 150 // According to ES3 15.3.4.3 the this value passed to Function.prototyle.apply | 150 // According to ES5 15.3.4.3 the this value passed to Function.prototyle.apply |
| 151 // should wrapped. According to ES5 it should not. | 151 // should not be wrapped. (According to ES3 it should.) |
| 152 assertEquals('object', TypeOfThis.apply('xxx', [])); | 152 assertEquals('string', TypeOfThis.apply('xxx', [])); |
| 153 assertEquals('object', TypeOfThis.apply(true, [])); | 153 assertEquals('boolean', TypeOfThis.apply(true, [])); |
| 154 assertEquals('object', TypeOfThis.apply(false, [])); | 154 assertEquals('boolean', TypeOfThis.apply(false, [])); |
| 155 assertEquals('object', TypeOfThis.apply(42, [])); | 155 assertEquals('number', TypeOfThis.apply(42, [])); |
| 156 assertEquals('object', TypeOfThis.apply(3.14, [])); | 156 assertEquals('number', TypeOfThis.apply(3.14, [])); |
| 157 | 157 |
| 158 // According to ES3 15.3.4.3 the this value passed to Function.prototyle.call | 158 // According to ES5 15.3.4.4 the this value passed to Function.prototyle.call |
| 159 // should wrapped. According to ES5 it should not. | 159 // should not be wrapped. (According to ES3 it should.) |
| 160 assertEquals('object', TypeOfThis.call('xxx')); | 160 assertEquals('string', TypeOfThis.call('xxx')); |
| 161 assertEquals('object', TypeOfThis.call(true)); | 161 assertEquals('boolean', TypeOfThis.call(true)); |
| 162 assertEquals('object', TypeOfThis.call(false)); | 162 assertEquals('boolean', TypeOfThis.call(false)); |
| 163 assertEquals('object', TypeOfThis.call(42)); | 163 assertEquals('number', TypeOfThis.call(42)); |
| 164 assertEquals('object', TypeOfThis.call(3.14)); | 164 assertEquals('number', TypeOfThis.call(3.14)); |
| OLD | NEW |