diff --git a/classlib/src/main/resources/org/teavm/classlib/java/lang/ref/ReferenceQueue.js b/classlib/src/main/resources/org/teavm/classlib/java/lang/ref/ReferenceQueue.js index 11aeeabc4..4574ad2b9 100644 --- a/classlib/src/main/resources/org/teavm/classlib/java/lang/ref/ReferenceQueue.js +++ b/classlib/src/main/resources/org/teavm/classlib/java/lang/ref/ReferenceQueue.js @@ -28,6 +28,6 @@ function init() { } function poll() { - var value = this[teavm_javaField("java.lang.ref.ReferenceQueue", "inner")]; + var value = this[teavm_javaField("java.lang.ref.ReferenceQueue", "inner")].shift(); return typeof value !== 'undefined' ? value : null; } \ No newline at end of file