1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/strict/primitive-this-no-writeback.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,20 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 + 1.6 +/* 1.7 + * Any copyright is dedicated to the Public Domain. 1.8 + * http://creativecommons.org/licenses/publicdomain/ 1.9 + */ 1.10 + 1.11 +/* Verify that GETTHISPROP does not update the frame's |this| slot. */ 1.12 + 1.13 +var f = String.prototype.m = function () { 1.14 + "use strict"; 1.15 + assertEq(this, "s"); 1.16 + // The GETTHISPROP should not cause |this| to become wrapped. 1.17 + return [this.m, this]; 1.18 +}; 1.19 +var a = "s".m(); 1.20 +assertEq(a[0], f); 1.21 +assertEq(a[1], "s"); 1.22 + 1.23 +reportCompare(true, true);