Commit 52e487d7 authored by dslomov's avatar dslomov Committed by Commit bot

Make sure FunctionToMethod is lazily compiled.

R=arv@chromium.org
BUG=v8:3330
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25847}
parent d5e6462d
......@@ -9,26 +9,27 @@
"use strict";
function FunctionToMethod(homeObject) {
if (!IS_SPEC_FUNCTION(this)) {
throw MakeTypeError('toMethod_non_function',
[%ToString(this), typeof this]);
(function() {
function FunctionToMethod(homeObject) {
if (!IS_SPEC_FUNCTION(this)) {
throw MakeTypeError('toMethod_non_function',
[%ToString(this), typeof this]);
}
if (!IS_SPEC_OBJECT(homeObject)) {
throw MakeTypeError('toMethod_non_object',
[%ToString(homeObject)]);
}
}
return %ToMethod(this, homeObject);
if (!IS_SPEC_OBJECT(homeObject)) {
throw MakeTypeError('toMethod_non_object',
[%ToString(homeObject)]);
}
return %ToMethod(this, homeObject);
}
function SetupHarmonyClasses() {
%CheckIsBootstrapping();
InstallFunctions($Function.prototype, DONT_ENUM, $Array(
"toMethod", FunctionToMethod
));
}());
}
SetupHarmonyClasses();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment