Index: test/mjsunit/string-fromcharcode.js |
diff --git a/test/mjsunit/string-fromcharcode.js b/test/mjsunit/string-fromcharcode.js |
index 1986dda0fb8e3539759564dedb892018bb4a611f..c23bd8ceb1c1edd6064f2eeb990d6b93782799b0 100644 |
--- a/test/mjsunit/string-fromcharcode.js |
+++ b/test/mjsunit/string-fromcharcode.js |
@@ -25,8 +25,28 @@ |
// (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 |
+ |
// Test String.fromCharCode. |
+// Test char codes larger than 0xffff. |
+var expected = ""; |
+for (var i = 100; i < 500; i++) { |
+ expected += String.fromCharCode(i); |
+} |
+ |
+function testCharCodeTruncation() { |
+ var result = ""; |
+ for (var i = 0x100000 + 100; i < 0x100000 + 500; i++) { |
+ result += String.fromCharCode(i); |
+ } |
+ return result; |
+} |
+ |
+assertEquals(expected, testCharCodeTruncation()); |
+assertEquals(expected, testCharCodeTruncation()); |
+%OptimizeFunctionOnNextCall(testCharCodeTruncation); |
+assertEquals(expected, testCharCodeTruncation()); |
// Test various receivers and arguments passed to String.fromCharCode. |