Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88148


Change subject: HACK to restore es6 performance.
......................................................................

HACK to restore es6 performance.

Change-Id: Iac6ecc7ae2f7c0de266f7a5db04afcfadad6b7e7
---
M js/lib/jsutils.js
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/48/88148/1

diff --git a/js/lib/jsutils.js b/js/lib/jsutils.js
index 888c272..6f818d8 100644
--- a/js/lib/jsutils.js
+++ b/js/lib/jsutils.js
@@ -9,11 +9,18 @@
        // This should probably be taken care of by the Set constructor
        // but doesn't seem to be implemented correctly anywhere.
        arrayToSet: function(a) {
+               /*
                var s = new es6.Set();
                for (var i = 0, n = a.length; i < n; i++) {
                        s.add(a[i]);
                }
                return s;
+               */
+               var s = Object.create(null);
+               a.forEach(function(item) { s['$'+item] = true; });
+               return {
+                       has: function(item) { return !!s['$'+item]; }
+               };
        },
 
        mapObject: function(h) {

-- 
To view, visit https://gerrit.wikimedia.org/r/88148
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac6ecc7ae2f7c0de266f7a5db04afcfadad6b7e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to