// 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.
//
// This file relies on the fact that the following declarations have been made
// in runtime.js:
// var $Function = global.Function;
// var $Array = global.Array;

"use strict";


(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);
  }

  %CheckIsBootstrapping();

  InstallFunctions($Function.prototype, DONT_ENUM, $Array(
      "toMethod", FunctionToMethod
  ));
}());

@@ -346,25 +346,8 @@
 %22;%0A%0A
-%0A(function() %7B%0A  
 func
@@ -384,18 +384,16 @@
 ct) %7B%0A  
- 
- 
 if (!IS_
@@ -411,26 +411,24 @@
 ON(this)) %7B%0A
-  
     throw Ma
@@ -464,18 +464,16 @@
 ction',%0A
-  
         
@@ -522,25 +522,21 @@
 his%5D);%0A%0A
-  
   %7D%0A%0A
-  
   if (!I
@@ -568,18 +568,16 @@
 ) %7B%0A    
-  
 throw Ma
@@ -627,34 +627,32 @@
                 
-  
 %5B%25ToString(homeO
@@ -665,17 +665,13 @@
 %5D);%0A
-  
   %7D%0A%0A
-  
   re
@@ -704,20 +704,51 @@
 bject);%0A
-  
 %7D%0A
+%0Afunction SetupHarmonyClasses() %7B
 %0A  %25Chec
@@ -869,13 +869,33 @@
 %0A  ));%0A%7D
+%0A%0ASetupHarmonyClasses
 (
-)
 );%0A

Make sure FunctionToMethod is lazily compiled.