| LEFT | RIGHT |
| 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-2017 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 case TypeCategory::INT64: | 222 case TypeCategory::INT64: |
| 223 return " var result = Runtime.makeBigInt(" + call_str + ", " + | 223 return " var result = Runtime.makeBigInt(" + call_str + ", " + |
| 224 "Runtime.getTempRet0(), " + | 224 "Runtime.getTempRet0(), " + |
| 225 "true);\n"; | 225 "true);\n"; |
| 226 case TypeCategory::DEPENDENT_STRING: | 226 case TypeCategory::DEPENDENT_STRING: |
| 227 { | 227 { |
| 228 std::string result; | 228 std::string result; |
| 229 result += " var string = createString();\n"; | 229 result += " var string = createString();\n"; |
| 230 result += " " + call_str + ";\n"; | 230 result += " " + call_str + ";\n"; |
| 231 result += " var result = readString(string);\n"; | 231 result += " var result = readString(string);\n"; |
| 232 // We don't call a destructor here because we know that dependent |
| 233 // strings don't need to clean up. |
| 232 return result; | 234 return result; |
| 233 } | 235 } |
| 234 case TypeCategory::OWNED_STRING: | 236 case TypeCategory::OWNED_STRING: |
| 235 { | 237 { |
| 236 std::string result; | 238 std::string result; |
| 237 result += " var string = createOwnedString();\n"; | 239 result += " var string = createOwnedString();\n"; |
| 238 result += " " + call_str + ";\n"; | 240 result += " " + call_str + ";\n"; |
| 239 result += " var result = readString(string);\n"; | 241 result += " var result = readString(string);\n"; |
| 240 result += " Module._DestroyString(string);\n"; | 242 result += " Module._DestroyString(string);\n"; |
| 241 return result; | 243 return result; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 478 |
| 477 void printBindings() | 479 void printBindings() |
| 478 { | 480 { |
| 479 bindings_internal::printHelpers(); | 481 bindings_internal::printHelpers(); |
| 480 | 482 |
| 481 for (const auto& cls : classes) | 483 for (const auto& cls : classes) |
| 482 bindings_internal::printClass(cls); | 484 bindings_internal::printClass(cls); |
| 483 for (const auto& cls : classes) | 485 for (const auto& cls : classes) |
| 484 bindings_internal::printClassMapping(cls); | 486 bindings_internal::printClassMapping(cls); |
| 485 } | 487 } |
| LEFT | RIGHT |