diff --git a/src/lib/libhtml5.js b/src/lib/libhtml5.js
index 2950343811dea..f8088f2c13b06 100644
--- a/src/lib/libhtml5.js
+++ b/src/lib/libhtml5.js
@@ -102,7 +102,7 @@ var LibraryHTML5 = {
argsList
});
- JSEvents.deferredCalls.sort((x,y) => x.precedence < y.precedence);
+ JSEvents.deferredCalls.sort((x,y) => x.precedence - y.precedence);
},
// Erases all deferred calls to the given target function from the queue list.