Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/debug.h

Issue 29425555: Issue 5201 - [emscripten] Replace EM_ASM calls by a custom JavaScript library (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Moved all declarations into a single header and corrected emscripten.h includes Created April 30, 2017, 3:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/debug.h
===================================================================
--- a/compiled/debug.h
+++ b/compiled/debug.h
@@ -12,45 +12,46 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
-#include <emscripten.h>
#include <emscripten/trace.h>
sergei 2017/05/02 09:48:06 should it be also wrapped by `#ifdef __EMSCRIPTEN_
+#include "library.h"
+
#if defined(assert)
#undef assert
#endif
class String;
struct console_type
{
static void log(const String& str)
{
- EM_ASM_ARGS(console.log(readString($0)), &str);
+ LogString(str);
}
static void log(int i)
{
- EM_ASM_ARGS(console.log($0), i);
+ LogInteger(i);
}
- static void log(void* ptr)
+ static void log(const void* ptr)
{
- EM_ASM_ARGS(console.log($0), ptr);
+ LogPointer(ptr);
}
static void error(const String& str)
{
- EM_ASM_ARGS(console.error(new Error(readString($0)).stack), &str);
+ LogError(str);
}
};
static console_type console;
#if defined(DEBUG)
inline void assert(bool condition, const String& str)
{

Powered by Google App Engine
This is Rietveld