Merge remote-tracking branch 'dthorpe/master'
This commit is contained in:
commit
7074618049
14
src/eckey.cc
14
src/eckey.cc
|
@ -160,12 +160,17 @@ Key::New()
|
||||||
Handle<Value>
|
Handle<Value>
|
||||||
Key::New(const Arguments& args)
|
Key::New(const Arguments& args)
|
||||||
{
|
{
|
||||||
if (!args.IsConstructCall()) {
|
|
||||||
return FromConstructorTemplate(s_ct, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
|
// this was invoked as Key() not new Key()
|
||||||
|
if (!args.IsConstructCall()) {
|
||||||
|
// return FromConstructorTemplate(s_ct, args);
|
||||||
|
|
||||||
|
const int argc = 1;
|
||||||
|
Local<Value> argv[argc] = { args[0] };
|
||||||
|
return scope.Close(s_ct->GetFunction()->NewInstance(argc, argv));
|
||||||
|
}
|
||||||
|
else{
|
||||||
Key* key = new Key();
|
Key* key = new Key();
|
||||||
if (key->lastError != NULL) {
|
if (key->lastError != NULL) {
|
||||||
return VException(key->lastError);
|
return VException(key->lastError);
|
||||||
|
@ -175,6 +180,7 @@ Key::New(const Arguments& args)
|
||||||
|
|
||||||
return scope.Close(args.This());
|
return scope.Close(args.This());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Handle<Value>
|
Handle<Value>
|
||||||
Key::GenerateSync(const Arguments& args)
|
Key::GenerateSync(const Arguments& args)
|
||||||
|
|
Loading…
Reference in New Issue