Index: test/mjsunit/regress/regress-is-contextual.js |
diff --git a/test/mjsunit/regress/regress-264203.js b/test/mjsunit/regress/regress-is-contextual.js |
similarity index 83% |
copy from test/mjsunit/regress/regress-264203.js |
copy to test/mjsunit/regress/regress-is-contextual.js |
index fa0075662575d85241b6af82c5945cca32938991..844f4a226497773d2baddada8779414ee15c080c 100644 |
--- a/test/mjsunit/regress/regress-264203.js |
+++ b/test/mjsunit/regress/regress-is-contextual.js |
@@ -25,20 +25,17 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
- |
-function foo(x) { |
- var a = [1, 2, 3, 4, 5, 6, 7, 8]; |
- a[x + 5]; |
- var result; |
- for (var i = 0; i < 3; i++) { |
- result = a[0 - x]; |
- } |
- return result; |
+// CallIC accumulates feedback that string index is out of bounds, then |
+// misses |
+function foo(index) { |
+ return text.charAt(index); |
} |
+var text = "hi there"; |
foo(0); |
foo(0); |
-%OptimizeFunctionOnNextCall(foo); |
-var r = foo(-2); |
-assertEquals(3, r); |
+foo(100); // Accumulate feedback that index is out of bounds. |
+text = false; |
+ |
+// This line ASSERTS in debug without fix. |
+assertThrows(function () { foo(); }, TypeError); |