From cc8d2b89037b3281e94c2d59cb2482c808035ed0 Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Fri, 28 Feb 2014 14:16:23 +0400 Subject: [PATCH] TCK passes some more tests --- .../src/main/resources/org/teavm/javascript/runtime.js | 2 +- .../test/java/org/teavm/html4j/test/KnockoutFXTest.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js index 7b879ab5d..d598cda72 100644 --- a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js +++ b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js @@ -21,7 +21,7 @@ $rt_compare = function(a, b) { return a > b ? 1 : a < b ? -1 : 0; } $rt_isInstance = function(obj, cls) { - return obj != null && $rt_isAssignable(obj.constructor, cls); + return obj != null && obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls); } $rt_isAssignable = function(from, to) { if (from === to) { diff --git a/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java b/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java index f5465bc85..e9a7fedfc 100644 --- a/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java +++ b/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java @@ -42,6 +42,7 @@ */ package org.teavm.html4j.test; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -166,7 +167,12 @@ public final class KnockoutFXTest extends KnockoutTCK implements Transfer { String url = call.composeURL(null); String data = urlMap.get(url); if (data != null) { - call.notifySuccess(data); + data = "[" + data + "]"; + try { + call.notifySuccess(toJSON(new ByteArrayInputStream(data.getBytes()))); + } catch (IOException e) { + call.notifyError(e); + } } else { call.notifyError(new IllegalStateException()); }