00:22:46  <Bakkot>Is there a reason RegExp.prototype.source isn't completely nailed down?
00:29:49  * bradleymeckquit (Quit: bradleymeck)
01:10:49  * Fishrock123quit (Quit: Leaving...)
01:16:48  * jmdyck1joined
01:16:53  * jmdyckquit (Ping timeout: 268 seconds)
01:44:34  <dilijev>Is there a formalization of the language in https://tc39.github.io/ecma402/#sec-datetime-format-functions -> https://tc39.github.io/ecma402/#sec-formatdatetime step 1 -> https://tc39.github.io/ecma402/#sec-partitiondatetimepattern
01:44:38  <dilijev>"not a finite number"
01:44:51  <dilijev>a la https://github.com/Microsoft/ChakraCore/pull/4507#discussion_r160301755
01:45:31  <dilijev>such that: `x` is "not a finite number" implies `[Infinity, -Infinity, NaN].includes(x) === true` ?
01:46:11  <dilijev>a casual reading seems to suggest this, and the implementations seem to agree
01:46:54  <dilijev>but -- i could also see this being just `[Infinity, -Infinity].includes(x)` depending on how "number" is defined here.
01:47:38  <dilijev>(to wit: NaN is of "number" type: `typeof NaN === 'number'`)
01:47:45  <dilijev>^ but is not infinite.
01:49:18  <Bakkot>I don't think I could see a reading where "NaN is not a finite number" holds; "is not one of the values Infinity, -Infinity" does not mean "is a finite number"
01:49:43  <Bakkot>iirc IEEE suggests a definition for `finite` which is `x => -Infinity < x && x < Infinity`?
01:52:37  <dilijev>i guess first question is: does this phrasing need to be made more clear in the spec?
01:55:35  * jwaldenquit (Ping timeout: 240 seconds)
01:56:33  <Bakkot>ah: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type
01:57:12  <dilijev>i.e. "The other 18437736874454810624 (that is, 264-253) values are called the finite numbers."
01:57:45  <dilijev>"The Number type has exactly 18437736874454810627 (that is, 264-253+3) values"
01:57:55  <dilijev>and the other 3 are [Infinity, -Infinity, NaN]
01:58:14  <dilijev>so basically "not a finite number" should maybe refer to this section for clarification?
01:58:24  <dilijev>@jackhorton ^
01:59:34  <bterlson>dilijev: finite number could be made into a dfn
02:03:36  <dilijev>^ bterlson SGTM
02:08:26  * jwaldenjoined
02:10:22  <dilijev>Bakkot: just to be clear that link implies (to me) that "NaN is not a finite number"
02:11:33  <Bakkot>dilijev: right, agreed; I had one extra negative earlier
02:12:03  <dilijev>i.e. a hypothetical spec definition IsFiniteNumber(x) could be defined as `(x) => ![Infinity, -Infinity, NaN].includes(x)`
02:15:33  <dilijev>and https://tc39.github.io/ecma402/#sec-partitiondatetimepattern step 1 could be written as `If IsFiniteNumber(x) is false, throw a RangeError exception`
02:18:20  * AtumTquit (Remote host closed the connection)
02:33:39  * bradleymeckjoined
02:36:44  * d_runquit (Read error: Connection reset by peer)
02:37:01  * d_runjoined
04:54:36  * jwaldenquit (Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805])
04:59:39  * jmdyck1quit (Remote host closed the connection)
05:48:35  <ljharb>Bakkot: in what way isn't it nailed down?
05:49:06  <ljharb>Bakkot: (ftr, if it's not nailed down then we should nail it down hard)
06:20:57  * bradleymeckquit (Quit: bradleymeck)
06:56:19  * gibson042quit (Quit: Leaving.)
07:25:44  * gskachkovjoined
07:55:42  <Bakkot>ljharb: it depends on EscapeRegExpPattern, the first step of which is "pick any string which, when parsed, would result in an a functionally identical regex", which leaves a lot of escaping decisions up in the air
07:56:39  <ljharb>hm
07:57:04  <ljharb>how would we be able to lock that down
07:57:06  <Bakkot>and in fact engines vary substantially here; for example, `new RegExp('[/]').source` gives '[/]' in JSC and SpiderMonkey and '[\/]' in V8 and ChakraCore
07:57:13  <ljharb>hm
07:57:27  <ljharb>what do they do for unicode escapes?
07:57:55  <Bakkot>Leaves them as they were, I think.
08:00:36  <ljharb>it sounds like the spec could choose to always show the `/u` form tho, or always show the character?
08:00:45  <ljharb>or rather the spec allows the impl to choose
08:01:28  <Bakkot>my reading of the spec is that it currently allows implementations to choose; that's part of my complaint.
08:01:48  <ljharb>gotcha
08:01:53  <ljharb>so how would you suggest that be specified?
08:02:04  <Bakkot>spec is at https://tc39.github.io/ecma262/#sec-escaperegexppattern, for reference.
08:02:06  <ljharb>minimal necessary escapes? maximal escapes? something else?
08:02:13  <Bakkot>I would actually prefer it normalize, because then tools like prettier could format regexes
08:02:35  <ljharb>normalize to what tho
08:02:45  <Bakkot>Don't really care, tbh
08:03:13  <Bakkot>but the easiest thing by far would be to specify the minimal necessary things to escape from [[OriginalSource]], which I think is just newlines and '/'s which are not inside of character classes
08:03:38  <Bakkot>+ that would better match existing engine behavior
08:03:41  <ljharb>so that wouldn't normalize, it'd just aim for a minimal diff to the original source
08:03:45  <Bakkot>right.
08:03:55  <ljharb>seems reasonable, whether as an only or a first step
08:04:07  <ljharb>normalizing of character escapes could come later if we wanted, or not
08:06:40  <Bakkot>my guess is that the reason this is unspecified is to allow engines to store a normalized form, but at a glance I don't think anyone actually is, at least not w.r.t. unicode.
08:07:15  <ljharb>what would be the downside of requiring they store a normalized form
08:07:45  <Bakkot>/shrug
08:30:39  * gskachkov_joined
08:33:21  * gskachkovquit (Ping timeout: 264 seconds)
08:33:21  * gskachkov_changed nick to gskachkov
08:40:40  * gskachkovquit (Quit: gskachkov)
08:43:23  * gskachkovjoined
08:48:47  * gskachkovquit (Quit: gskachkov)
08:54:23  * gskachkovjoined
09:00:53  * gskachkovquit (Quit: gskachkov)
09:04:03  * gskachkovjoined
09:21:24  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
09:28:58  * gskachkovquit (Quit: gskachkov)
09:30:19  * gskachkovjoined
09:34:37  * gskachkovquit (Ping timeout: 252 seconds)
09:35:04  * gskachkovjoined
09:38:01  * AtumTjoined
09:57:31  * gskachkovquit (Ping timeout: 240 seconds)
10:29:40  <littledan>Bakkot: I was wondering about that too! V8 is the only engine that doesn't match the others, and this is already a spec violation
10:30:43  <littledan>there's a couple cases, e.g., line terminators are escaped as \r \n \u2028 \u2029
10:31:21  <littledan>mathias and I have discussed this issue; it's been on my todo list for a while and never got aorund to it
10:32:10  <littledan>this would be a good beginner project for someone to write up the spec and test262 tests!
10:32:44  <littledan>I didn't know about the [/] case; that is interesting
10:33:10  <littledan>(negates that first line)
11:25:11  * mylesborinsquit (Quit: farewell for now)
11:25:41  * mylesborinsjoined
12:20:11  * H|f|shquit (Quit: WeeChat 1.0.1)
12:48:58  * jmdyckjoined
13:03:09  * gibson042joined
13:03:23  * gibson042quit (Client Quit)
13:09:10  * AtumT_joined
13:10:23  * AtumTquit (Ping timeout: 248 seconds)
13:22:10  * AtumTjoined
13:22:52  * AtumT_quit (Ping timeout: 252 seconds)
14:22:45  * gibson042joined
14:25:40  * gibson042part
14:31:45  * gibson042joined
14:32:50  * bradleymeckjoined
14:35:27  * bradleymeckquit (Client Quit)
14:50:08  * gibson042quit (Ping timeout: 248 seconds)
15:05:31  * gibson042joined
15:09:53  * gibson042quit (Ping timeout: 248 seconds)
15:24:55  * gibson042joined
15:31:21  * bradleymeckjoined
15:44:41  * gibson042quit (Ping timeout: 255 seconds)
15:57:57  * gibson042joined
16:02:46  * gibson042quit (Ping timeout: 256 seconds)
16:18:30  * gibson042joined
16:23:23  * gibson042quit (Ping timeout: 268 seconds)
16:37:06  * gibson042joined
16:37:10  * jwaldenjoined
16:52:47  * bradleymeckquit (Quit: bradleymeck)
16:54:29  * jackhortonjoined
16:59:26  * bradleymeckjoined
17:02:55  * gibson042quit (Ping timeout: 248 seconds)
17:07:30  * jwaldenquit (Ping timeout: 255 seconds)
17:12:58  * Fishrock123joined
17:13:23  * bradleymeckquit (Quit: bradleymeck)
17:43:58  * bradleymeckjoined
17:44:39  * fabiorochajoined
17:56:22  * jwaldenjoined
18:01:28  * gibson042joined
18:02:25  * tkorequit (Read error: Connection reset by peer)
18:19:11  * gibson042quit (Ping timeout: 276 seconds)
18:36:49  * gibson042joined
19:23:57  * Fishrock123quit (Remote host closed the connection)
19:42:09  <dilijev>recently had some fun with regexes with embedded null bytes
19:42:29  <dilijev>makes me think a normalization should explicitly escape unprintable charactersz
19:42:52  <dilijev>^ \u or \x escape that is
19:49:24  <Bakkot>null bytes can legally occur in source text, pretty sure
19:52:06  * rektidejoined
19:52:21  <jmdyck>"All Unicode code point values from U+0000 to U+10FFFF, including surrogate code points, may occur in source text where permitted by the ECMAScript grammars."
19:57:12  <Domenic>I've found bugs in Intl APIs with null bytes before
19:57:21  <Domenic>Where they truncated the string (due to conversion through C-style strings)
20:44:32  * jmdyck1joined
20:44:41  * jmdyckquit (Ping timeout: 252 seconds)
20:54:37  * FR_RBjoined
20:55:05  * FR_RBquit (Client Quit)
20:58:27  * fabiorochaquit (Ping timeout: 240 seconds)
21:02:21  * gibson042quit (Ping timeout: 265 seconds)
21:11:12  * Fishrock123joined
21:11:13  * bradleymeckquit (Quit: bradleymeck)
21:12:18  * gibson042joined
21:16:30  * bradleymeckjoined
21:30:51  * gibson042quit (Quit: Leaving.)
21:49:16  * gskachkovjoined
22:33:25  <TabAtkins>Stage 0, I guess, proposal for a seeded random function for JS: https://github.com/tabatkins/js-seeded-random/ Critique welcome!
22:38:08  <Domenic>Looks nice!
22:42:13  <Domenic>ljharb: I remember hearing from you that one of the es-shims overrides F.p.toString() to prevent detection. But I can't find that code while browsing. Any hints?
22:45:31  * jmdyck1quit (Ping timeout: 252 seconds)
22:45:58  * jmdyckjoined
22:47:00  * Fishrock123quit (Remote host closed the connection)
22:50:07  * Fishrock123joined
22:56:04  * Fishrock123quit (Quit: Leaving...)