v8/test/mjsunit/function-bind-name.js
arv 6d32be24fc [es6] Bound function name
Instead of updating the SharedFuntionInfo set the name property on
the function directly.

BUG=v8:4278
LOG=N
R=verwaest@chromium.org, littledan@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#29558}
2015-07-09 20:36:20 +00:00

17 lines
449 B
JavaScript

// Copyright 2015 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.
function f() {}
var fb = f.bind({});
assertEquals('bound f', fb.name);
Object.defineProperty(f, 'name', {value: 42});
var fb2 = f.bind({});
assertEquals('bound ', fb2.name);
function g() {}
var gb = g.bind({});
assertEquals('bound g', gb.name);
assertEquals('bound f', fb.name);