1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/regexp-exec.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,20 @@ 1.4 +// RegExp.exec -> RegExp.test optimization should use the builtin test method. 1.5 +function f() { 1.6 + var res = 0; 1.7 + for (var i=0; i<100; i++) { 1.8 + if (/a/.exec("a")) 1.9 + res++; 1.10 + } 1.11 + assertEq(res, 100); 1.12 +} 1.13 +delete RegExp.prototype.test; 1.14 +gc(); 1.15 +f(); 1.16 + 1.17 +RegExp.prototype.test = function() { assertEq(0, 1); } 1.18 +gc(); 1.19 +f(); 1.20 + 1.21 +Object.defineProperty(RegExp.prototype, "test", {get: function() { assertEq(0, 1); }}); 1.22 +gc(); 1.23 +f();