| OLD | NEW |
| 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 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 4877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4888 value = CompileRun(apply_99); | 4888 value = CompileRun(apply_99); |
| 4889 CHECK(!try_catch.HasCaught()); | 4889 CHECK(!try_catch.HasCaught()); |
| 4890 CHECK_EQ(99, value->Int32Value()); | 4890 CHECK_EQ(99, value->Int32Value()); |
| 4891 | 4891 |
| 4892 const char* call_17 = "Function.prototype.call.call(obj, this, 17)"; | 4892 const char* call_17 = "Function.prototype.call.call(obj, this, 17)"; |
| 4893 value = CompileRun(call_17); | 4893 value = CompileRun(call_17); |
| 4894 CHECK(!try_catch.HasCaught()); | 4894 CHECK(!try_catch.HasCaught()); |
| 4895 CHECK_EQ(17, value->Int32Value()); | 4895 CHECK_EQ(17, value->Int32Value()); |
| 4896 | 4896 |
| 4897 // Check that the call-as-function handler can be called through | 4897 // Check that the call-as-function handler can be called through |
| 4898 // new. Currently, there is no way to check in the call-as-function | 4898 // new. |
| 4899 // handler if it has been called through new or not. | |
| 4900 value = CompileRun("new obj(43)"); | 4899 value = CompileRun("new obj(43)"); |
| 4901 CHECK(!try_catch.HasCaught()); | 4900 CHECK(!try_catch.HasCaught()); |
| 4902 CHECK_EQ(-43, value->Int32Value()); | 4901 CHECK_EQ(-43, value->Int32Value()); |
| 4903 } | 4902 } |
| 4904 | 4903 |
| 4905 | 4904 |
| 4906 static int CountHandles() { | 4905 static int CountHandles() { |
| 4907 return v8::HandleScope::NumberOfHandles(); | 4906 return v8::HandleScope::NumberOfHandles(); |
| 4908 } | 4907 } |
| 4909 | 4908 |
| (...skipping 3750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8660 CompileRun(source_exception); | 8659 CompileRun(source_exception); |
| 8661 other_context->Exit(); | 8660 other_context->Exit(); |
| 8662 v8::internal::Heap::CollectAllGarbage(false); | 8661 v8::internal::Heap::CollectAllGarbage(false); |
| 8663 if (GetGlobalObjectsCount() == 1) break; | 8662 if (GetGlobalObjectsCount() == 1) break; |
| 8664 } | 8663 } |
| 8665 CHECK_GE(2, gc_count); | 8664 CHECK_GE(2, gc_count); |
| 8666 CHECK_EQ(1, GetGlobalObjectsCount()); | 8665 CHECK_EQ(1, GetGlobalObjectsCount()); |
| 8667 | 8666 |
| 8668 other_context.Dispose(); | 8667 other_context.Dispose(); |
| 8669 } | 8668 } |
| OLD | NEW |