bug: Unicode character causes v8 timeout.
Created by: egriff38
I was trying to create a new operator using the nabla (∇) character, and the compiler timed out:
$ sjs operators.js
<--- Last few GCs --->
[69027:0x102802000] 89813 ms: Mark-sweep 1400.3 (1460.0) -> 1400.3 (1460.0) MB, 745.5 / 0.0 ms allocation failure GC in old space requested
[69027:0x102802000] 90595 ms: Mark-sweep 1400.3 (1460.0) -> 1400.2 (1430.0) MB, 782.0 / 0.0 ms last resort gc
[69027:0x102802000] 91459 ms: Mark-sweep 1400.2 (1430.0) -> 1400.2 (1430.0) MB, 864.0 / 0.0 ms last resort gc
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0xfa41bcc0d39 <JS Object>
1: readToken [/usr/local/lib/node_modules/@sweet-js/cli/node_modules/sweet-core/dist/reader/token-reader.js:~75] [pc=0xeea59659f36](this=0x24757670b1b1 <a Reader with map 0x258b8f83ad89>,/* anonymous */=0x24757670b149 <a CharStream with map 0x258b8f83ab21>)
2: arguments adaptor frame: 3->1
3: readUntil [/usr/local/lib/node_modules/@sweet-js/cli/node_modules/sweet-core/dist/reader/tok...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/local/bin/node]
2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
6: 0xeea593063a7
[1] 69027 abort sjs operators.js
Here was the code I was trying to use:
operator ∇ left 1 = (left,right) => {
return #`${right}(${left})`;
}