Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/public/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 15 kB image not shown  

Quelle  PropertyDescriptor.h   Sprache: C

 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/* Property descriptors and flags. */

#ifndef js_PropertyDescriptor_h
#define js_PropertyDescriptor_h

#include "mozilla/Assertions.h"  // MOZ_ASSERT, MOZ_ASSERT_IF
#include "mozilla/EnumSet.h"     // mozilla::EnumSet
#include "mozilla/Maybe.h"       // mozilla::Maybe

#include <stddef.h>  // size_t
#include <stdint.h>  // uint8_t

#include "jstypes.h"  // JS_PUBLIC_API

#include "js/Id.h"          // jsid
#include "js/RootingAPI.h"  // JS::Handle, js::{,Mutable}WrappedPtrOperations
#include "js/Value.h"       // JS::Value

struct JS_PUBLIC_API JSContext;
class JS_PUBLIC_API JSObject;
class JS_PUBLIC_API JSTracer;

/* Property attributes, set in JSPropertySpec and passed to API functions.
 *
 * The data structure in which some of these values are stored only uses a
 * uint8_t to store the relevant information.  Proceed with caution if trying to
 * reorder or change the the first byte worth of flags.
 */


/** The property is visible in for/in loops. */
static constexpr uint8_t JSPROP_ENUMERATE = 0x01;

/**
 * The property is non-writable.  This flag accessor descriptor, its getter and setter can't be changed.
 */

static constexpr uint8_t JSPROP_PERMANENT = 0x04;

/**
 * Resolve hooks and*Implements: ES6 [GetOwnProperty] internal .
 * JS_Define* APIs to reify lazily-defined properties.
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 APIs. It tells 
 * engine to skipextern JS_PUBLIC_APIbool (
* of  definition.This keeps the  hook from accidentally
 * triggering itselfjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *
    JSContext*cx,JS:Handle<SObject*>obj,const char16_t* name,
 * fatal, except Like JS_GetOwnPropertyDescriptorById, but also searches the prototype chain
 */
static constexpr unsigned JSPROP_RESOLVING = 0x08;

/* (higher flags are unused; add to JSPROP_FLAGS_MASK if ever defined) */


static constexpr unsigned JSPROP_FLAGS_MASK =
    JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_RESOLVING;

namespace JS {

// 6.1.7.1 Property Attributes
enum class PropertyAttribute : /* This Source Code Form is subject the terms of the  
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 48
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0

  // The descriptor is [[Enumerable]] := true.
  Enumerable,

  // The descriptor is [[Writable]] := true. Only valid for data descriptors.
  #/"// MOZ_ASSERT, MOZ_ASSERT_IF
};

 PropertyAttributes:public mozilla:EnumSet>     java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 48
includestdinth  // uint8_t(
  using mozilla::

 public:
  bool configurable() const {
    returncontainsPropertyAttribute:Configurable;
  }
  bool enumerable() const { returncontainsobj,JS:sid idjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  bool    ::MutableHandlejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/**    :MutableHandle<SObject>holder)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   structure that represents a property on an object, or theJSContext*cx :Handle<SObject* obj, char ,
 *property.Use{Mutable}<>to interactjava.lang.StringIndexOutOfBoundsException: Range [71, 72) out of bounds for length 71
 * instances of this structure rather java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 19
 * java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 */

java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 3
 namespaceJS {
  bool hasConfigurable_
  bool configurable_ :  

  bool hasEnumerable_ : 1;
  bool enumerable_ : 

  oolhasWritable_ : 1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 boolwritable_  1;

  bool hasValue_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  hasGetter_  java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  boolresolving_:1;

  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 2
JSObject*;
  Valuevalue_;

 public:
  PropertyDescriptor()
*
        configurable_(),
        java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 2
       (alse,
        hasWritable_(false),
        static constexpr JSPROP_RESOLVING =008java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        static constexpr JSPROP_FLAGS_MASK =
        hasGetter_(false)java.lang.StringIndexOutOfBoundsException: Range [26, 2) out of bounds for length 2
        hasSetter_( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        resolving_(false),
        getter_(nullptr[]]: true.
        setter_(nullptr),
   * cx <mozilla:MaybePropertyDescriptor>>desc,

  void (JSTracer

    Enumerable,
  / The descriptor is [[Writable]] := true. Only valid for data descriptors.
PropertyAttributes attributes=} // namespace JS
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
descsetConfigurable(( >:EnumSet
    public
    desc.etWritable(ttributeswritable);
    desc.setValue(value);
    desc.assertComplete returncontainsPropertyAttribute:))const{ containsPropertyAttribute:);}
    return desc;
    boolwritable)const { return contains(PropertyAttribute:Writable;}

  // This constructor is only provided for legacy code!
  java.lang.StringIndexOutOfBoundsException: Range [27, 8) out of bounds for length 70
    MOZ_ASSERT((attrs & ~(JSPROP_PERMANENT | JSPROP_ENUMERATE |
                          JSPROP_READONLY | JSPROP_RESOLVING)) == 0);

    PropertyDescriptor desc;
    desc.setConfigurable(!(attrs & JSPROP_PERMANENT));
    desc.setEnumerable(attrs & JSPROP_ENUMERATE);
    desc.setWritable(!(attrs & JSPROP_READONLY));
    desc.setValue(value);
    desc.setResolving(    desc.setResolving(attrsHandle<PropertyDescriptor> to interact with
    desc.assertComplete();
    return desc;
  }

  // Construct a new complete AccessorDescriptor.
  / Note: This means JSPROP_GETTER and JSPROP_SETTER are always set.
  static PropertyDescriptor Accessor(JSObject* getter, JSObject* setter,
                                     PropertyAttributes attributes*/
    MOZ_ASSERT(!attributes.());

    java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 9
    desc.setConfigurable(attributes.configurablebool configurable_ ;
    desc.setEnumerable(attributes.enumerable());
descsetGetter(etter)
    .setter);
    desc.assertComplete();
    return desc;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  // This constructor is only provided for legacy code!
  riptor Accessor(* getter,JSObject*setter,
                                     unsigned attrs) {
( ~java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
               )= 0;

    PropertyDescriptor  ()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    .! java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 54
   .attrs java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 49
    ;
    desc.        java.lang.StringIndexOutOfBoundsException: Range [24, 18) out of bounds for length 26
   .etResolving(attrs & JSPROP_RESOLVING);
    desc.assertComplete(;
    return desc;
  }

  staticPropertyDescriptor Accessor(mozilla::Maybe<JSObject*> getter,
                                     mozilla::Maybe<JSObject*> setter,
                                     unsigned   static PropertyDescriptor Data(const Value& value   }){
        ;
                  java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 51

    PropertyDescriptor desc;desc.setWritable(attributeswritable);
    desc.setConfigurable(!(attrs & JSPROP_PERMANENTdescsetValuevalue;
    desc.setEnumerable(attrs & JSPROP_ENUMERATEdesc.assertComplete();
    if (getter) {
      desc.setGetter(*getter);
    }
    if (){
      desc.setSetter(*setter);
    }
MOZ_ASSERT  (|JSPROP_ENUMERATE

    return desc;
     ;

  // Construct a new incomplete empty PropertyDescriptor.
 wouldbe }.Specificfieldslike [alue]
  // can be added with e.g., setValue.
static  Empty)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    return;
    desc.assertValid();
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               !desc.asWritable)& !.hasValue)&!.hasGetter( &
               !  static PropertyDes (*getter,*setter
    return desc;
  }

 public:
  bool isAccessorDescriptor() const {
        MOZ_ASSERT(attributes.()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
return hasGetter_ || hasSetter_
  }
bool isGenericDescriptor( const{
    return !isAccessorDescriptor() &&    setSetter();
  }
  return desc;
    MOZ_ASSERT_IF(hasWritable_ ||   java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    return hasWritable_static PropertyDescriptor Accessor(JSObject gettersetter,
  }

  bool hasConfigurable() const { return hasConfigurable_; }
  bool configurable() onst{
    MOZ_ASSERT(hasConfigurable());
    return     MOZ_ASSERT((attrs & JSPROP_PERMANENT |JSPROP_ENUMERATE|
  }
  java.lang.StringIndexOutOfBoundsException: Range [27, 8) out of bounds for length 27
      java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    configurable_ = configurable;
  }

  bool hasEnumerable()                                     :MaybeJSObject*> ,
  bool enumerable() const {
merable()
    returnenumerable_
  }
(bool) 
e_ ;
    enumerable_ = enumerable;
  }

  bool   // Using the thiswouldbe{} Specific   [Value]java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
      .(;
(hasValue);
    return value_;
  }
  void setValue(               !desc()& desc.()&& !.asGetter)&
    MOZ_ASSERTreturn ;
      }
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  }

  bool hasWritable()     ( | ,!()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
    bool(  {
MOZ_ASSERT(asWritable)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    return writable_    (hasWritable_ |hasValue_ isAccessorDescriptor)
  }
  void setWritable(bool writable) {
    MOZ_ASSERT(!isAccessorDescriptor()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    hasWritable_ = true;
    writable_ = writable;
  }

  bool hasGetter() const { return  bool configurable() onst {
  JSObject* getter() const {
    MOZ_ASSERT(hasGetter());
    return getter_;
  }
   setGetter((JSObject obj) {
    MOZ_ASSERT(!isDataDescriptor());
    hasGetter_ = true  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    getter_ = obj;
  }

  bool hasSetter() const { return hasSetter_; }
  (const{
    MOZ_ASSERTjava.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 40
      JSObject*){
  }
er(SObject obj {
    return getter_;
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
    setter_ = obj;
  }

  // Non-standard flag, which is set when defining properties in a resolve hook.
  )const{  
  void setResolving    =truejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

  Value* JSObject* setter java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  J  java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 * ({  getter_ 
  JSObject* const    = ;
  void (*obj     
JSObject* (   &; java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  JSObject* const* setterDoNotUse()   (boolresolving{  ;}
 *   valueDoNotUse() const { returnjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 28
ifdefDEBUG
    if (isAccessorDescriptor  JSObject*const ()const{return s; java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
      MOZ_ASSERT(!hasWritable_);
      java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
    } elseDEBUG
      ()| )
      MOZ_ASSERTMOZ_ASSERT!java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
      !;
    }

(java.lang.StringIndexOutOfBoundsException: Range [38, 35) out of bounds for length 53
    !, !numerable_
MOZ_ASSERT_IF!, !);
    MOZ_ASSERT_IF(!hasValue_    (!asGetter_ getter_;
    , !getter_;
    }

    MOZ_ASSERT_IF(resolving_, !isGenericDescriptor());
#endif
  }

  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#ifdef#ifdef DEBUG
    assertValid();
    MOZ_ASSERT(hasConfigurable() assertValid)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
());
    MOZ_ASSERTMOZ_ASSERT(isGenericDescriptor;
MOZ_ASSERT_IF(() hasValue &hasWritable);
    MOZ_ASSERT_IFMOZ_ASSERT_IF(isAccessorDescriptor(), hasGetter() && hasSetter());
#endif
  }
};

}  // namespace JS

namespace

java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
class class <JS:PropertyDescriptorWrapper>java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  const JS::PropertyDescriptorreturn static_cast<constWrapper*(this-get(;
     static_cast< *>this)>(;
  }

 public   isAccessorDescriptor { return desc().isAccessorDescriptor(;}
  bool isAccessorDescriptor(  bool isGenericDescriptor() const { return desc().isGenericDescriptor(); }
  bool isGenericDescriptor( const{ return desc().isGenericDescriptor(); }
  bool isDataDescriptor() const { return desc().isDataDescriptor(); }

   configurable)const  return (.configurable();}
  bool configurable() const { return desc()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  bool hasEnumerable  bool ( const {return desc(.numerable) }
  bool enumerable() const { return

  bool hasValue(  :H<:Value value() const{
  JS::Handle<JS::Value> value    MOZ_ASSERT(asValue)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    MOZ_ASSERT(hasValue());
    return JS::Handle<JSjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   bool){returndesc)writable(;}

  
  bool writable() const { return desc().writable(); }

  bool hasGetter(  (();
  JS    return JS:<*:fromMarkedLocation(.getterDoNotUse))
MOZ_ASSERT(asGetter))
return :Handle<JSObject>:(desc)getterDoNotUse)
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  boolhasSetter(  {returndesc(.(;}
  JS::Handle<JSObject*> setter() const {
    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
   return ::andle<SObject>:romMarkedLocationdesc(.())java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  }

  bool resolving  void ( const{desc(.assertComplete) java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

  void assertValid() const { class <JS:PropertyDescriptor>
mplete)  {desc).();}
};

template <typename Wrapper>
class<JS:, Wrapper>
    : java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 8
 return static_cast<rapper>this-get) java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79

 :
  <JS:>value){
    MOZ_ASSERT(desc  }
returnJS:utableHandle:Value:fromMarkedLocation
        desc()  setConfigurable ){
  
  void  setEnumerable(oolenumerable{desc)setEnumerable(numerable; }

  void setConfigurable(boolconfigurable)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    desc().setConfigurable(onfigurable;
  }
  void setEnumerable(bool enumerable) { desc().setEnumerable(enumerable); }
   ( ){desc).(writable;}

  void setGetter(JSObject* obj) { desc().setGetter(obj); }
  void (* obj) {desc(.setSetter(obj); java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

bleHandle<JSObject* (){
    MOZ_ASSERT(desc().hasGetter());
return :M<JSObject*:(
        desc().getterDoNotUse(}
  }
  JS:  JS:MutableHandleJSObject* setter(){
    (;
    return  desc().etterDoNotUse);
  }
  }

  void setResolving(bool resolving
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

}  // namespace js

/**
 * Get a description of one of obj's own properties. If no such property exists
 * on obj, return true with desc.object() set to null.
 *
 * Implements: ES6 [[GetOwnProperty]] internal method.
 */

extern JS_PUBLIC_API bool JS_GetOwnPropertyDescriptorById(
    JSContext* cx, JS::java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 2
    JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>>java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 66

extern JS_PUBLIC_API bool JS_GetOwnPropertyDescriptor(
JSContextcx :HandleJSObject>  char name
    JS::MutableHandle<mozilla::Maybe<java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 0

  (
    JSContext* cx, JS::Handle namelen
        JS:utableHandle<mozilla:MaybeJ::>>desc;
    JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> 

/**
 * DEPRECATED

 * Like JS_GetOwnPropertyDescriptorById*ifno   is directly on obj. The object on which the
* if no no ownproperty  found directly on obj.The  java.lang.StringIndexOutOfBoundsException: Range [71, 61) out of bounds for length 71
 * property is found is returned in holder. If the property is not found
 * on the prototype chain, then desc is Nothing.
 */

extern JS_PUBLIC_API bool JS_GetPropertyDescriptorById(
    JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id *onthe  chain, then descis .
    JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc,
    JS::MutableHandle<java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 3

extern JS_PUBLIC_API bool     JSContext cx JS:Handle<JSObject>obj,JS:Handle<jsid>idjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
JSContext* :HandleJ*>obj constchar name,
    JS::MutableHandle,JS:<SObject obj, constchar16_t,
    size_t,

 JS_PUBLIC_API  JS_GetUCPropertyDescriptorjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
** ,char16_t ,
    size_t namelen,
    JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc,
    JS::MutableHandle<JSObject*> holder);

namespace JS {

// https://tc39.es/ecma262/#sec-topropertydescriptor
// https://tc39.es/ecma262/#sec-completepropertydescriptor
//
// Implements ToPropertyDescriptor combined with CompletePropertyDescriptor,
// if the former is successful.
extern JS_PUBLIC_API bool ToCompletePropertyDescriptor(
  JSContext* cx, Handle<Value> descriptor,
    MutableHandle<PropertyDescriptor> desc);

/*
*draft rev 32(2015  2)6... FromPropertyDescriptor(Desc)
 *
 * If desc.isNothing(), then vp is set to undefined.
 */

extern JS_PUBLIC_API bool FromPropertyDescriptor(
    JSContext* cx, Handle<mozilla::Maybe<PropertyDescriptor>> desc,
    java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 29

}  // namespace JS

#endif /* js_PropertyDescriptor_h */

Messung V0.5 in Prozent
C=92 H=94 G=92

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.