summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/testAddStringObject.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/jaeger/testAddStringObject.js')
-rw-r--r--js/src/jit-test/tests/jaeger/testAddStringObject.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/testAddStringObject.js b/js/src/jit-test/tests/jaeger/testAddStringObject.js
new file mode 100644
index 0000000000..0ed0288e6c
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/testAddStringObject.js
@@ -0,0 +1,17 @@
+String.prototype.m = function(s) {
+ return this.indexOf('a');
+};
+
+var g = function(s) {
+ return (s + 'asdf').m();
+};
+
+var h = function(s) {
+ return ('asdf' + s).m();
+};
+
+var ix = g(new String('abc'));
+assertEq(ix, 0);
+
+var ix = h(new String('abc'));
+assertEq(ix, 0);