summaryrefslogtreecommitdiff
path: root/deno2/deno.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-11 22:51:11 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-11 22:51:11 +0200
commit356fd18c7385f99766fe1e8d843ec85712bbaf76 (patch)
treeb7b7d58d45f0f5c52e63a9b933fa174f78aaf639 /deno2/deno.cc
parentf89f576f6da6738617ac30f57b3c832a293434f5 (diff)
Calling denoSub twice should fail.
Diffstat (limited to 'deno2/deno.cc')
-rw-r--r--deno2/deno.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/deno2/deno.cc b/deno2/deno.cc
index 67b74bd63..26222d3b8 100644
--- a/deno2/deno.cc
+++ b/deno2/deno.cc
@@ -117,6 +117,11 @@ void Sub(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::HandleScope handle_scope(isolate);
+ if (!d->sub.IsEmpty()) {
+ isolate->ThrowException(v8_str("denoSub already called."));
+ return;
+ }
+
v8::Local<v8::Value> v = args[0];
assert(v->IsFunction());
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(v);