| Index: test/mjsunit/regress/regress-2980.js
|
| diff --git a/src/harmony-math.js b/test/mjsunit/regress/regress-2980.js
|
| similarity index 68%
|
| copy from src/harmony-math.js
|
| copy to test/mjsunit/regress/regress-2980.js
|
| index a4d3f2e8a5e9c5936630571644605402dee1199d..071a73353a79aec11091cc97c117710d2fb36414 100644
|
| --- a/src/harmony-math.js
|
| +++ b/test/mjsunit/regress/regress-2980.js
|
| @@ -25,36 +25,40 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -'use strict';
|
| -
|
| -// ES6 draft 09-27-13, section 20.2.2.28.
|
| -function MathSign(x) {
|
| - x = TO_NUMBER_INLINE(x);
|
| - if (x > 0) return 1;
|
| - if (x < 0) return -1;
|
| - if (x === 0) return x;
|
| - return NAN;
|
| -}
|
| -
|
|
|
| -// ES6 draft 09-27-13, section 20.2.2.34.
|
| -function MathTrunc(x) {
|
| - x = TO_NUMBER_INLINE(x);
|
| - if (x > 0) return MathFloor(x);
|
| - if (x < 0) return MathCeil(x);
|
| - if (x === 0) return x;
|
| - return NAN;
|
| +function test(expected, holder) {
|
| + assertEquals(expected, holder.property);
|
| }
|
|
|
| +var holder = {}
|
| +holder.__proto__ = null;
|
| +holder.property = "foo";
|
| +delete holder.property;
|
| +test(undefined, holder);
|
| +test(undefined, holder);
|
| +test(undefined, holder);
|
| +holder.property = "bar";
|
| +test("bar", holder);
|
| +test("bar", holder);
|
|
|
| -function ExtendMath() {
|
| - %CheckIsBootstrapping();
|
| +// Now the same thing with a nontrivial prototype chain.
|
|
|
| - // Set up the non-enumerable functions on the Math object.
|
| - InstallFunctions($Math, DONT_ENUM, $Array(
|
| - "sign", MathSign,
|
| - "trunc", MathTrunc
|
| - ));
|
| +function test2(expected, holder) {
|
| + assertEquals(expected, holder.prop2);
|
| }
|
|
|
| -ExtendMath();
|
| +var holder2 = {}
|
| +holder2.prop2 = "foo";
|
| +holder2.__proto__ = null;
|
| +function Receiver() {}
|
| +Receiver.prototype = holder2;
|
| +
|
| +var rec2 = new Receiver();
|
| +delete holder2.prop2;
|
| +
|
| +test2(undefined, rec2);
|
| +test2(undefined, rec2);
|
| +test2(undefined, rec2);
|
| +holder2.prop2 = "bar";
|
| +test2("bar", rec2);
|
| +test2("bar", rec2);
|
|
|