Timothy Gu
2ced07ccaf
zlib: support all ArrayBufferView types
...
PR-URL: https://github.com/nodejs/node/pull/12223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-12 10:03:26 -07:00
Timothy Gu
a8f460f12d
crypto: support all ArrayBufferView types
...
PR-URL: https://github.com/nodejs/node/pull/12223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-12 10:03:22 -07:00
Timothy Gu
0c539faac3
test: add common.getArrayBufferViews(buf)
...
PR-URL: https://github.com/nodejs/node/pull/12223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-12 10:03:14 -07:00
Timothy Gu
faa447b256
src: allow ArrayBufferView as instance of Buffer
...
PR-URL: https://github.com/nodejs/node/pull/12223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-12 10:02:59 -07:00
Timothy Gu
a37273c1e4
util: use V8 C++ API for inspecting Promises
...
PR-URL: https://github.com/nodejs/node/pull/12254
Refs: https://github.com/nodejs/node/issues/11875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Josh Gavant <josh.gavant@outlook.com >
2017-04-08 11:07:00 -07:00
Timothy Gu
c4469c49ec
url: error when domainTo*() is called w/o argument
...
PR-URL: https://github.com/nodejs/node/pull/12134
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-04-04 09:51:44 -07:00
Timothy Gu
91383e47fd
zlib: support Uint8Array in convenience methods
...
Also support Uint8Array as a `dictionary` option.
PR-URL: https://github.com/nodejs/node/pull/12001
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-04-03 09:50:09 +02:00
Timothy Gu
4ddd23f0ec
src: WHATWG URL C++ parser cleanup
...
- Clarify port state
- Remove scheme flag
- Clarify URL_FLAG_TERMINATED
PR-URL: https://github.com/nodejs/node/pull/11917
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-03-29 22:19:33 -07:00
Timothy Gu
cfc8422a68
lib: use Object.create(null) directly
...
After V8 5.6, using Object.create(null) directly is now faster than
using a constructor for map-like objects.
PR-URL: https://github.com/nodejs/node/pull/11930
Refs: https://github.com/emberjs/ember.js/issues/15001
Refs: https://crrev.com/532c16eca071df3ec8eed394dcebb932ef584ee6
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-24 15:25:49 -07:00
Timothy Gu
14a91957f8
url: use a class for WHATWG url[context]
...
The object is used as a structure, not as a map, which `StorageObject`
was designed for.
PR-URL: https://github.com/nodejs/node/pull/11930
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-24 15:25:40 -07:00
Timothy Gu
a6e69f8c08
benchmark: add more options to map-bench
...
PR-URL: https://github.com/nodejs/node/pull/11930
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-24 15:25:14 -07:00
Timothy Gu
4fb9b1226f
src, buffer: do not segfault on out-of-range index
...
Also add test cases for partial writes and invalid indices.
PR-URL: https://github.com/nodejs/node/pull/11927
Fixes: https://github.com/nodejs/node/issues/8724
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-03-21 21:53:57 -07:00
Timothy Gu
d23123643d
src: make PercentDecode return void
...
It only returns 0, nor is it likely to have any error conditions in the
future.
PR-URL: https://github.com/nodejs/node/pull/11922
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-21 17:45:54 -07:00
Timothy Gu
c515a985ea
url: spec-compliant URLSearchParams parser
...
The entire `URLSearchParams` class is now fully spec-compliant.
PR-URL: https://github.com/nodejs/node/pull/11858
Fixes: https://github.com/nodejs/node/issues/10821
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2017-03-21 17:27:11 -07:00
Timothy Gu
c98a8022b7
querystring: move isHexTable to internal
...
PR-URL: https://github.com/nodejs/node/pull/11858
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2017-03-21 17:27:11 -07:00
Timothy Gu
d099f8e317
src: remove explicit UTF-8 validity check in url
...
This step was never part of the URL Standard's host parser algorithm,
and is rendered unnecessary after IDNA errors are no longer ignored.
PR-URL: https://github.com/nodejs/node/pull/11859
Refs: c2a302c50b "src: do not ignore IDNA conversion error"
Refs: https://url.spec.whatwg.org/#concept-host-parser
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-16 16:39:39 -07:00
Timothy Gu
d77a7588cf
url: spec-compliant URLSearchParams serializer
...
PR-URL: https://github.com/nodejs/node/pull/11626
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2017-03-14 13:14:20 -07:00
Timothy Gu
99b27ce99a
url: prioritize toString when stringifying
...
The ES addition operator calls the ToPrimitive() abstract operation
without hint String, leading a subsequent OrdinaryToPrimitive() to call
valueOf() first on an object rather than the desired toString().
Instead, use template literals which directly call ToString() abstract
operation, per Web IDL spec.
PR-URL: https://github.com/nodejs/node/pull/11737
Fixes: b610a4db1c "url: enforce valid UTF-8 in WHATWG parser"
Refs: https://github.com/nodejs/node/commit/b610a4db1c2919f88711962f5797f25ecb1cd36b#commitcomment-21200056
Refs: https://tc39.github.io/ecma262/#sec-addition-operator-plus-runtime-semantics-evaluation
Refs: https://tc39.github.io/ecma262/#sec-template-literals-runtime-semantics-evaluation
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-10 20:02:24 -08:00
Timothy Gu
455e6f1dd8
util: throw toJSON errors when formatting %j
...
Previously all errors resulting from JSON.stringify were treated as a
proof for circularity of the object structure. That is not the case if
the `toJSON` method of the object throws an error. Explicitly check for
the exact error message when determining the object structure's
cyclicity.
PR-URL: https://github.com/nodejs/node/pull/11708
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-10 18:22:57 -08:00
Timothy Gu
e2f151f5b2
src: make process.env work with symbols in/delete
...
The getter for process.env already allows symbols to be used, and `in`
operator as a read-only operator can do the same.
`delete a[b]` operator in ES always returns `true` without doing
anything when `b in a === false`. Allow symbols in the deleter
accordingly.
PR-URL: https://github.com/nodejs/node/pull/11709
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-09 16:36:12 -08:00
Timothy Gu
3f27f02da0
repl: docs-only deprecation of magic mode
...
The workaround used in repl to support `let` and `const` in non-strict
mode (known as "magic" mode) has been unnecessary since V8 v4.9 /
Node.js v6.0.0. This commit doc-deprecate magic mode (which is now
entirely equivalent to sloppy mode) in both `repl` module and in
`internal/repl`, which is responsible for starting the REPL in `node`
interactive mode.
PR-URL: https://github.com/nodejs/node/pull/11599
Refs: https://v8project.blogspot.com/2016/01/v8-release-49.html
Refs: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md#6.0.0
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
2017-03-06 19:23:34 -08:00
Timothy Gu
b77c89022b
repl: remove magic mode semantics
...
The workaround used in repl to support `let` and `const` in non-strict
mode (known as "magic" mode) has been unnecessary since V8 v4.9 /
Node.js v6.0.0. This commit functionally removes this workaround.
PR-URL: https://github.com/nodejs/node/pull/11599
Refs: https://v8project.blogspot.com/2016/01/v8-release-49.html
Refs: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md#6.0.0
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
2017-03-06 19:22:23 -08:00
Timothy Gu
6123ed5b25
benchmark: add USVString conversion benchmark
...
PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-28 18:39:24 -08:00
Timothy Gu
b610a4db1c
url: enforce valid UTF-8 in WHATWG parser
...
This commit implements the Web IDL USVString conversion, which mandates
all unpaired Unicode surrogates be turned into U+FFFD REPLACEMENT
CHARACTER. It also disallows Symbols to be used as USVString per spec.
Certain functions call into C++ methods in the binding that use the
Utf8Value class to access string arguments. Utf8Value already does the
normalization using V8's String::Write, so in those cases, instead of
doing the full USVString normalization, only a symbol check is done
(`'' + val`, which uses ES's ToString, versus `String()` which has
special provisions for symbols).
PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-28 18:39:20 -08:00
Timothy Gu
a7f7724167
src: remove misleading flag in TwoByteValue
...
String::REPLACE_INVALID_UTF8 is only applied in V8's
String::WriteUtf8() (i.e. Utf8Value).
PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-28 18:39:17 -08:00
Timothy Gu
a218fa381f
test: fix WPT.test()'s error handling
...
Changing err.message after the construction of Error doesn't seem to
change err.stack.
PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-28 18:39:09 -08:00
Timothy Gu
7ceea2a6a1
doc: document WHATWG IDNA methods' error handling
...
PR-URL: https://github.com/nodejs/node/pull/11549
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-28 18:32:01 -08:00
Timothy Gu
6c213978b7
test: more comprehensive IDNA test cases
...
- Split the tests out to a separate file
- Add invalid cases
- Add tests for url.domainTo*()
- Re-enable previously broken WPT URL parsing tests
PR-URL: https://github.com/nodejs/node/pull/11549
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-28 18:32:01 -08:00
Timothy Gu
c2a302c50b
src: do not ignore IDNA conversion error
...
Old behavior can be restored using a special `lenient` mode, as used in
the legacy URL parser.
PR-URL: https://github.com/nodejs/node/pull/11549
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-28 18:32:01 -08:00
Timothy Gu
d4e1eaf43c
benchmark: add url.domainTo*()
...
PR-URL: https://github.com/nodejs/node/pull/11464
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-24 17:49:46 -08:00
Timothy Gu
2cb5555f25
src, i18n: cleanup usage of MaybeStackBuffer
...
- Templatize AsBuffer() and create a generic version for inclusion in
the Buffer class
- Use MaybeStackBuffer::storage()
- If possible, avoid double conversion in ToASCII()/ToUnicode()
- More descriptive assertion error in tests
PR-URL: https://github.com/nodejs/node/pull/11464
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-24 17:49:41 -08:00
Timothy Gu
e7a3add531
src: clean up MaybeStackBuffer
...
- Add IsInvalidated() method
- Add capacity() method for finding out the actual capacity, not the
current size, of the buffer
- Make IsAllocated() work for invalidated buffers
- Allow multiple calls to AllocateSufficientStorage() and Invalidate()
- Assert buffer is malloc'd in Release()
- Assert buffer has not been invalidated in AllocateSufficientStorage()
- Add more descriptive comments describing the purpose of the methods
- Add cctest for MaybeStackBuffer
PR-URL: https://github.com/nodejs/node/pull/11464
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-24 17:49:41 -08:00
Timothy Gu
ff8bac23f1
src: don't assume v8::Local is using-declared
...
PR-URL: https://github.com/nodejs/node/pull/11464
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-24 17:49:12 -08:00
Timothy Gu
fa41dd117d
url: fix handling of ? in URLSearchParams creation
...
PR-URL: https://github.com/nodejs/node/pull/11372
Fixes: https://github.com/nodejs/node/issues/11093
Ref: https://github.com/whatwg/url/issues/248
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-16 21:12:23 -08:00
Timothy Gu
bd07c8fc12
doc/url: various improvements to WHATWG API
...
Also remove executable bit from doc/api/url.md's mode.
PR-URL: https://github.com/nodejs/node/pull/11330
Fixes: 4757ddcce1 "doc: add basic documentation for WHATWG URL API"
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-15 21:54:03 -08:00
Timothy Gu
6cea5dd39f
tools/doc: add more intrinsic and custom types
...
PR-URL: https://github.com/nodejs/node/pull/11330
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-15 21:33:47 -08:00
Timothy Gu
c6b12d0984
url: fix surrogate handling in encodeAuth()
...
Also factor out common parts in querystring and url.
PR-URL: https://github.com/nodejs/node/pull/11161
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-02-14 12:13:11 -08:00
Timothy Gu
781eb90960
benchmark: add url/url-searchparams-sort.js
...
PR-URL: https://github.com/nodejs/node/pull/11098
Fixes: https://github.com/nodejs/node/issues/10760
Ref: https://github.com/whatwg/url/issues/26
Ref: https://github.com/whatwg/url/pull/199
Ref: https://github.com/w3c/web-platform-tests/pull/4531
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-13 20:49:13 -08:00
Timothy Gu
02d1e32fe3
url: add urlSearchParams.sort()
...
PR-URL: https://github.com/nodejs/node/pull/11098
Fixes: https://github.com/nodejs/node/issues/10760
Ref: https://github.com/whatwg/url/issues/26
Ref: https://github.com/whatwg/url/pull/199
Ref: https://github.com/w3c/web-platform-tests/pull/4531
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-13 20:48:58 -08:00
Timothy Gu
0792d452e8
url: fix setting url.search to the empty string
...
PR-URL: https://github.com/nodejs/node/pull/11105
Fixes: https://github.com/nodejs/node/issues/11101
Fixes: 98bb65f641 "url: improving URLSearchParams"
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-02-03 12:29:07 -08:00
Timothy Gu
590626ba11
benchmark: simplify URLSearchParams import
...
PR-URL: https://github.com/nodejs/node/pull/11111
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Italo A. Casas <me@italoacasas.com >
2017-02-03 12:23:30 -08:00
Timothy Gu
c7e1be8991
src: remove usage of V8 deprecated API in node_url.cc
...
Also:
- Avoid using 'override' as variable name
- Use explicit static_cast instead of C-style cast
PR-URL: https://github.com/nodejs/node/pull/11066
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-01-31 23:55:38 -08:00
Timothy Gu
c505b8109e
doc: document URLSearchParams constructor
...
PR-URL: https://github.com/nodejs/node/pull/11060
Ref: https://github.com/whatwg/url/pull/175
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-31 23:51:07 -08:00
Timothy Gu
29f758731f
tools: add MDN link for Iterable
...
PR-URL: https://github.com/nodejs/node/pull/11060
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-31 23:51:07 -08:00
Timothy Gu
cc48f21c83
url: extend URLSearchParams constructor
...
PR-URL: https://github.com/nodejs/node/pull/11060
Fixes: https://github.com/nodejs/node/issues/10635
Ref: https://github.com/whatwg/url/pull/175
Ref: https://github.com/w3c/web-platform-tests/pull/4523
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-31 23:51:06 -08:00
Timothy Gu
90c2ac7be3
url: make URLSearchParams/Iterator match spec
...
PR-URL: https://github.com/nodejs/node/pull/11057
Fixes: https://github.com/nodejs/node/issues/10799
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-31 09:29:42 -08:00
Timothy Gu
06ecf4dec7
url: define @@toStringTag as a data property
...
Even though this is not fully Web IDL spec-compliant, it is arguably the
best we can do. Following the spec would mean non-trivial performance
deterioration (10% when parsing a medium-length URL), while the current
getter behavior is not adopted by any implementer, and it causes some
spec ambiguity when the getter is called with !(this instanceof URL).
This commit adopts Chrome's behavior, and is consistent with
ECMAScript-defined classes while providing reasonable behaviors for
corner cases as well. Until the Web IDL spec is changed one way or
another, this is the way to go.
PR-URL: https://github.com/nodejs/node/pull/10906
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-28 08:27:15 -08:00
Timothy Gu
d65904bc6a
url: do not public expose inspect methods on URL
...
PR-URL: https://github.com/nodejs/node/pull/10906
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-01-28 08:27:09 -08:00
Timothy Gu
e71c278288
url: stop exporting originFor()
...
PR-URL: https://github.com/nodejs/node/pull/10955
Fixes: https://github.com/nodejs/node/issues/10800
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-01-27 07:35:36 -08:00
Timothy Gu
ed0086fb46
url: check forEach callback is a function
...
The Web IDL spec mandates such a check.
Also make error messages consistent with rest of Node.js and add
additional tests for forEach().
PR-URL: https://github.com/nodejs/node/pull/10905
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-01-23 16:24:33 -08:00
Timothy Gu
09ebdf1400
doc: add TimothyGu to collaborators
...
PR-URL: https://github.com/nodejs/node/pull/10954
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-22 13:36:49 -08:00
Timothy Gu
326e967c6b
url: export URLSearchParams
...
Fixes : #10761
2017-01-22 11:27:58 +01:00
Timothy Gu
98bb65f641
url: improving URLSearchParams
...
- add some benchmarks for URLSearchParams
- change URLSearchParams backing store to an array
- add custom inspection for URLSearchParams and its iterators
PR-URL: https://github.com/nodejs/node/pull/10399
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-19 11:33:37 -08:00
Timothy Gu
61d6293033
url: improve URLSearchParams spec compliance
...
- Make URLSearchParams constructor spec-compliant
- Strip leading `?` in URL#search's setter
- Spec-compliant iterable interface
- More precise handling of update steps as mandated by the spec
- Add class strings to URLSearchParams objects and their prototype
- Make sure `this instanceof URLSearchParams` in methods
Also included are relevant tests from W3C's Web Platform Tests
(https://github.com/w3c/web-platform-tests/tree/master/url ).
Fixes: https://github.com/nodejs/node/issues/9302
PR-URL: https://github.com/nodejs/node/pull/9484
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-12-07 12:19:23 -05:00
Timothy Gu
4d55d1611d
doc: wrap long lines in http.request
...
PR-URL: https://github.com/nodejs/node/pull/9584
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-11-15 23:05:51 +01:00
Timothy Gu
20dc1fac63
doc: fix type of http.request's agent option
...
PR-URL: https://github.com/nodejs/node/pull/9584
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-11-15 23:05:23 +01:00
Timothy Gu
52c7f9d221
doc: revise http documentation
...
PR-URL: https://github.com/nodejs/node/pull/8486
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-10-11 09:54:39 -07:00
Timothy Gu
a7fa72156a
doc/json: make sure links are correctly passed to marked
...
Previously, an attempt was made to make sure the links state is
inherited. Unfortunately, this support was not complete, which
results in various unresolved links in the JSON output (as an
example, [1] contains `initialized by calling
[<code>buf.fill(fill, encoding)</code>][<code>buf.fill()</code>]`).
This commit completes that attempt. After this commit, individual
instances of the parser (for descriptions) inherit the links state
from the root lexer, so that individual Markdown links in descriptions
could be resolved. That same example is now substituted with
`initialized by calling <a href=\"#buffer_buf_fill_value_offset_end_encoding\"><code>buf.fill(fill, encoding)</code></a>`.
[1]: https://nodejs.org/api/buffer.json
PR-URL: https://github.com/nodejs/node/pull/8494
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-09-16 17:29:05 +02:00
Timothy Gu
e1ddcb7219
doc: standardize rest parameters
...
PR-URL: https://github.com/nodejs/node/pull/8485
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-09-14 08:08:28 +02:00
Timothy Gu
1896ca9e8e
doc: fill in missing V8 version
...
PR-URL: https://github.com/nodejs/node/pull/7878
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-07-29 09:17:20 -07:00
Timothy Gu
ac0d92e4d1
doc: fix link in cluster documentation
...
PR-URL: https://github.com/nodejs/node/pull/5068
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-04 10:00:10 -08:00
Timothy Gu
aeb2eb7783
tools: fix detecting constructor for JSON doc
...
Regex previous was not detecting cases like AssertionError as
a class name.
PR-URL: https://github.com/nodejs/node/pull/4966
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chris Dickinson <chris@neversaw.us >
2016-02-01 08:30:43 -08:00
Timothy Gu
6ad1f7b51c
doc: make buffer methods styles consistent
...
- Maintain alphabetical order
- Add documentation for `offset` and `value` where absent
- Add return value documentation where absent
- Remove redundant "Optional"
- Move defaults to parameter enumerations
PR-URL: https://github.com/nodejs/node/pull/4873
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-01-30 11:22:11 -08:00
Timothy Gu
27c8b73fa6
doc: fix JSON generation for aliased methods
...
Currently assert/assert.ok currently has the following signature:
"signatures": [
{
"params": [
{
"name": "value"
},
{
"name": "message])"
},
{
"name": "assert.ok(value"
},
{
"name": "message",
"optional": true
}
]
}
]
The heading reads
assert(value[, message]), assert.ok(value[, message])
Split them into two sections to make it working.
PR-URL: https://github.com/nodejs/node/pull/4871
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
2016-01-30 11:06:25 -08:00
Timothy Gu
ab45390e01
tools: add property types in JSON documentation
...
PR-URL: https://github.com/nodejs/node/pull/4884
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-01-30 11:01:37 -08:00
Timothy Gu
81503e597b
doc: fix typo in changelog
...
PR-URL: https://github.com/nodejs/node/pull/3353
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
2015-10-14 13:35:26 +11:00