@@ -44,19 +44,18 @@ using ::v8::Script;
44
44
using ::v8::Function;
45
45
using ::v8::Extension;
46
46
47
- static void handle_property (Local<String > name,
47
+ static void handle_property (Local<Name > name,
48
48
const v8::PropertyCallbackInfo<v8::Value>& info) {
49
49
ApiTestFuzzer::Fuzz ();
50
50
info.GetReturnValue ().Set (v8_num (900 ));
51
51
}
52
52
53
- static void handle_property_2 (Local<String > name,
53
+ static void handle_property_2 (Local<Name > name,
54
54
const v8::PropertyCallbackInfo<v8::Value>& info) {
55
55
ApiTestFuzzer::Fuzz ();
56
56
info.GetReturnValue ().Set (v8_num (902 ));
57
57
}
58
58
59
-
60
59
static void handle_property (const v8::FunctionCallbackInfo<v8::Value>& info) {
61
60
ApiTestFuzzer::Fuzz ();
62
61
CHECK_EQ (0 , info.Length ());
@@ -145,17 +144,14 @@ THREADED_TEST(PropertyHandler) {
145
144
}
146
145
}
147
146
148
-
149
- static void GetIntValue (Local<String> property,
147
+ static void GetIntValue (Local<Name> property,
150
148
const v8::PropertyCallbackInfo<v8::Value>& info) {
151
149
ApiTestFuzzer::Fuzz ();
152
150
int * value = static_cast <int *>(info.Data ().As <v8::External>()->Value ());
153
151
info.GetReturnValue ().Set (v8_num (*value));
154
152
}
155
153
156
-
157
- static void SetIntValue (Local<String> property,
158
- Local<Value> value,
154
+ static void SetIntValue (Local<Name> property, Local<Value> value,
159
155
const v8::PropertyCallbackInfo<void >& info) {
160
156
int * field = static_cast <int *>(info.Data ().As <v8::External>()->Value ());
161
157
*field = value->Int32Value (info.GetIsolate ()->GetCurrentContext ()).FromJust ();
@@ -200,8 +196,7 @@ static void XGetter(const Info& info, int offset) {
200
196
info.GetReturnValue ().Set (v8_num (x_register[offset]));
201
197
}
202
198
203
-
204
- static void XGetter (Local<String> name,
199
+ static void XGetter (Local<Name> name,
205
200
const v8::PropertyCallbackInfo<v8::Value>& info) {
206
201
v8::Isolate* isolate = info.GetIsolate ();
207
202
CHECK (x_holder_global.Get (isolate)
@@ -210,7 +205,6 @@ static void XGetter(Local<String> name,
210
205
XGetter (info, 0 );
211
206
}
212
207
213
-
214
208
static void XGetter (const v8::FunctionCallbackInfo<v8::Value>& info) {
215
209
v8::Isolate* isolate = info.GetIsolate ();
216
210
CHECK (x_receiver_global.Get (isolate)
@@ -235,14 +229,11 @@ static void XSetter(Local<Value> value, const Info& info, int offset) {
235
229
info.GetReturnValue ().Set (v8_num (-1 ));
236
230
}
237
231
238
-
239
- static void XSetter (Local<String> name,
240
- Local<Value> value,
232
+ static void XSetter (Local<Name> name, Local<Value> value,
241
233
const v8::PropertyCallbackInfo<void >& info) {
242
234
XSetter (value, info, 0 );
243
235
}
244
236
245
-
246
237
static void XSetter (const v8::FunctionCallbackInfo<v8::Value>& info) {
247
238
CHECK_EQ (1 , info.Length ());
248
239
XSetter (info[0 ], info, 1 );
@@ -299,11 +290,9 @@ THREADED_TEST(AccessorIC) {
299
290
x_receiver_global.Reset ();
300
291
}
301
292
302
-
303
293
template <int C>
304
294
static void HandleAllocatingGetter (
305
- Local<String> name,
306
- const v8::PropertyCallbackInfo<v8::Value>& info) {
295
+ Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
307
296
ApiTestFuzzer::Fuzz ();
308
297
for (int i = 0 ; i < C; i++) {
309
298
USE (v8::String::NewFromUtf8Literal (info.GetIsolate (), " foo" ));
@@ -312,7 +301,6 @@ static void HandleAllocatingGetter(
312
301
v8::String::NewFromUtf8Literal (info.GetIsolate (), " foo" ));
313
302
}
314
303
315
-
316
304
THREADED_TEST (HandleScopePop) {
317
305
LocalContext context;
318
306
v8::Isolate* isolate = context->GetIsolate ();
@@ -340,8 +328,7 @@ THREADED_TEST(HandleScopePop) {
340
328
}
341
329
342
330
static void CheckAccessorArgsCorrect (
343
- Local<String> name,
344
- const v8::PropertyCallbackInfo<v8::Value>& info) {
331
+ Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
345
332
CHECK (info.GetIsolate () == CcTest::isolate ());
346
333
CHECK (info.This () == info.Holder ());
347
334
CHECK (info.Data ()
@@ -362,7 +349,6 @@ static void CheckAccessorArgsCorrect(
362
349
info.GetReturnValue ().Set (17 );
363
350
}
364
351
365
-
366
352
THREADED_TEST (DirectCall) {
367
353
LocalContext context;
368
354
v8::Isolate* isolate = context->GetIsolate ();
@@ -383,15 +369,14 @@ THREADED_TEST(DirectCall) {
383
369
}
384
370
}
385
371
386
- static void EmptyGetter (Local<String > name,
372
+ static void EmptyGetter (Local<Name > name,
387
373
const v8::PropertyCallbackInfo<v8::Value>& info) {
388
374
CheckAccessorArgsCorrect (name, info);
389
375
ApiTestFuzzer::Fuzz ();
390
376
CheckAccessorArgsCorrect (name, info);
391
377
info.GetReturnValue ().Set (v8::Local<v8::Value>());
392
378
}
393
379
394
-
395
380
THREADED_TEST (EmptyResult) {
396
381
LocalContext context;
397
382
v8::Isolate* isolate = context->GetIsolate ();
@@ -453,20 +438,16 @@ THREADED_TEST(NoReuseRegress) {
453
438
}
454
439
455
440
static void ThrowingGetAccessor (
456
- Local<String> name,
457
- const v8::PropertyCallbackInfo<v8::Value>& info) {
441
+ Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
458
442
ApiTestFuzzer::Fuzz ();
459
443
info.GetIsolate ()->ThrowException (v8_str (" g" ));
460
444
}
461
445
462
-
463
- static void ThrowingSetAccessor (Local<String> name,
464
- Local<Value> value,
446
+ static void ThrowingSetAccessor (Local<Name> name, Local<Value> value,
465
447
const v8::PropertyCallbackInfo<void >& info) {
466
448
info.GetIsolate ()->ThrowException (value);
467
449
}
468
450
469
-
470
451
THREADED_TEST (Regress1054726) {
471
452
LocalContext env;
472
453
v8::Isolate* isolate = env->GetIsolate ();
@@ -507,14 +488,12 @@ THREADED_TEST(Regress1054726) {
507
488
CHECK (v8_str (" 01234" )->Equals (env.local (), result).FromJust ());
508
489
}
509
490
510
-
511
- static void AllocGetter (Local<String> name,
491
+ static void AllocGetter (Local<Name> name,
512
492
const v8::PropertyCallbackInfo<v8::Value>& info) {
513
493
ApiTestFuzzer::Fuzz ();
514
494
info.GetReturnValue ().Set (v8::Array::New (info.GetIsolate (), 1000 ));
515
495
}
516
496
517
-
518
497
THREADED_TEST (Gc) {
519
498
LocalContext env;
520
499
v8::Isolate* isolate = env->GetIsolate ();
@@ -536,8 +515,7 @@ THREADED_TEST(Gc) {
536
515
.ToLocalChecked ();
537
516
}
538
517
539
-
540
- static void StackCheck (Local<String> name,
518
+ static void StackCheck (Local<Name> name,
541
519
const v8::PropertyCallbackInfo<v8::Value>& info) {
542
520
i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
543
521
i::StackFrameIterator iter (isolate);
@@ -550,7 +528,6 @@ static void StackCheck(Local<String> name,
550
528
}
551
529
}
552
530
553
-
554
531
THREADED_TEST (StackIteration) {
555
532
LocalContext env;
556
533
v8::Isolate* isolate = env->GetIsolate ();
@@ -574,16 +551,14 @@ THREADED_TEST(StackIteration) {
574
551
.ToLocalChecked ();
575
552
}
576
553
577
-
578
- static void AllocateHandles (Local<String> name,
554
+ static void AllocateHandles (Local<Name> name,
579
555
const v8::PropertyCallbackInfo<v8::Value>& info) {
580
556
for (int i = 0 ; i < i::kHandleBlockSize + 1 ; i++) {
581
557
v8::Local<v8::Value>::New (info.GetIsolate (), name);
582
558
}
583
559
info.GetReturnValue ().Set (v8::Integer::New (info.GetIsolate (), 100 ));
584
560
}
585
561
586
-
587
562
THREADED_TEST (HandleScopeSegment) {
588
563
// Check that we can return values past popping of handle scope
589
564
// segments.
@@ -705,26 +680,23 @@ THREADED_TEST(GlobalObjectAccessor) {
705
680
}
706
681
}
707
682
708
-
709
- static void EmptyGetter (Local<Name> name,
710
- const v8::PropertyCallbackInfo<v8::Value>& info) {
683
+ static void EmptyGenericGetter (
684
+ Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
711
685
// The request is not intercepted so don't call ApiTestFuzzer::Fuzz() here.
712
686
}
713
687
714
-
715
- static void OneProperty (Local<String> name,
688
+ static void OneProperty (Local<Name> name,
716
689
const v8::PropertyCallbackInfo<v8::Value>& info) {
717
690
ApiTestFuzzer::Fuzz ();
718
691
info.GetReturnValue ().Set (v8_num (1 ));
719
692
}
720
693
721
-
722
694
THREADED_TEST (Regress433458) {
723
695
LocalContext env;
724
696
v8::Isolate* isolate = env->GetIsolate ();
725
697
v8::HandleScope scope (isolate);
726
698
v8::Local<v8::ObjectTemplate> obj = ObjectTemplate::New (isolate);
727
- obj->SetHandler (v8::NamedPropertyHandlerConfiguration (EmptyGetter ));
699
+ obj->SetHandler (v8::NamedPropertyHandlerConfiguration (EmptyGenericGetter ));
728
700
obj->SetNativeDataProperty (v8_str (" prop" ), OneProperty);
729
701
CHECK (env->Global ()
730
702
->Set (env.local (), v8_str (" obj" ),
@@ -828,7 +800,7 @@ TEST(PrototypeGetterAccessCheck) {
828
800
}
829
801
}
830
802
831
- static void CheckReceiver (Local<String > name,
803
+ static void CheckReceiver (Local<Name > name,
832
804
const v8::PropertyCallbackInfo<v8::Value>& info) {
833
805
CHECK (info.This ()->IsObject ());
834
806
}
0 commit comments