Enable passing null to dialog API.
This commit is contained in:
parent
83debe2e43
commit
d3cda97d50
2 changed files with 35 additions and 22 deletions
|
@ -134,4 +134,27 @@ class Window : public mate::EventEmitter,
|
|||
|
||||
} // namespace atom
|
||||
|
||||
|
||||
namespace mate {
|
||||
|
||||
template<>
|
||||
struct Converter<atom::NativeWindow*> {
|
||||
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
||||
atom::NativeWindow** out) {
|
||||
// null would be tranfered to NULL.
|
||||
if (val->IsNull()) {
|
||||
*out = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
atom::api::Window* window;
|
||||
if (!Converter<atom::api::Window*>::FromV8(isolate, val, &window))
|
||||
return false;
|
||||
*out = window->window();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mate
|
||||
|
||||
#endif // ATOM_BROWSER_API_ATOM_API_WINDOW_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue