summaryrefslogtreecommitdiff
path: root/src/deno.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-22 14:57:49 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-22 23:42:04 +0200
commit1330553be1097bc1101c82e03cf8aaab414af9b1 (patch)
tree5d399a1b0fc9cc6f577b88a4379486ac99a1b39d /src/deno.cc
parent9315adb8c58099f892a8c44e489a62b4e56e376d (diff)
Add onerror test to mock_runtime_test.cc
Diffstat (limited to 'src/deno.cc')
-rw-r--r--src/deno.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/deno.cc b/src/deno.cc
index 0ebdf380c..90d14f631 100644
--- a/src/deno.cc
+++ b/src/deno.cc
@@ -57,11 +57,14 @@ void HandleException(v8::Local<v8::Context> context,
if (onerror->IsFunction()) {
auto func = v8::Local<v8::Function>::Cast(onerror);
v8::Local<v8::Value> args[5];
- auto origin = message->GetScriptOrigin();
+ auto line =
+ v8::Integer::New(isolate, message->GetLineNumber(context).FromJust());
+ auto column =
+ v8::Integer::New(isolate, message->GetStartColumn(context).FromJust());
args[0] = exception->ToString();
args[1] = message->GetScriptResourceName();
- args[2] = origin.ResourceLineOffset();
- args[3] = origin.ResourceColumnOffset();
+ args[2] = line;
+ args[3] = column;
args[4] = exception;
func->Call(context->Global(), 5, args);
/* message, source, lineno, colno, error */