OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "test/cctest/test-api.h" | 7 #include "test/cctest/test-api.h" |
8 | 8 |
9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3244 ApiTestFuzzer::Fuzz(); | 3244 ApiTestFuzzer::Fuzz(); |
3245 auto context = info.GetIsolate()->GetCurrentContext(); | 3245 auto context = info.GetIsolate()->GetCurrentContext(); |
3246 if (name->Equals(v8_str("db"))) return; | 3246 if (name->Equals(v8_str("db"))) return; |
3247 Local<v8::Object> db = info.Holder() | 3247 Local<v8::Object> db = info.Holder() |
3248 ->GetRealNamedProperty(context, v8_str("db")) | 3248 ->GetRealNamedProperty(context, v8_str("db")) |
3249 .ToLocalChecked() | 3249 .ToLocalChecked() |
3250 .As<v8::Object>(); | 3250 .As<v8::Object>(); |
3251 db->Set(context, name, value).FromJust(); | 3251 db->Set(context, name, value).FromJust(); |
3252 info.GetReturnValue().Set(value); | 3252 info.GetReturnValue().Set(value); |
3253 } | 3253 } |
3254 } | 3254 |
| 3255 } // namespace |
3255 | 3256 |
3256 | 3257 |
3257 THREADED_TEST(NonMaskingInterceptorGlobalEvalRegression) { | 3258 THREADED_TEST(NonMaskingInterceptorGlobalEvalRegression) { |
3258 auto isolate = CcTest::isolate(); | 3259 auto isolate = CcTest::isolate(); |
3259 v8::HandleScope handle_scope(isolate); | 3260 v8::HandleScope handle_scope(isolate); |
3260 LocalContext context; | 3261 LocalContext context; |
3261 | 3262 |
3262 auto interceptor_templ = v8::ObjectTemplate::New(isolate); | 3263 auto interceptor_templ = v8::ObjectTemplate::New(isolate); |
3263 v8::NamedPropertyHandlerConfiguration conf(DatabaseGetter, DatabaseSetter); | 3264 v8::NamedPropertyHandlerConfiguration conf(DatabaseGetter, DatabaseSetter); |
3264 conf.flags = v8::PropertyHandlerFlags::kNonMasking; | 3265 conf.flags = v8::PropertyHandlerFlags::kNonMasking; |
(...skipping 13 matching lines...) Expand all Loading... |
3278 "var obj = intercepted_1;" | 3279 "var obj = intercepted_1;" |
3279 "obj.x = 4;" | 3280 "obj.x = 4;" |
3280 "eval('obj.x');" | 3281 "eval('obj.x');" |
3281 "eval('obj.x');" | 3282 "eval('obj.x');" |
3282 "eval('obj.x');" | 3283 "eval('obj.x');" |
3283 "obj = intercepted_2;" | 3284 "obj = intercepted_2;" |
3284 "obj.x = 9;" | 3285 "obj.x = 9;" |
3285 "eval('obj.x');", | 3286 "eval('obj.x');", |
3286 9); | 3287 9); |
3287 } | 3288 } |
OLD | NEW |