* the php implementation had fewer curlies compared to the
js implmenetation
* remove unused function name (could be replace get_class)
* Add testcase for declh
Change-Id: I8132604a659d7ddf98e1f73686b40ff0591229f3
The default for a module is desktop and all of these modules
at a glance look like they should be loaded on mobile as
well.
Bug: T324723
Change-Id: I606b75d6524692e4183cd71a991140976d04d23f
Enable popup extension for annotated math expressions. The popup shows a short summary of the formula and is generated via the Popup API introduced with I65fcbf25ac5818f6c649daf494c719921247e8f5. It is a follow up of Iefe98c1f0422dbf034e385b1a41a859d030a2cf4.
Bug: T208758
Change-Id: I8c45b7e441083c240bbf2e0217ec219df7dcc351
I compared with
6c6988c4f6/lib/astutil.js
and found two mistakes:
* Missing space at the end of the color regex.
* Not enough backslash escaping in the last regex.
Note how the code in lines #116 and #130 is now identical.
Change-Id: I13b75ad4a1e4da0766c0d73b8786b21865945697
Positive as well as negative tests. This patch intentionally doesn't
touch the implementation but simply documents how the code currently
behaves.
Change-Id: Ib670ad680087e520f4a99e932e5a2a9fd2d115de
Personally I find this easier to read. It allows to maintain a compact
list of input values with the expected output.
Change-Id: Ifeb532e2b94c674b512b3c40f101977939b83cd5
This apparently doesn't make that much of a difference, but should
still be worth it. Strings that don't start with a backslash can not
match anything. We can stop much earlier in this case.
Change-Id: I1efb8dc6807931a075f450c56f9bbd64980c879a
We fixed this in I47b6d5b but broke it again in Ie8d8106. Let's
finally add a test for this edge-case.
Change-Id: I9a43518f9edf0fab05e76bbb02a30fefd039b77d
It appears like these methods are called hundreds of thousands of
times. This is mostly because they are recursive. According to my
benchmarks the changes proposed in this patch make a big difference.
Some notes:
* I try to avoid stepping deeper into the recursion whenever possible,
i.e. do the recursion only when the current element is an array.
This is relevant because the function call overhead is surpsiringly
expensive in PHP.
* I tried to arrange the if-elseif-else branches in a way so that the
most minimal code is executed while the code is still readable.
Change-Id: Ie8d8106390cac441cb93adcd48a937ba312a2d91