Skip to content

Commit b43c923

Browse files
committed
Edited ch03.asciidoc with Atlas code editor
1 parent b431bba commit b43c923

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch03.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ Object.assign({}, { a: ['b', 'c', 'd'] }, { a: ['e', 'f'] })
771771
// <- { a: ['e', 'f'] }
772772
----
773773

774-
At the time of this writing, there's an ECMAScript stage 3 proposalpass:[<span data-type="footnote" id="object-spread">You can find the proposal draft at <a href="http://bit.ly/2r2ima9">GitHub</a>.</span>] to implement spread in objects, similar to how you can spread iterable objects onto an array in ES6. Spreading an ((("objects", "object spread")))object onto another is equivalent to using an `Object.assign` function call.
774+
At the time of this writing, there's an ECMAScript stage 3 proposalpass:[<span data-type="footnote" id="object-spread">You can find the proposal draft at <a href="https://mjavascript.com/out/proposal-promise-finally">GitHub</a>.</span>] to implement spread in objects, similar to how you can spread iterable objects onto an array in ES6. Spreading an ((("objects", "object spread")))object onto another is equivalent to using an `Object.assign` function call.
775775

776776
The following piece of code shows a few cases where we're spreading the properties of an object onto another one, and their `Object.assign` counterpart. As you can see, using object spread is more succinct and should be preferred where possible.
777777

@@ -975,7 +975,7 @@ Just as they made it easy to create new monsters--or "non-player characters" (_N
975975
.Modifying properties for a RunUO item in-game from the Ultima Online client
976976
image::images/pmjs_0301.png["Modifying properties for a RunUO item in-game from the Ultima Online client."]
977977

978-
Not every property in a class is meant to be accessible in-game, though. Some properties are only meant for internal use, or not meant to be modified at runtime. RunUO had a `CommandPropertyAttribute` decorator,pass:[<span data-type="footnote" id="runuo-attributes">The RunUO Git repository has the definition of <a href="http://bit.ly/2r1Xlfs"><code>CommandPropertyAttribute</code> for RunUO</a>.</span>] which defined that the property could be modified in-game and let you also specify the access level required to read and write that property. This decorator was used extensively throughout the RunUO codebase.pass:[<span data-type="footnote" id="runuo-commandprops">Its use is widespread throughout the codebase, marking over 200 properties in the <a href="https://mjavascript.com/out/runuo-commandprops">RunUO core alone</a>.</span>]
978+
Not every property in a class is meant to be accessible in-game, though. Some properties are only meant for internal use, or not meant to be modified at runtime. RunUO had a `CommandPropertyAttribute` decorator,pass:[<span data-type="footnote" id="runuo-attributes">The RunUO Git repository has the definition of <a href="https://mjavascript.com/out/runuo-attributes"><code>CommandPropertyAttribute</code> for RunUO</a>.</span>] which defined that the property could be modified in-game and let you also specify the access level required to read and write that property. This decorator was used extensively throughout the RunUO codebase.pass:[<span data-type="footnote" id="runuo-commandprops">Its use is widespread throughout the codebase, marking over 200 properties in the <a href="https://mjavascript.com/out/runuo-commandprops">RunUO core alone</a>.</span>]
979979

980980
The `PlayerMobile` class, which governed how a player's character works, is a great place to look at these attributes. `PlayerMobile` has several properties that are accessible in-gamepass:[<span data-type="footnote" id="runuo-playermobile">You can find quite a few usage examples of the <code>CommandProperty</code> attribute in the <a href="https://mjavascript.com/out/runuo-playermobile"><code>PlayerMobile.cs</code> class</a>.</span>] to administrators and moderators. Here are a couple of getters and setters, but only the first one has the `CommandProperty` attribute--making that property accessible to Game Masters in-game.
981981

0 commit comments

Comments
 (0)