@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Javascript busy loop when trying to delete tokens from an empty tokenizer

Summary:
Fixes T13147. In D19437, I changed this logic to support deleting the `""` (empty string) token, but `[].pop()` returns `undefined`, not `null`, if the list is empty and I didn't think to try deleting an empty input.

Fix the logic so we don't end up in a loop if the input is empty.

Test Plan:
- In any browser, deleted all tokens in a tokenizer; then pressed delete again.
- Before: tab hangs in an infinte loop.
- After: smooth sailing.

Reviewers: amckinley, avivey

Reviewed By: avivey

Maniphest Tasks: T13147

Differential Revision: https://secure.phabricator.com/D19456

+11 -10
+9 -9
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'e68cf1fa', 11 11 'conpherence.pkg.js' => '15191c65', 12 12 'core.pkg.css' => '8be474cc', 13 - 'core.pkg.js' => 'e452721e', 13 + 'core.pkg.js' => '2058ec09', 14 14 'differential.pkg.css' => '06dc617c', 15 15 'differential.pkg.js' => 'c2ca903a', 16 16 'diffusion.pkg.css' => 'a2d17c7d', ··· 259 259 'rsrc/externals/javelin/lib/__tests__/URI.js' => '1e45fda9', 260 260 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783', 261 261 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', 262 - 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'dfaf006b', 262 + 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'bb6e5c16', 263 263 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '70baed2f', 264 264 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '185bbd53', 265 265 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', ··· 710 710 'javelin-scrollbar' => '9065f639', 711 711 'javelin-sound' => '949c0fe5', 712 712 'javelin-stratcom' => '327f418a', 713 - 'javelin-tokenizer' => 'dfaf006b', 713 + 'javelin-tokenizer' => 'bb6e5c16', 714 714 'javelin-typeahead' => '70baed2f', 715 715 'javelin-typeahead-composite-source' => '503e17fd', 716 716 'javelin-typeahead-normalizer' => '185bbd53', ··· 1842 1842 'javelin-uri', 1843 1843 'phabricator-notification', 1844 1844 ), 1845 + 'bb6e5c16' => array( 1846 + 'javelin-dom', 1847 + 'javelin-util', 1848 + 'javelin-stratcom', 1849 + 'javelin-install', 1850 + ), 1845 1851 'bcaccd64' => array( 1846 1852 'javelin-behavior', 1847 1853 'javelin-behavior-device', ··· 2018 2024 'javelin-dom', 2019 2025 'phuix-icon-view', 2020 2026 'phabricator-prefab', 2021 - ), 2022 - 'dfaf006b' => array( 2023 - 'javelin-dom', 2024 - 'javelin-util', 2025 - 'javelin-stratcom', 2026 - 'javelin-install', 2027 2027 ), 2028 2028 'e1d25dfb' => array( 2029 2029 'javelin-behavior',
+2 -1
webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
··· 400 400 // this unusual token. 401 401 402 402 var tok; 403 - while ((tok = this._tokens.pop()) !== null) { 403 + while (this._tokens.length) { 404 + tok = this._tokens.pop(); 404 405 if (this._remove(tok, true)) { 405 406 break; 406 407 }