Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: src/harmony-classes.js

Issue 808723002: Make sure FunctionToMethod is lazily compiled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-classes.js
diff --git a/src/harmony-classes.js b/src/harmony-classes.js
index 31c62611ef525cc26353dd56b5b8075f135fd939..ac0675862eacf581136d743163e74b3d67ea2b01 100644
--- a/src/harmony-classes.js
+++ b/src/harmony-classes.js
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698