Add GetConstantValue, fix const-variable ES2 loop bounds

Prior to this fix, the new test cases would report that the various loop
terms needed to be constant expressions.

Bug: skia:12472
Change-Id: Ic377ed0c4598136ae38fb2b65c93b6d8609d54cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452276
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
7 files changed