Fix broken testResultsInvalidation test on Chrome

We needed more actions to actually get sent over the RPC.
This commit is contained in:
Scott Kyle 2016-04-28 16:36:07 -07:00 committed by Ari Lazier
parent 85919dc66f
commit 950b75fd2f
1 changed files with 8 additions and 4 deletions

View File

@ -54,7 +54,7 @@ export function fireMutationListeners(realmId) {
export function createCollection(prototype, realmId, info, mutable) {
let collection = Object.create(prototype);
let size = 0;
let size;
Object.defineProperties(collection, {
'length': {
@ -70,7 +70,10 @@ export function createCollection(prototype, realmId, info, mutable) {
length = collection.length;
}
if (length == size) {
return;
return; // Nothing has changed.
}
if (size == null) {
size = 0; // This is first pass.
}
let props = {};
@ -79,7 +82,7 @@ export function createCollection(prototype, realmId, info, mutable) {
for (let i = size; i < length; i++) {
props[i] = {
get: getterForProperty(i),
set: mutable ? setterForProperty(i) : undefined,
set: setterForProperty(i),
enumerable: true,
configurable: true,
};
@ -93,7 +96,8 @@ export function createCollection(prototype, realmId, info, mutable) {
// Helpfully throw an exception on attempts to set to one past the last index.
props[length] = {
value: undefined,
get: getterForProperty(length),
set: setterForProperty(length),
configurable: true,
};