OLD | NEW |
1 // Copyright 2012 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 |
(...skipping 16073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16084 " sum=ee_op_test_count_func(sum);" | 16084 " sum=ee_op_test_count_func(sum);" |
16085 "}" | 16085 "}" |
16086 "sum;"); | 16086 "sum;"); |
16087 CHECK_EQ(16000000, result->Int32Value(context).FromJust()); | 16087 CHECK_EQ(16000000, result->Int32Value(context).FromJust()); |
16088 | 16088 |
16089 result = CompileRun("ext_array[3] = 33;" | 16089 result = CompileRun("ext_array[3] = 33;" |
16090 "delete ext_array[3];" | 16090 "delete ext_array[3];" |
16091 "ext_array[3];"); | 16091 "ext_array[3];"); |
16092 CHECK_EQ(33, result->Int32Value(context).FromJust()); | 16092 CHECK_EQ(33, result->Int32Value(context).FromJust()); |
16093 | 16093 |
16094 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" | 16094 result = CompileRun( |
16095 "ext_array[2] = 12; ext_array[3] = 13;" | 16095 "ext_array[0] = 10; ext_array[1] = 11;" |
16096 "ext_array.__defineGetter__('2'," | 16096 "ext_array[2] = 12; ext_array[3] = 13;" |
16097 "function() { return 120; });" | 16097 "try { ext_array.__defineGetter__('2'," |
16098 "ext_array[2];"); | 16098 "function() { return 120; }); } catch(e) {};" |
| 16099 "ext_array[2];"); |
16099 CHECK_EQ(12, result->Int32Value(context).FromJust()); | 16100 CHECK_EQ(12, result->Int32Value(context).FromJust()); |
16100 | 16101 |
16101 result = CompileRun("var js_array = new Array(40);" | 16102 result = CompileRun("var js_array = new Array(40);" |
16102 "js_array[0] = 77;" | 16103 "js_array[0] = 77;" |
16103 "js_array;"); | 16104 "js_array;"); |
16104 CHECK_EQ(77, v8::Object::Cast(*result) | 16105 CHECK_EQ(77, v8::Object::Cast(*result) |
16105 ->Get(context, v8_str("0")) | 16106 ->Get(context, v8_str("0")) |
16106 .ToLocalChecked() | 16107 .ToLocalChecked() |
16107 ->Int32Value(context) | 16108 ->Int32Value(context) |
16108 .FromJust()); | 16109 .FromJust()); |
(...skipping 8858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24967 } | 24968 } |
24968 | 24969 |
24969 TEST(PrivateForApiIsNumber) { | 24970 TEST(PrivateForApiIsNumber) { |
24970 LocalContext context; | 24971 LocalContext context; |
24971 v8::Isolate* isolate = CcTest::isolate(); | 24972 v8::Isolate* isolate = CcTest::isolate(); |
24972 v8::HandleScope scope(isolate); | 24973 v8::HandleScope scope(isolate); |
24973 | 24974 |
24974 // Shouldn't crash. | 24975 // Shouldn't crash. |
24975 v8::Private::ForApi(isolate, v8_str("42")); | 24976 v8::Private::ForApi(isolate, v8_str("42")); |
24976 } | 24977 } |
OLD | NEW |