Index: test/mjsunit/date.js |
diff --git a/test/mjsunit/date.js b/test/mjsunit/date.js |
index 3e153aba7f9113e113783815b4a34732b16468f0..504dfe541579fbf1ee5d9eeffd5a4c3ab14ca38a 100644 |
--- a/test/mjsunit/date.js |
+++ b/test/mjsunit/date.js |
@@ -25,6 +25,8 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// Flags: --allow-natives-syntax |
+ |
// Test date construction from other dates. |
var date0 = new Date(1111); |
var date1 = new Date(date0); |
@@ -319,3 +321,20 @@ for (var i = 0; i < 24; i++) { |
assertEquals(70674603500 - ms, Date.parse(string), string); |
} |
} |
+ |
+assertThrows('Date.prototype.setTime.call("", 1);', TypeError); |
+assertThrows('Date.prototype.setYear.call("", 1);', TypeError); |
+assertThrows('Date.prototype.setHours.call("", 1, 2, 3, 4);', TypeError); |
+assertThrows('Date.prototype.getDate.call("");', TypeError); |
+assertThrows('Date.prototype.getUTCDate.call("");', TypeError); |
+ |
+var date = new Date(); |
+date.getTime(); |
+date.getTime(); |
+%OptimizeFunctionOnNextCall(Date.prototype.getTime); |
+assertThrows(function() { Date.prototype.getTime.call(""); }, TypeError); |
Erik Corry
2012/09/07 09:22:33
Are you sure you are getting a deopt here? There'
|
+ |
+date.getYear(); |
+date.getYear(); |
+%OptimizeFunctionOnNextCall(Date.prototype.getYear); |
+assertThrows(function() { Date.prototype.getYear.call(""); }, TypeError); |