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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 assertEquals("p_nonconf", key) | 602 assertEquals("p_nonconf", key) |
603 | 603 |
604 assertThrows(function(){ o.p_throw = 51 }, "myexn") | 604 assertThrows(function(){ o.p_throw = 51 }, "myexn") |
605 assertEquals("p_throw", key) | 605 assertEquals("p_throw", key) |
606 | 606 |
607 assertThrows(function(){ o.p_setterthrow = 52 }, "myexn") | 607 assertThrows(function(){ o.p_setterthrow = 52 }, "myexn") |
608 assertEquals("p_setterthrow", key) | 608 assertEquals("p_setterthrow", key) |
609 } | 609 } |
610 | 610 |
611 TestSetForDerived({ | 611 TestSetForDerived({ |
612 getOwnPropertyDescriptor: function(k) { | 612 getPropertyDescriptor: function(k) { |
613 key = k; | 613 key = k; |
614 switch (k) { | 614 switch (k) { |
615 case "p_writable": return {writable: true, configurable: true} | 615 case "p_writable": return {writable: true, configurable: true} |
616 case "p_nonwritable": return {writable: false, configurable: true} | 616 case "p_nonwritable": return {writable: false, configurable: true} |
617 case "p_setter":return {set: function(x) { val = x }, configurable: true} | 617 case "p_setter":return {set: function(x) { val = x }, configurable: true} |
618 case "p_nosetter": return {get: function() { return 1 }, configurable: tru
e} | 618 case "p_nosetter": return {get: function() { return 1 }, configurable: tru
e} |
619 case "p_nonconf":return {} | 619 case "p_nonconf":return {} |
620 case "p_throw": throw "myexn" | 620 case "p_throw": throw "myexn" |
621 case "p_setterthrow": return {set: function(x) { throw "myexn" }} | 621 case "p_setterthrow": return {set: function(x) { throw "myexn" }} |
622 default: return undefined | 622 default: return undefined |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2346 | 2346 |
2347 TestAccessorCall( | 2347 TestAccessorCall( |
2348 Proxy.createFunction({}, function() { receiver = this; return 42 }), | 2348 Proxy.createFunction({}, function() { receiver = this; return 42 }), |
2349 Proxy.createFunction({}, function(x) { receiver = this; value = x }) | 2349 Proxy.createFunction({}, function(x) { receiver = this; value = x }) |
2350 ) | 2350 ) |
2351 | 2351 |
2352 TestAccessorCall( | 2352 TestAccessorCall( |
2353 CreateFrozen({}, function() { receiver = this; return 42 }), | 2353 CreateFrozen({}, function() { receiver = this; return 42 }), |
2354 CreateFrozen({}, function(x) { receiver = this; value = x }) | 2354 CreateFrozen({}, function(x) { receiver = this; value = x }) |
2355 ) | 2355 ) |
OLD | NEW |