OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 auto jsValues = jsEngine->TakeJsValues(weakCallback); | 123 auto jsValues = jsEngine->TakeJsValues(weakCallback); |
124 if (!error.empty()) | 124 if (!error.empty()) |
125 { | 125 { |
126 jsValues[1].Call(jsEngine->NewValue(error)); | 126 jsValues[1].Call(jsEngine->NewValue(error)); |
127 return; | 127 return; |
128 } | 128 } |
129 | 129 |
130 auto processFunc = jsValues[0].UnwrapValue().As<v8::Function>(); | 130 auto processFunc = jsValues[0].UnwrapValue().As<v8::Function>(); |
131 | 131 |
132 auto globalContext = context.GetV8Context()->Global(); | 132 auto globalContext = context.GetJSEngineContext()->Global(); |
133 if (!globalContext->IsObject()) | 133 if (!globalContext->IsObject()) |
134 throw std::runtime_error("`this` pointer has to be an object"); | 134 throw std::runtime_error("`this` pointer has to be an object"); |
135 | 135 |
136 const v8::TryCatch tryCatch; | 136 const v8::TryCatch tryCatch; |
137 | 137 |
138 const auto contentEnd = content.cend(); | 138 const auto contentEnd = content.cend(); |
139 auto stringBegin = SkipEndOfLine(content.begin(), contentEnd); | 139 auto stringBegin = SkipEndOfLine(content.begin(), contentEnd); |
140 do | 140 do |
141 { | 141 { |
142 auto stringEnd = AdvanceToEndOfLine(stringBegin, contentEnd); | 142 auto stringEnd = AdvanceToEndOfLine(stringBegin, contentEnd); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 JsValue& FileSystemJsObject::Setup(JsEngine& jsEngine, JsValue& obj) | 308 JsValue& FileSystemJsObject::Setup(JsEngine& jsEngine, JsValue& obj) |
309 { | 309 { |
310 obj.SetProperty("read", jsEngine.NewCallback(::ReadCallback)); | 310 obj.SetProperty("read", jsEngine.NewCallback(::ReadCallback)); |
311 obj.SetProperty("readFromFile", jsEngine.NewCallback(::ReadFromFileCallback)); | 311 obj.SetProperty("readFromFile", jsEngine.NewCallback(::ReadFromFileCallback)); |
312 obj.SetProperty("write", jsEngine.NewCallback(::WriteCallback)); | 312 obj.SetProperty("write", jsEngine.NewCallback(::WriteCallback)); |
313 obj.SetProperty("move", jsEngine.NewCallback(::MoveCallback)); | 313 obj.SetProperty("move", jsEngine.NewCallback(::MoveCallback)); |
314 obj.SetProperty("remove", jsEngine.NewCallback(::RemoveCallback)); | 314 obj.SetProperty("remove", jsEngine.NewCallback(::RemoveCallback)); |
315 obj.SetProperty("stat", jsEngine.NewCallback(::StatCallback)); | 315 obj.SetProperty("stat", jsEngine.NewCallback(::StatCallback)); |
316 return obj; | 316 return obj; |
317 } | 317 } |
OLD | NEW |