OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 outer_eval_conversion3(return_this, 'object'); | 167 outer_eval_conversion3(return_this, 'object'); |
168 outer_eval_conversion3(strict_eval, 'undefined'); | 168 outer_eval_conversion3(strict_eval, 'undefined'); |
169 outer_eval_conversion3(non_strict_eval, 'object'); | 169 outer_eval_conversion3(non_strict_eval, 'object'); |
170 | 170 |
171 // TODO(ager): I'm not sure this is in accordance with the spec. At | 171 // TODO(ager): I'm not sure this is in accordance with the spec. At |
172 // the moment, any call to eval where eval is not bound in the global | 172 // the moment, any call to eval where eval is not bound in the global |
173 // context is treated as an indirect call to eval which means that the | 173 // context is treated as an indirect call to eval which means that the |
174 // global context is used and the global object is passed as the | 174 // global context is used and the global object is passed as the |
175 // receiver. | 175 // receiver. |
176 outer_eval_conversion3(eval, 'object'); | 176 outer_eval_conversion3(eval, 'object'); |
| 177 |
| 178 function test_constant_function() { |
| 179 var o = { f: function() { "use strict"; return this; } }; |
| 180 this.__proto__ = o; |
| 181 for (var i = 0; i < 10; i++) assertEquals(void 0, f()); |
| 182 } |
| 183 test_constant_function(); |
| 184 |
| 185 function test_field() { |
| 186 var o = { }; |
| 187 o.f = function() {}; |
| 188 o.f = function() { "use strict"; return this; }; |
| 189 this.__proto__ = o; |
| 190 for (var i = 0; i < 10; i++) assertEquals(void 0, f()); |
| 191 } |
| 192 test_field(); |
OLD | NEW |