Skip to content

Instantly share code, notes, and snippets.

@evanlucas
evanlucas / noexit.js
Created October 23, 2015 20:12
noexit.js
process.on('uncaughtException', function(err) {
throw err
})
process.on('exit', function() {
console.log('exit')
})
throw new Error('fdsaf')
/usr/bin/python tools/gyp_node.py -f make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/dev/io.js/out'
g++ -I../deps/gtest -I../deps/gtest/include -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/ubuntu/dev/io.js/out/Release/.deps//home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o.d.raw -c -o /home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o ../deps/gtest/src/gtest-death-test.cc
g++ -I../deps/gtest -I../deps/gtest/include -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/ubuntu/dev/io.js/out/Release/.deps//home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o.d.raw -c -o /home/ubuntu/de
start
Process 10116 stopped
* thread #1: tid = 0x680998, 0x00000001006ac2e6 node`node::ProcessWrap::ParseStdioOptions(node::Environment*, v8::Local<v8::Object>, uv_process_options_s*) [inlined] node::Environment::isolate_data(this=0x0000000101803000) const at env-inl.h:374, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
frame #0: 0x00000001006ac2e6 node`node::ProcessWrap::ParseStdioOptions(node::Environment*, v8::Local<v8::Object>, uv_process_options_s*) [inlined] node::Environment::isolate_data(this=0x0000000101803000) const at env-inl.h:374
371 }
372
373 inline Environment::IsolateData* Environment::isolate_data() const {
-> 374 return isolate_data_;
375 }
376
Process 10089 launched: './out/Release/node' (x86_64)
start
Process 10089 stopped
* thread #1: tid = 0x679c0f, 0x000000010015e4ff node`v8::Value::IntegerValue(this=<unavailable>, context=<unavailable>) const + 415 at api.cc:3272, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x000000010015e4ff node`v8::Value::IntegerValue(this=<unavailable>, context=<unavailable>) const + 415 at api.cc:3272
3269 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(int64_t);
3270 }
3271 return Just(num->IsSmi() ? static_cast<int64_t>(i::Smi::cast(*num)->value())
-> 3272 : static_cast<int64_t>(num->Number()));
3273 }
@evanlucas
evanlucas / gist:4738a8848ffa1e94f358
Created September 7, 2015 21:04
Runtime_NumberToInteger
node`v8::internal::Runtime_NumberToInteger:
node[0x100551f20] <+0>: pushq %rbp
node[0x100551f21] <+1>: movq %rsp, %rbp
node[0x100551f24] <+4>: pushq %r15
node[0x100551f26] <+6>: pushq %r14
node[0x100551f28] <+8>: pushq %r12
node[0x100551f2a] <+10>: pushq %rbx
node[0x100551f2b] <+11>: movq %rdx, %rbx
node[0x100551f2e] <+14>: movq 0x6b78(%rbx), %r15
node[0x100551f35] <+21>: movq 0x6b80(%rbx), %r14
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js
index 6d1c22d..6155f9a 100644
--- a/lib/internal/child_process.js
+++ b/lib/internal/child_process.js
@@ -271,6 +271,10 @@ ChildProcess.prototype.spawn = function(options) {
this.spawnfile = options.file;
this.spawnargs = options.args;
+ console.log(require('util').inspect(options, {
+ colors: true,
[~/dev/code/forks/WORK-io.js]
:] ➜ $ node -pe "require('internal/repl')" (master)
{ createInternalRepl: [Function: createRepl] }
[~/dev/code/forks/WORK-io.js]
:] ➜ $ node (master)
> require('internal/repl')
{ createInternalRepl: [Function: createRepl] }
> ⏎
@evanlucas
evanlucas / highlights-line-numbering.css
Created June 2, 2015 22:55
atom highlights with line numbering
.editor {
counter-reset: linenumber;
font-size: 16px;
font-family: Monaco;
}
.editor > .line {
counter-increment: linenumber;
}
@evanlucas
evanlucas / gist:16fc21c141841e0724c3
Last active August 29, 2015 14:22
allow node -ie
commit 09e46c3d48d9c81daa68e4dc69a249fa80b3287f
Author: Evan Lucas <[email protected]>
Date: Mon Jun 1 10:17:19 2015 -0500
allow -ie
diff --git a/src/node.js b/src/node.js
index 2516478..d370ce0 100644
--- a/src/node.js
+++ b/src/node.js
=== release test-tls-js-stream ===
Path: parallel/test-tls-js-stream
write <Buffer 16 03 01 01 1f 01 00 01 1b 03 03 b2 79 cc 72 e8 cd 31 64 6a ce 14 51 9f 8a 14 a4 82 29 d3 76 40 07 aa 04 8b f2 75 2a ea cc 9f d8 00 00 80 c0 2f c0 2b ... > buffer
read <Buffer 16 03 03 00 41 02 00 00 3d 03 03 a9 72 9f 08 f7 1c 9f 14 05 25 87 cc 7c cf 2a 8a 68 f9 22 bf 8a ed 5d fc 51 1d ea a1 e8 22 96 1f 00 c0 2f 00 00 15 ff ... >
write <Buffer 16 03 03 00 46 10 00 00 42 41 04 cc 49 3c d1 ba 44 e9 6c 75 28 1f 07 60 8e a0 7c 25 be 23 b4 06 91 64 c4 a5 48 85 5e dc dc dd ab a7 ac ce f5 fb e3 3d ... > buffer
new client
read <Buffer 16 03 03 00 ca 04 00 00 c6 00 00 01 2c 00 c0 5c f9 32 37 d5 40 3d 6d 3e 9a 46 e9 ff d3 1a 2a 34 72 f8 ae ed 4f 47 17 3c 43 69 4d 49 21 70 f3 08 12 38 ... >
client secure
write <Buffer 17 03 03 00 1d 2c 99 57 1d 54 b9 aa d4 29 4c 4c 87 fc 49 7f 01 0a bf 66 fa 78 0d d9 e5 6b 8a ce d6 38> buffer
write <Buffer 15 03 03 00 1a 2c 99 57 1d 54 b9 aa d5 46 df 82 0d 15 e