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

Unified Diff: src/js/v8natives.js

Issue 1909433003: Remove support for Object.observe (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 8 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/js/object-observe.js ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index 5185c620b30f636c64346baf827a5b6d95d23488..309ec2e0a576576fc0ba8f9799a7fcac6e878279 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -20,9 +20,6 @@ var MakeTypeError;
var MathAbs;
var NaN = %GetRootNaN();
var ObjectToString = utils.ImportNow("object_to_string");
-var ObserveBeginPerformSplice;
-var ObserveEndPerformSplice;
-var ObserveEnqueueSpliceRecord;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
@@ -30,9 +27,6 @@ utils.Import(function(from) {
MakeSyntaxError = from.MakeSyntaxError;
MakeTypeError = from.MakeTypeError;
MathAbs = from.MathAbs;
- ObserveBeginPerformSplice = from.ObserveBeginPerformSplice;
- ObserveEndPerformSplice = from.ObserveEndPerformSplice;
- ObserveEnqueueSpliceRecord = from.ObserveEnqueueSpliceRecord;
});
// ----------------------------------------------------------------------------
@@ -688,19 +682,11 @@ function DefineArrayProperty(obj, p, desc, should_throw) {
// Step 3 - Special handling for array index.
if (!IS_SYMBOL(p)) {
var index = TO_UINT32(p);
- var emit_splice = false;
if (TO_STRING(index) == p && index != 4294967295) {
var length = obj.length;
- if (index >= length && %IsObserved(obj)) {
- emit_splice = true;
- ObserveBeginPerformSplice(obj);
- }
-
var length_desc = GetOwnPropertyJS(obj, "length");
if ((index >= length && !length_desc.isWritable()) ||
!DefineObjectProperty(obj, p, desc, true)) {
- if (emit_splice)
- ObserveEndPerformSplice(obj);
if (should_throw) {
throw MakeTypeError(kDefineDisallowed, p);
} else {
@@ -710,10 +696,6 @@ function DefineArrayProperty(obj, p, desc, should_throw) {
if (index >= length) {
obj.length = index + 1;
}
- if (emit_splice) {
- ObserveEndPerformSplice(obj);
- ObserveEnqueueSpliceRecord(obj, length, [], index + 1 - length);
- }
return true;
}
}
@@ -764,15 +746,6 @@ function ObjectSetPrototypeOf(obj, proto) {
function ObjectDefineProperty(obj, p, attributes) {
// The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
- if (%IsObserved(obj)) {
- if (!IS_RECEIVER(obj)) {
- throw MakeTypeError(kCalledOnNonObject, "Object.defineProperty");
- }
- var name = TO_NAME(p);
- var desc = ToPropertyDescriptor(attributes);
- DefineOwnProperty(obj, name, desc, true);
- return obj;
- }
return %ObjectDefineProperty(obj, p, attributes);
}
@@ -781,21 +754,6 @@ function ObjectDefineProperty(obj, p, attributes) {
function ObjectDefineProperties(obj, properties) {
// The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
- if (%IsObserved(obj)) {
- if (!IS_RECEIVER(obj)) {
- throw MakeTypeError(kCalledOnNonObject, "Object.defineProperties");
- }
- var props = TO_OBJECT(properties);
- var names = %GetOwnPropertyKeys(props, PROPERTY_FILTER_ONLY_ENUMERABLE);
- var descriptors = new InternalArray();
- for (var i = 0; i < names.length; i++) {
- descriptors.push(ToPropertyDescriptor(props[names[i]]));
- }
- for (var i = 0; i < names.length; i++) {
- DefineOwnProperty(obj, names[i], descriptors[i], true);
- }
- return obj;
- }
return %ObjectDefineProperties(obj, properties);
}
@@ -860,8 +818,6 @@ utils.InstallFunctions(GlobalObject, DONT_ENUM, [
"setPrototypeOf", ObjectSetPrototypeOf,
// getOwnPropertySymbols is added in symbol.js.
// is is added in bootstrapper.cc.
- // deliverChangeRecords, getNotifier, observe and unobserve are added
- // in object-observe.js.
]);
« no previous file with comments | « src/js/object-observe.js ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698