| Index: include/v8.h
|
| diff --git a/include/v8.h b/include/v8.h
|
| index 703a4f4f4ad575cc230e60ceaf38aa1f05121a13..e0c45fb36e20fb519f6e5a8ba33b44b971ac36da 100644
|
| --- a/include/v8.h
|
| +++ b/include/v8.h
|
| @@ -3241,6 +3241,7 @@ class PropertyCallbackInfo {
|
|
|
| typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info);
|
|
|
| +enum class ConstructorBehavior { kThrow, kAllow };
|
|
|
| /**
|
| * A JavaScript function object (ECMA-262, 15.3).
|
| @@ -3255,6 +3256,11 @@ class V8_EXPORT Function : public Object {
|
| FunctionCallback callback,
|
| Local<Value> data = Local<Value>(),
|
| int length = 0);
|
| + static MaybeLocal<Function> New(Local<Context> context,
|
| + FunctionCallback callback,
|
| + Local<Value> data,
|
| + int length,
|
| + ConstructorBehavior behavior);
|
| static V8_DEPRECATE_SOON(
|
| "Use maybe version",
|
| Local<Function> New(Isolate* isolate, FunctionCallback callback,
|
| @@ -4478,6 +4484,9 @@ class V8_EXPORT FunctionTemplate : public Template {
|
| Isolate* isolate, FunctionCallback callback = 0,
|
| Local<Value> data = Local<Value>(),
|
| Local<Signature> signature = Local<Signature>(), int length = 0);
|
| + static Local<FunctionTemplate> New(
|
| + Isolate* isolate, FunctionCallback callback, Local<Value> data,
|
| + Local<Signature> signature, int length, ConstructorBehavior behavior);
|
|
|
| /**
|
| * Creates a function template with a fast handler. If a fast handler is set,
|
|
|