@@ -305,335 +305,6 @@ Handle<AccessorInfo> Accessors::MakeStringLengthInfo(Isolate* isolate) {
305305 &StringLengthGetter, nullptr );
306306}
307307
308- //
309- // Accessors::ScriptColumnOffset
310- //
311-
312-
313- void Accessors::ScriptColumnOffsetGetter (
314- v8::Local<v8::Name> name,
315- const v8::PropertyCallbackInfo<v8::Value>& info) {
316- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
317- DisallowHeapAllocation no_allocation;
318- HandleScope scope (isolate);
319- Object* object = *Utils::OpenHandle (*info.Holder ());
320- Object* res = Smi::FromInt (
321- Script::cast (JSValue::cast (object)->value ())->column_offset ());
322- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(res, isolate)));
323- }
324-
325- Handle<AccessorInfo> Accessors::MakeScriptColumnOffsetInfo (Isolate* isolate) {
326- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
327- STATIC_CHAR_VECTOR (" column_offset" )));
328- return MakeAccessor (isolate, name, &ScriptColumnOffsetGetter, nullptr );
329- }
330-
331-
332- //
333- // Accessors::ScriptId
334- //
335-
336-
337- void Accessors::ScriptIdGetter (
338- v8::Local<v8::Name> name,
339- const v8::PropertyCallbackInfo<v8::Value>& info) {
340- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
341- DisallowHeapAllocation no_allocation;
342- HandleScope scope (isolate);
343- Object* object = *Utils::OpenHandle (*info.Holder ());
344- Object* id = Smi::FromInt (Script::cast (JSValue::cast (object)->value ())->id ());
345- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(id, isolate)));
346- }
347-
348- Handle<AccessorInfo> Accessors::MakeScriptIdInfo (Isolate* isolate) {
349- Handle<String> name (
350- isolate->factory ()->InternalizeOneByteString (STATIC_CHAR_VECTOR (" id" )));
351- return MakeAccessor (isolate, name, &ScriptIdGetter, nullptr );
352- }
353-
354-
355- //
356- // Accessors::ScriptName
357- //
358-
359-
360- void Accessors::ScriptNameGetter (
361- v8::Local<v8::Name> name,
362- const v8::PropertyCallbackInfo<v8::Value>& info) {
363- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
364- DisallowHeapAllocation no_allocation;
365- HandleScope scope (isolate);
366- Object* object = *Utils::OpenHandle (*info.Holder ());
367- Object* source = Script::cast (JSValue::cast (object)->value ())->name ();
368- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(source, isolate)));
369- }
370-
371- Handle<AccessorInfo> Accessors::MakeScriptNameInfo (Isolate* isolate) {
372- return MakeAccessor (isolate, isolate->factory ()->name_string (),
373- &ScriptNameGetter, nullptr );
374- }
375-
376-
377- //
378- // Accessors::ScriptSource
379- //
380-
381-
382- void Accessors::ScriptSourceGetter (
383- v8::Local<v8::Name> name,
384- const v8::PropertyCallbackInfo<v8::Value>& info) {
385- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
386- DisallowHeapAllocation no_allocation;
387- HandleScope scope (isolate);
388- Object* object = *Utils::OpenHandle (*info.Holder ());
389- Object* source = Script::cast (JSValue::cast (object)->value ())->source ();
390- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(source, isolate)));
391- }
392-
393- Handle<AccessorInfo> Accessors::MakeScriptSourceInfo (Isolate* isolate) {
394- return MakeAccessor (isolate, isolate->factory ()->source_string (),
395- &ScriptSourceGetter, nullptr );
396- }
397-
398-
399- //
400- // Accessors::ScriptLineOffset
401- //
402-
403-
404- void Accessors::ScriptLineOffsetGetter (
405- v8::Local<v8::Name> name,
406- const v8::PropertyCallbackInfo<v8::Value>& info) {
407- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
408- DisallowHeapAllocation no_allocation;
409- HandleScope scope (isolate);
410- Object* object = *Utils::OpenHandle (*info.Holder ());
411- Object* res =
412- Smi::FromInt (Script::cast (JSValue::cast (object)->value ())->line_offset ());
413- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(res, isolate)));
414- }
415-
416- Handle<AccessorInfo> Accessors::MakeScriptLineOffsetInfo (Isolate* isolate) {
417- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
418- STATIC_CHAR_VECTOR (" line_offset" )));
419- return MakeAccessor (isolate, name, &ScriptLineOffsetGetter, nullptr );
420- }
421-
422-
423- //
424- // Accessors::ScriptType
425- //
426-
427-
428- void Accessors::ScriptTypeGetter (
429- v8::Local<v8::Name> name,
430- const v8::PropertyCallbackInfo<v8::Value>& info) {
431- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
432- DisallowHeapAllocation no_allocation;
433- HandleScope scope (isolate);
434- Object* object = *Utils::OpenHandle (*info.Holder ());
435- Object* res =
436- Smi::FromInt (Script::cast (JSValue::cast (object)->value ())->type ());
437- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(res, isolate)));
438- }
439-
440- Handle<AccessorInfo> Accessors::MakeScriptTypeInfo (Isolate* isolate) {
441- Handle<String> name (
442- isolate->factory ()->InternalizeOneByteString (STATIC_CHAR_VECTOR (" type" )));
443- return MakeAccessor (isolate, name, &ScriptTypeGetter, nullptr );
444- }
445-
446-
447- //
448- // Accessors::ScriptCompilationType
449- //
450-
451-
452- void Accessors::ScriptCompilationTypeGetter (
453- v8::Local<v8::Name> name,
454- const v8::PropertyCallbackInfo<v8::Value>& info) {
455- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
456- DisallowHeapAllocation no_allocation;
457- HandleScope scope (isolate);
458- Object* object = *Utils::OpenHandle (*info.Holder ());
459- Object* res = Smi::FromInt (
460- Script::cast (JSValue::cast (object)->value ())->compilation_type ());
461- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(res, isolate)));
462- }
463-
464- Handle<AccessorInfo> Accessors::MakeScriptCompilationTypeInfo (
465- Isolate* isolate) {
466- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
467- STATIC_CHAR_VECTOR (" compilation_type" )));
468- return MakeAccessor (isolate, name, &ScriptCompilationTypeGetter, nullptr );
469- }
470-
471-
472- //
473- // Accessors::ScriptSourceUrl
474- //
475-
476-
477- void Accessors::ScriptSourceUrlGetter (
478- v8::Local<v8::Name> name,
479- const v8::PropertyCallbackInfo<v8::Value>& info) {
480- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
481- DisallowHeapAllocation no_allocation;
482- HandleScope scope (isolate);
483- Object* object = *Utils::OpenHandle (*info.Holder ());
484- Object* url = Script::cast (JSValue::cast (object)->value ())->source_url ();
485- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(url, isolate)));
486- }
487-
488- Handle<AccessorInfo> Accessors::MakeScriptSourceUrlInfo (Isolate* isolate) {
489- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
490- STATIC_CHAR_VECTOR (" source_url" )));
491- return MakeAccessor (isolate, name, &ScriptSourceUrlGetter, nullptr );
492- }
493-
494-
495- //
496- // Accessors::ScriptSourceMappingUrl
497- //
498-
499-
500- void Accessors::ScriptSourceMappingUrlGetter (
501- v8::Local<v8::Name> name,
502- const v8::PropertyCallbackInfo<v8::Value>& info) {
503- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
504- DisallowHeapAllocation no_allocation;
505- HandleScope scope (isolate);
506- Object* object = *Utils::OpenHandle (*info.Holder ());
507- Object* url =
508- Script::cast (JSValue::cast (object)->value ())->source_mapping_url ();
509- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(url, isolate)));
510- }
511-
512- Handle<AccessorInfo> Accessors::MakeScriptSourceMappingUrlInfo (
513- Isolate* isolate) {
514- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
515- STATIC_CHAR_VECTOR (" source_mapping_url" )));
516- return MakeAccessor (isolate, name, &ScriptSourceMappingUrlGetter, nullptr );
517- }
518-
519-
520- //
521- // Accessors::ScriptGetContextData
522- //
523-
524-
525- void Accessors::ScriptContextDataGetter (
526- v8::Local<v8::Name> name,
527- const v8::PropertyCallbackInfo<v8::Value>& info) {
528- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
529- DisallowHeapAllocation no_allocation;
530- HandleScope scope (isolate);
531- Object* object = *Utils::OpenHandle (*info.Holder ());
532- Object* res = Script::cast (JSValue::cast (object)->value ())->context_data ();
533- info.GetReturnValue ().Set (Utils::ToLocal (Handle<Object>(res, isolate)));
534- }
535-
536- Handle<AccessorInfo> Accessors::MakeScriptContextDataInfo (Isolate* isolate) {
537- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
538- STATIC_CHAR_VECTOR (" context_data" )));
539- return MakeAccessor (isolate, name, &ScriptContextDataGetter, nullptr );
540- }
541-
542-
543- //
544- // Accessors::ScriptGetEvalFromScript
545- //
546-
547-
548- void Accessors::ScriptEvalFromScriptGetter (
549- v8::Local<v8::Name> name,
550- const v8::PropertyCallbackInfo<v8::Value>& info) {
551- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
552- HandleScope scope (isolate);
553- Handle<Object> object = Utils::OpenHandle (*info.Holder ());
554- Handle<Script> script (
555- Script::cast (Handle<JSValue>::cast (object)->value ()), isolate);
556- Handle<Object> result = isolate->factory ()->undefined_value ();
557- if (script->has_eval_from_shared ()) {
558- Handle<SharedFunctionInfo> eval_from_shared (script->eval_from_shared (),
559- isolate);
560- if (eval_from_shared->script ()->IsScript ()) {
561- Handle<Script> eval_from_script (Script::cast (eval_from_shared->script ()),
562- isolate);
563- result = Script::GetWrapper (eval_from_script);
564- }
565- }
566-
567- info.GetReturnValue ().Set (Utils::ToLocal (result));
568- }
569-
570- Handle<AccessorInfo> Accessors::MakeScriptEvalFromScriptInfo (Isolate* isolate) {
571- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
572- STATIC_CHAR_VECTOR (" eval_from_script" )));
573- return MakeAccessor (isolate, name, &ScriptEvalFromScriptGetter, nullptr );
574- }
575-
576-
577- //
578- // Accessors::ScriptGetEvalFromScriptPosition
579- //
580-
581-
582- void Accessors::ScriptEvalFromScriptPositionGetter (
583- v8::Local<v8::Name> name,
584- const v8::PropertyCallbackInfo<v8::Value>& info) {
585- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
586- HandleScope scope (isolate);
587- Handle<Object> object = Utils::OpenHandle (*info.Holder ());
588- Handle<Script> script (
589- Script::cast (Handle<JSValue>::cast (object)->value ()), isolate);
590- Handle<Object> result = isolate->factory ()->undefined_value ();
591- if (script->compilation_type () == Script::COMPILATION_TYPE_EVAL ) {
592- result = Handle<Object>(Smi::FromInt (script->GetEvalPosition ()), isolate);
593- }
594- info.GetReturnValue ().Set (Utils::ToLocal (result));
595- }
596-
597- Handle<AccessorInfo> Accessors::MakeScriptEvalFromScriptPositionInfo (
598- Isolate* isolate) {
599- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
600- STATIC_CHAR_VECTOR (" eval_from_script_position" )));
601- return MakeAccessor (isolate, name, &ScriptEvalFromScriptPositionGetter,
602- nullptr );
603- }
604-
605-
606- //
607- // Accessors::ScriptGetEvalFromFunctionName
608- //
609-
610-
611- void Accessors::ScriptEvalFromFunctionNameGetter (
612- v8::Local<v8::Name> name,
613- const v8::PropertyCallbackInfo<v8::Value>& info) {
614- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(info.GetIsolate ());
615- HandleScope scope (isolate);
616- Handle<Object> object = Utils::OpenHandle (*info.Holder ());
617- Handle<Script> script (
618- Script::cast (Handle<JSValue>::cast (object)->value ()), isolate);
619- Handle<Object> result = isolate->factory ()->undefined_value ();
620- if (script->has_eval_from_shared ()) {
621- Handle<SharedFunctionInfo> shared (script->eval_from_shared (), isolate);
622- // Find the name of the function calling eval.
623- result = Handle<Object>(shared->Name (), isolate);
624- }
625- info.GetReturnValue ().Set (Utils::ToLocal (result));
626- }
627-
628- Handle<AccessorInfo> Accessors::MakeScriptEvalFromFunctionNameInfo (
629- Isolate* isolate) {
630- Handle<String> name (isolate->factory ()->InternalizeOneByteString (
631- STATIC_CHAR_VECTOR (" eval_from_function_name" )));
632- return MakeAccessor (isolate, name, &ScriptEvalFromFunctionNameGetter,
633- nullptr );
634- }
635-
636-
637308//
638309// Accessors::FunctionPrototype
639310//
0 commit comments