From 1578d2fda9b00616b12e7592a6dede87c2f8bf0a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 23 Jul 2015 15:00:42 +0800 Subject: [PATCH] Allow the C++ JS binding function to accept arbitrary long arguments --- atom/browser/api/atom_api_dialog.cc | 11 +++-------- atom/browser/api/lib/dialog.coffee | 4 +++- vendor/native_mate | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/atom/browser/api/atom_api_dialog.cc b/atom/browser/api/atom_api_dialog.cc index 695c11e3..47021407 100644 --- a/atom/browser/api/atom_api_dialog.cc +++ b/atom/browser/api/atom_api_dialog.cc @@ -43,17 +43,12 @@ void ShowMessageBox(int type, const std::vector& buttons, int cancel_id, int options, - const std::vector& texts, + const std::string& title, + const std::string& message, + const std::string& detail, const gfx::ImageSkia& icon, atom::NativeWindow* window, mate::Arguments* args) { - // FIXME We are exceeding the parameters limit of base::Bind here, so we have - // to pass some parameters in an array. We should remove this once we have - // variadic template support in base::Bind. - const std::string& title = texts[0]; - const std::string& message = texts[1]; - const std::string& detail = texts[2]; - v8::Local peek = args->PeekNext(); atom::MessageBoxCallback callback; if (mate::Converter::FromV8(args->isolate(), diff --git a/atom/browser/api/lib/dialog.coffee b/atom/browser/api/lib/dialog.coffee index 35ef6240..a1dcaafe 100644 --- a/atom/browser/api/lib/dialog.coffee +++ b/atom/browser/api/lib/dialog.coffee @@ -105,7 +105,9 @@ module.exports = options.buttons, options.cancelId, 0, - [options.title, options.message, options.detail], + options.title, + options.message, + options.detail, options.icon, window, callback diff --git a/vendor/native_mate b/vendor/native_mate index 41cd6d13..656e403f 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit 41cd6d13c9c9be164f427864277f3cc36b69eb39 +Subproject commit 656e403f0102c59428261c1eaad22912d2bbd3c5 -- 2.43.0