Skip to content

Commit 5eb2899

Browse files
committed
Use SetIntegrityLevel instead of Object.freeze()
Verbose, but clear and correct. Fixes #74.
1 parent 1961618 commit 5eb2899

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

notifications.bs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,13 @@ return the <a>notification</a>'s <a for=notification>require interaction prefere
909909
result of the following steps:
910910

911911
<ol>
912-
<li><p>Let <var>frozenActions</var> be an empty list of type {{NotificationAction}}.
912+
<li><p>Let <var>frozenActions</var> be a new <a for=/>list</a>.
913913

914914
<li><p>For each <var>entry</var> in the <a>notification</a>'s list of
915915
<a for=notification>actions</a>, perform the following steps:
916916

917917
<ol>
918-
<li><p>Let <var>action</var> be a new {{NotificationAction}}.
918+
<li><p>Let <var>action</var> be a new {{NotificationAction}} <a for=/>dictionary</a>.
919919

920920
<li><p>Set <var>action</var>'s {{NotificationAction/action}} to
921921
<var>entry</var>'s <a for=action>name</a>.
@@ -926,15 +926,15 @@ result of the following steps:
926926
<li><p>Set <var>action</var>'s {{NotificationAction/icon}} to
927927
<var>entry</var>'s <a for=action>icon URL</a>.
928928

929-
<!-- XXX IDL dictionaries are usually returned by value, so don't need to be
930-
immutable. But FrozenArray reifies the dictionaries to mutable JS
931-
objects accessed by reference, so we explicitly freeze them.
932-
It would be better to do this with IDL primitives instead of JS - see
933-
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29004 -->
934-
<li><p>Call <a lt="freeze">Object.freeze</a> on <var>action</var>, to
935-
prevent accidental mutation by scripts.
929+
<li><p>Let <var>jsAction</var> be <var>action</var>, <a>converted to an ECMAScript value</a>.
936930

937-
<li><p>Append <var>action</var> to <var>frozenActions</var>.
931+
<li><p>Perform <a>SetIntegrityLevel</a>(<var>jsAction</var>, "frozen").
932+
933+
<li><p>Let <var>idlAction</var> be <var>jsAction</var>, <a>converted to an IDL value</a>.
934+
<!-- See https://www.w3.org/Bugs/Public/show_bug.cgi?id=29004 about replacing the above 3 steps
935+
with something simpler. -->
936+
937+
<li><p><a for=list>Append</a> <var>idlAction</var> to <var>frozenActions</var>.
938938
</ol>
939939

940940
<li><p><a>Create a frozen array</a> from <var>frozenActions</var>.
@@ -1224,8 +1224,8 @@ urlPrefix: https://w3c.github.io/vibration/
12241224
text: validate and normalize
12251225
urlPrefix: #idl-def-; type: interface
12261226
text: VibratePattern; url: vibratepattern
1227-
urlPrefix: https://tc39.github.io/ecma262/#sec-object.; type: dfn
1228-
text: freeze
1227+
urlPrefix: https://tc39.github.io/ecma262/#sec-; spec: ECMA-262; type: abstract-op
1228+
text: SetIntegrityLevel
12291229
</pre>
12301230

12311231
<pre class="biblio">

0 commit comments

Comments
 (0)