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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 assertEquals(undefined, args[1]); | 264 assertEquals(undefined, args[1]); |
265 assertEquals(key, args[key]); | 265 assertEquals(key, args[key]); |
266 assertEquals(2, args.length); | 266 assertEquals(2, args.length); |
267 | 267 |
268 delete args[key]; | 268 delete args[key]; |
269 assertEquals(undefined, args[0]); | 269 assertEquals(undefined, args[0]); |
270 assertEquals(undefined, args[1]); | 270 assertEquals(undefined, args[1]); |
271 assertEquals(undefined, args[key]); | 271 assertEquals(undefined, args[key]); |
272 assertEquals(2, args.length); | 272 assertEquals(2, args.length); |
273 })(); | 273 })(); |
| 274 |
| 275 (function testSloppyArgumentsLengthMapChange() { |
| 276 function f(a) { return arguments }; |
| 277 let args1 = f(1); |
| 278 let args2 = f(1,2); |
| 279 assertTrue(%HaveSameMap(args1, args2)); |
| 280 // Changing the length type doesn't causes a map transition. |
| 281 args2.length = 12; |
| 282 assertTrue(%HaveSameMap(args1, args2)); |
| 283 args2.length = 12.0; |
| 284 assertTrue(%HaveSameMap(args1, args2)); |
| 285 args2.length = "aa" |
| 286 assertTrue(%HaveSameMap(args1, args2)); |
| 287 })(); |
OLD | NEW |