From 950b75fd2f0cb07460ab8ea50044cf9813a1af96 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 28 Apr 2016 16:36:07 -0700 Subject: [PATCH] Fix broken testResultsInvalidation test on Chrome We needed more actions to actually get sent over the RPC. --- lib/browser/collections.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/browser/collections.js b/lib/browser/collections.js index a35dd465..b6091fa2 100644 --- a/lib/browser/collections.js +++ b/lib/browser/collections.js @@ -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, };