The ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. You can not directly manipulate the contents of an ArrayBuffer; instead, you create one of the typed array objects or a DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
Inheritance: ClrStubFunction
Esempio n. 1
0
        /// <summary>
        /// Creates the ArrayBuffer prototype object.
        /// </summary>
        /// <param name="engine"> The script environment. </param>
        /// <param name="constructor"> A reference to the constructor that owns the prototype. </param>
        internal static ObjectInstance CreatePrototype(ScriptEngine engine, ArrayBufferConstructor constructor)
        {
            var result     = engine.Object.Construct();
            var properties = GetDeclarativeProperties(engine);

            properties.Add(new PropertyNameAndValue("constructor", constructor, PropertyAttributes.NonEnumerable));
            properties.Add(new PropertyNameAndValue(engine.Symbol.ToStringTag, "ArrayBuffer", PropertyAttributes.Configurable));
            result.FastSetProperties(properties);
            return(result);
        }
 /// <summary>
 /// Creates the ArrayBuffer prototype object.
 /// </summary>
 /// <param name="engine"> The script environment. </param>
 /// <param name="constructor"> A reference to the constructor that owns the prototype. </param>
 internal static ObjectInstance CreatePrototype(ScriptEngine engine, ArrayBufferConstructor constructor)
 {
     var result = engine.Object.Construct();
     var properties = GetDeclarativeProperties(engine);
     properties.Add(new PropertyNameAndValue("constructor", constructor, PropertyAttributes.NonEnumerable));
     properties.Add(new PropertyNameAndValue(engine.Symbol.ToStringTag, "ArrayBuffer", PropertyAttributes.Configurable));
     result.FastSetProperties(properties);
     return result;
 }