v8/test/mjsunit/regress/regress-function-constructor-receiver.js
ishell babe50f083 Reland "[es6] Fix Function and GeneratorFunction built-ins subclassing."
Original issue's description:
> [es6] Fix Function and GeneratorFunction built-ins subclassing.
>
> BUG=v8:3101, v8:3330
> LOG=Y
>
> Committed: https://crrev.com/99e7f872d3d0a5fb799dcbafb05537cda491314a
> Cr-Commit-Position: refs/heads/master@{#31708}

The problem was in another CL, this is a clean reland with improved tests.

BUG=v8:3101, v8:3330
LOG=Y

Review URL: https://codereview.chromium.org/1415683007

Cr-Commit-Position: refs/heads/master@{#31756}
2015-11-03 16:42:43 +00:00

18 lines
502 B
JavaScript

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Return the raw CallSites array.
Error.prepareStackTrace = function (a,b) { return b; };
var threw = false;
try {
new Function({toString:0,valueOf:0});
} catch (e) {
threw = true;
// Ensure that the receiver during "new Function" is the undefined value.
assertEquals(undefined, e.stack[0].getThis());
}
assertTrue(threw);