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 16123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16134 " sum=ee_op_test_count_func(sum);" | 16134 " sum=ee_op_test_count_func(sum);" |
16135 "}" | 16135 "}" |
16136 "sum;"); | 16136 "sum;"); |
16137 CHECK_EQ(16000000, result->Int32Value(context).FromJust()); | 16137 CHECK_EQ(16000000, result->Int32Value(context).FromJust()); |
16138 | 16138 |
16139 result = CompileRun("ext_array[3] = 33;" | 16139 result = CompileRun("ext_array[3] = 33;" |
16140 "delete ext_array[3];" | 16140 "delete ext_array[3];" |
16141 "ext_array[3];"); | 16141 "ext_array[3];"); |
16142 CHECK_EQ(33, result->Int32Value(context).FromJust()); | 16142 CHECK_EQ(33, result->Int32Value(context).FromJust()); |
16143 | 16143 |
16144 result = CompileRun("ext_array[0] = 10; ext_array[1] = 11;" | 16144 result = CompileRun( |
16145 "ext_array[2] = 12; ext_array[3] = 13;" | 16145 "ext_array[0] = 10; ext_array[1] = 11;" |
16146 "ext_array.__defineGetter__('2'," | 16146 "ext_array[2] = 12; ext_array[3] = 13;" |
16147 "function() { return 120; });" | 16147 "try { ext_array.__defineGetter__('2'," |
16148 "ext_array[2];"); | 16148 "function() { return 120; }); } catch(e) {};" |
| 16149 "ext_array[2];"); |
16149 CHECK_EQ(12, result->Int32Value(context).FromJust()); | 16150 CHECK_EQ(12, result->Int32Value(context).FromJust()); |
16150 | 16151 |
16151 result = CompileRun("var js_array = new Array(40);" | 16152 result = CompileRun("var js_array = new Array(40);" |
16152 "js_array[0] = 77;" | 16153 "js_array[0] = 77;" |
16153 "js_array;"); | 16154 "js_array;"); |
16154 CHECK_EQ(77, v8::Object::Cast(*result) | 16155 CHECK_EQ(77, v8::Object::Cast(*result) |
16155 ->Get(context, v8_str("0")) | 16156 ->Get(context, v8_str("0")) |
16156 .ToLocalChecked() | 16157 .ToLocalChecked() |
16157 ->Int32Value(context) | 16158 ->Int32Value(context) |
16158 .FromJust()); | 16159 .FromJust()); |
(...skipping 8861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
25020 } | 25021 } |
25021 | 25022 |
25022 TEST(PrivateForApiIsNumber) { | 25023 TEST(PrivateForApiIsNumber) { |
25023 LocalContext context; | 25024 LocalContext context; |
25024 v8::Isolate* isolate = CcTest::isolate(); | 25025 v8::Isolate* isolate = CcTest::isolate(); |
25025 v8::HandleScope scope(isolate); | 25026 v8::HandleScope scope(isolate); |
25026 | 25027 |
25027 // Shouldn't crash. | 25028 // Shouldn't crash. |
25028 v8::Private::ForApi(isolate, v8_str("42")); | 25029 v8::Private::ForApi(isolate, v8_str("42")); |
25029 } | 25030 } |
OLD | NEW |