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

Unified Diff: src/harmony-classes.js

Issue 785303002: Function#toMethod: check `newHome` before `this` (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updated as per Erik’s feedback 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 | test/mjsunit/harmony/toMethod.js » ('j') | 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 b6605a902c3059bef54ad3b0956931fcaf19e1d3..9171bb368308b0e87d07c91020a2e34f86be9938 100644
--- a/src/harmony-classes.js
+++ b/src/harmony-classes.js
@@ -9,18 +9,18 @@
(function() {
+ // ES6 draft 12-06-13, section 19.2.3.5.
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)]);
}
+ if (!IS_SPEC_FUNCTION(this)) {
+ throw MakeTypeError('toMethod_non_function',
+ [%ToString(this), typeof this]);
+ }
+
return %ToMethod(this, homeObject);
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/toMethod.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698