| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 77d6bfd commit f6b10cf
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,10 +75,10 @@ class JSBindingsConnection : public AsyncWrap { | |||
| 75 | 75 | Isolate* isolate = env_->isolate(); | |
| 76 | 76 | HandleScope handle_scope(isolate); | |
| 77 | 77 | Context::Scope context_scope(env_->context()); | |
| 78 | - MaybeLocal<String> v8string = | ||
| 79 | - String::NewFromTwoByte(isolate, message.characters16(), | ||
| 80 | - NewStringType::kNormal, message.length()); | ||
| 81 | - Local<Value> argument = v8string.ToLocalChecked().As<Value>(); | ||
| 78 | + Local<Value> argument; | ||
| 79 | + if (!String::NewFromTwoByte(isolate, message.characters16(), | ||
| 80 | + NewStringType::kNormal, | ||
| 81 | + message.length()).ToLocal(&argument)) return; | ||
| 82 | 82 | connection_->OnMessage(argument); | |
| 83 | 83 | } | |
| 84 | 84 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + | ||
| 4 | + if (process.config.variables.arm_version === '7') { | ||
| 5 | + common.skip('Too slow for armv7 bots'); | ||
| 6 | + } | ||
| 7 | + | ||
| 8 | + // The process should not crash when the REPL receives the string, 'ss'. | ||
| 9 | + // Test for https://github.com/nodejs/node/issues/42407. | ||
| 10 | + | ||
| 11 | + const repl = require('repl'); | ||
| 12 | + | ||
| 13 | + const r = repl.start(); | ||
| 14 | + | ||
| 15 | + r.write('var buf = Buffer.from({length:200e6},(_,i) => i%256);\n'); | ||
| 16 | + r.write('var ss = buf.toString("binary");\n'); | ||
| 17 | + r.write('ss'); | ||
| 18 | + r.write('.'); | ||
| 19 | + | ||
| 20 | + r.close(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments