W3cubDocs

/JavaScript

WebAssembly.memory.prototype

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The WebAssembly.Memory.prototype property represents the prototype for the WebAssembly.Memory() constructor.

Property attributes of WebAssembly.Memory.prototype
Writable no
Enumerable no
Configurable no

Description

All WebAssembly.Memory instances inherit from Memory.prototype. The prototype object of the WebAssembly.Memory() constructor can be modified to affect all WebAssembly.Memory instances.

Properties

Memory.prototype.constructor
Returns the function that created this object's instance. By default this is the WebAssembly.Memory() constructor.
Memory.prototype.buffer
An accessor property that returns the buffer contained in the memory.

Methods

Memory.prototype.grow()
Increases the size of the memory instance by a specified number of WebAssembly pages (each one is 64KB in size).

Specifications

Specification Status Comment
WebAssembly JavaScript API
The definition of 'Memory' in that specification.
Draft Initial draft definition.

Browser compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 57 16 522 No 44 11
Feature Android webview Chrome for Android Edge mobile Firefox for Android IE mobile Opera Android iOS Safari
Basic support 57 57 Yes1 522 No ? 11

1. This feature is behind the Experimental JavaScript Features preference.

2. Disabled in the Firefox 52 Extended Support Release (ESR).

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/prototype