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

Unified Diff: src/object-observe.js

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. Created 5 years, 3 months 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 | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index 0f1f6d37fbadab8acd1b12968fed89e70a93f62c..be4c24e21badc65c2b6dd3a880659f4e5afa6cf5 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -178,12 +178,12 @@ function ObserverCreate(callback, acceptList) {
function ObserverGetCallback(observer) {
- return IS_SPEC_FUNCTION(observer) ? observer : observer.callback;
+ return IS_CALLABLE(observer) ? observer : observer.callback;
}
function ObserverGetAcceptTypes(observer) {
- return IS_SPEC_FUNCTION(observer) ? defaultAcceptTypes : observer.accept;
+ return IS_CALLABLE(observer) ? defaultAcceptTypes : observer.accept;
}
@@ -238,8 +238,8 @@ function ObjectInfoGetNotifier(objectInfo) {
function ChangeObserversIsOptimized(changeObservers) {
- return IS_SPEC_FUNCTION(changeObservers) ||
- IS_SPEC_FUNCTION(changeObservers.callback);
+ return IS_CALLABLE(changeObservers) ||
+ IS_CALLABLE(changeObservers.callback);
}
@@ -388,7 +388,7 @@ function ObjectObserve(object, callback, acceptList) {
throw MakeTypeError(kObserveNonObject, "observe", "observe");
if (%IsJSGlobalProxy(object))
throw MakeTypeError(kObserveGlobalProxy, "observe");
- if (!IS_SPEC_FUNCTION(callback))
+ if (!IS_CALLABLE(callback))
throw MakeTypeError(kObserveNonFunction, "observe");
if (ObjectIsFrozen(callback))
throw MakeTypeError(kObserveCallbackFrozen);
@@ -411,7 +411,7 @@ function ObjectUnobserve(object, callback) {
throw MakeTypeError(kObserveNonObject, "unobserve", "unobserve");
if (%IsJSGlobalProxy(object))
throw MakeTypeError(kObserveGlobalProxy, "unobserve");
- if (!IS_SPEC_FUNCTION(callback))
+ if (!IS_CALLABLE(callback))
throw MakeTypeError(kObserveNonFunction, "unobserve");
var objectInfo = ObjectInfoGet(object);
@@ -588,7 +588,7 @@ function ObjectNotifierPerformChange(changeType, changeFn) {
throw MakeTypeError(kObserveNotifyNonNotifier);
if (!IS_STRING(changeType))
throw MakeTypeError(kObservePerformNonString);
- if (!IS_SPEC_FUNCTION(changeFn))
+ if (!IS_CALLABLE(changeFn))
throw MakeTypeError(kObservePerformNonFunction);
var performChangeFn = %GetObjectContextNotifierPerformChange(objectInfo);
@@ -656,7 +656,7 @@ function CallbackDeliverPending(callback) {
function ObjectDeliverChangeRecords(callback) {
- if (!IS_SPEC_FUNCTION(callback))
+ if (!IS_CALLABLE(callback))
throw MakeTypeError(kObserveNonFunction, "deliverChangeRecords");
while (CallbackDeliverPending(callback)) {}
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698