diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2016-11-08 21:04:57 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2016-11-16 07:52:57 +0100 |
commit | 367065be4be33dac6e0c325f88dfa1fac1314903 (patch) | |
tree | bdfadf72df864915d38384b2c1bf8ddd402d922d /doc/api/addons.md | |
parent | 5242114d89652a217880c0a0f216bf46a51c1379 (diff) | |
download | android-node-v8-367065be4be33dac6e0c325f88dfa1fac1314903.tar.gz android-node-v8-367065be4be33dac6e0c325f88dfa1fac1314903.tar.bz2 android-node-v8-367065be4be33dac6e0c325f88dfa1fac1314903.zip |
doc: make comment indentation consistent
Currently, some of the docs use different indentation for comments
in the code examples. This commit makes the indentation consistent
by putting the comments at the beginning of the line (really no
indentation that is).
PR-URL: https://github.com/nodejs/node/pull/9518
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'doc/api/addons.md')
-rw-r--r-- | doc/api/addons.md | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/doc/api/addons.md b/doc/api/addons.md index 1dfdf8e3bb..d91f60ae7b 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -140,7 +140,8 @@ Once built, the binary Addon can be used from within Node.js by pointing // hello.js const addon = require('./build/Release/addon'); -console.log(addon.hello()); // 'world' +console.log(addon.hello()); +// Prints: 'world' ``` Please see the examples below for further information or @@ -372,7 +373,8 @@ To test it, run the following JavaScript: const addon = require('./build/Release/addon'); addon((msg) => { - console.log(msg); // 'hello world' + console.log(msg); +// Prints: 'hello world' }); ``` @@ -423,7 +425,8 @@ const addon = require('./build/Release/addon'); var obj1 = addon('hello'); var obj2 = addon('world'); -console.log(obj1.msg, obj2.msg); // 'hello world' +console.log(obj1.msg, obj2.msg); +// Prints: 'hello world' ``` @@ -480,7 +483,8 @@ To test: const addon = require('./build/Release/addon'); var fn = addon(); -console.log(fn()); // 'hello world' +console.log(fn()); +// Prints: 'hello world' ``` @@ -642,9 +646,12 @@ Test it with: const addon = require('./build/Release/addon'); var obj = new addon.MyObject(10); -console.log(obj.plusOne()); // 11 -console.log(obj.plusOne()); // 12 -console.log(obj.plusOne()); // 13 +console.log(obj.plusOne()); +// Prints: 11 +console.log(obj.plusOne()); +// Prints: 12 +console.log(obj.plusOne()); +// Prints: 13 ``` ### Factory of wrapped objects @@ -834,14 +841,20 @@ Test it with: const createObject = require('./build/Release/addon'); var obj = createObject(10); -console.log(obj.plusOne()); // 11 -console.log(obj.plusOne()); // 12 -console.log(obj.plusOne()); // 13 +console.log(obj.plusOne()); +// Prints: 11 +console.log(obj.plusOne()); +// Prints: 12 +console.log(obj.plusOne()); +// Prints: 13 var obj2 = createObject(20); -console.log(obj2.plusOne()); // 21 -console.log(obj2.plusOne()); // 22 -console.log(obj2.plusOne()); // 23 +console.log(obj2.plusOne()); +// Prints: 21 +console.log(obj2.plusOne()); +// Prints: 22 +console.log(obj2.plusOne()); +// Prints: 23 ``` @@ -1013,7 +1026,8 @@ var obj1 = addon.createObject(10); var obj2 = addon.createObject(20); var result = addon.add(obj1, obj2); -console.log(result); // 30 +console.log(result); +// Prints: 30 ``` ### AtExit hooks |