arguments.cc 726 B

12345678910111213141516171819202122
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE.chromium file.
  4. #include "shell/common/gin_helper/arguments.h"
  5. namespace gin_helper {
  6. void Arguments::ThrowError() const {
  7. // Gin advances |next_| counter when conversion fails while we do not, so we
  8. // have to manually advance the counter here to make gin report error with the
  9. // correct index.
  10. const_cast<Arguments*>(this)->Skip();
  11. gin::Arguments::ThrowError();
  12. }
  13. void Arguments::ThrowError(base::StringPiece message) const {
  14. isolate()->ThrowException(
  15. v8::Exception::Error(gin::StringToV8(isolate(), message)));
  16. }
  17. } // namespace gin_helper