OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 // Fraction. | 2860 // Fraction. |
2861 CompileRun("var obj = 42.3;"); | 2861 CompileRun("var obj = 42.3;"); |
2862 obj = env->Global()->Get(v8_str("obj")); | 2862 obj = env->Global()->Get(v8_str("obj")); |
2863 CHECK(!obj->IsInt32()); | 2863 CHECK(!obj->IsInt32()); |
2864 CHECK(!obj->IsUint32()); | 2864 CHECK(!obj->IsUint32()); |
2865 // Large negative fraction. | 2865 // Large negative fraction. |
2866 CompileRun("var obj = -5726623061.75;"); | 2866 CompileRun("var obj = -5726623061.75;"); |
2867 obj = env->Global()->Get(v8_str("obj")); | 2867 obj = env->Global()->Get(v8_str("obj")); |
2868 CHECK(!obj->IsInt32()); | 2868 CHECK(!obj->IsInt32()); |
2869 CHECK(!obj->IsUint32()); | 2869 CHECK(!obj->IsUint32()); |
| 2870 // Positive zero |
| 2871 CompileRun("var obj = 0.0;"); |
| 2872 obj = env->Global()->Get(v8_str("obj")); |
| 2873 CHECK(obj->IsInt32()); |
| 2874 CHECK(obj->IsUint32()); |
| 2875 // Positive zero |
| 2876 CompileRun("var obj = -0.0;"); |
| 2877 obj = env->Global()->Get(v8_str("obj")); |
| 2878 CHECK(!obj->IsInt32()); |
| 2879 CHECK(!obj->IsUint32()); |
2870 } | 2880 } |
2871 | 2881 |
2872 | 2882 |
2873 THREADED_TEST(ConversionException) { | 2883 THREADED_TEST(ConversionException) { |
2874 v8::HandleScope scope; | 2884 v8::HandleScope scope; |
2875 LocalContext env; | 2885 LocalContext env; |
2876 CompileRun( | 2886 CompileRun( |
2877 "function TestClass() { };" | 2887 "function TestClass() { };" |
2878 "TestClass.prototype.toString = function () { throw 'uncle?'; };" | 2888 "TestClass.prototype.toString = function () { throw 'uncle?'; };" |
2879 "var obj = new TestClass();"); | 2889 "var obj = new TestClass();"); |
(...skipping 12934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15814 CompileRun("throw 'exception';"); | 15824 CompileRun("throw 'exception';"); |
15815 } | 15825 } |
15816 | 15826 |
15817 | 15827 |
15818 TEST(CallCompletedCallbackTwoExceptions) { | 15828 TEST(CallCompletedCallbackTwoExceptions) { |
15819 v8::HandleScope scope; | 15829 v8::HandleScope scope; |
15820 LocalContext env; | 15830 LocalContext env; |
15821 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); | 15831 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); |
15822 CompileRun("throw 'first exception';"); | 15832 CompileRun("throw 'first exception';"); |
15823 } | 15833 } |
OLD | NEW |