From 111178a3553ca54a81c3c428d151d7b6126e4d1d Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Wed, 2 Aug 2017 10:43:54 -0700 Subject: [PATCH 1/2] adding remaining prototypal functions to Ix api surface this will make it much easier to augment these internal constructs --- src/core/Interactive/buffering.js | 10 +++++++--- src/core/enumerable.js | 4 +++- src/core/internal/dictionary.js | 2 +- src/core/internal/lookup.js | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/core/Interactive/buffering.js b/src/core/Interactive/buffering.js index e7b0ba3..cbc18f9 100644 --- a/src/core/Interactive/buffering.js +++ b/src/core/Interactive/buffering.js @@ -1,5 +1,5 @@ - var SharedBuffer = (function () { + var SharedBuffer = Ix.SharedBuffer = (function () { inherits(SharedBuffer, Enumerable); function SharedBuffer (source) { @@ -71,6 +71,8 @@ this.length = 0; } + Ix.RefCountList = RefCountList; + var RefCountListPrototype = RefCountList.prototype; RefCountListPrototype.clear = function () { this.list = {}; @@ -98,7 +100,7 @@ this.readerCount--; }; - var PublishedBuffer = (function () { + var PublishedBuffer = Ix.PublishedBuffer = (function () { inherits(PublishedBuffer, Enumerable); function PublishedBuffer(source) { @@ -222,6 +224,8 @@ this.length = 0; } + Ix.MaxRefCountList = MaxRefCountList; + var MaxRefCountListPrototype = MaxRefCountList.prototype; MaxRefCountListPrototype.done = noop; MaxRefCountListPrototype.push = function (item) { @@ -237,7 +241,7 @@ return this.list[i]; }; - var MemoizedBuffer = (function () { + var MemoizedBuffer = Ix.MemoizedBuffer = (function () { inherits(MemoizedBuffer, Enumerable); function MemoizedBuffer(source, buffer) { diff --git a/src/core/enumerable.js b/src/core/enumerable.js index 2fd38b3..8b60a47 100644 --- a/src/core/enumerable.js +++ b/src/core/enumerable.js @@ -1515,6 +1515,8 @@ this.next = next; } + Ix.EnumerableSorter = EnumerableSorter; + EnumerableSorter.prototype = { computeKeys: function (elements, count) { this.keys = new Array(count); @@ -1564,7 +1566,7 @@ } }; - var OrderedEnumerable = (function () { + var OrderedEnumerable = Ix.OrderedEnumerable = (function () { inherits(OrderedEnumerable, Enumerable); function OrderedEnumerable (source, keySelector, comparer, descending) { this.source = source; diff --git a/src/core/internal/dictionary.js b/src/core/internal/dictionary.js index cc2dee9..692a500 100644 --- a/src/core/internal/dictionary.js +++ b/src/core/internal/dictionary.js @@ -100,7 +100,7 @@ // Dictionary implementation - var Dictionary = function (capacity, comparer) { + var Dictionary = Ix.Internals.Dictionary = function (capacity, comparer) { if (capacity < 0) { throw new Error('out of range') } diff --git a/src/core/internal/lookup.js b/src/core/internal/lookup.js index ad0bd67..0b5a038 100644 --- a/src/core/internal/lookup.js +++ b/src/core/internal/lookup.js @@ -1,4 +1,4 @@ - var Lookup = (function () { + var Lookup = Ix.Internals.Lookup = (function () { function Lookup(map) { this.map = map; From 1a9eb1a3d23d1d3ac6e5b3c74797c882b25d4bb2 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Wed, 2 Aug 2017 11:00:43 -0700 Subject: [PATCH 2/2] fixing null ref issue with `Ix` in buffering constructs we only have access to `root` at this point. relocating all prototypal references (except for `OrderedEnumerable` to the internals namespace) --- src/core/Interactive/buffering.js | 10 +++++----- src/core/enumerable.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/Interactive/buffering.js b/src/core/Interactive/buffering.js index cbc18f9..9ad658e 100644 --- a/src/core/Interactive/buffering.js +++ b/src/core/Interactive/buffering.js @@ -1,5 +1,5 @@ - var SharedBuffer = Ix.SharedBuffer = (function () { + var SharedBuffer = root.Internals.SharedBuffer = (function () { inherits(SharedBuffer, Enumerable); function SharedBuffer (source) { @@ -71,7 +71,7 @@ this.length = 0; } - Ix.RefCountList = RefCountList; + root.Internals.RefCountList = RefCountList; var RefCountListPrototype = RefCountList.prototype; RefCountListPrototype.clear = function () { @@ -100,7 +100,7 @@ this.readerCount--; }; - var PublishedBuffer = Ix.PublishedBuffer = (function () { + var PublishedBuffer = root.Internals.PublishedBuffer = (function () { inherits(PublishedBuffer, Enumerable); function PublishedBuffer(source) { @@ -224,7 +224,7 @@ this.length = 0; } - Ix.MaxRefCountList = MaxRefCountList; + root.Internals.MaxRefCountList = MaxRefCountList; var MaxRefCountListPrototype = MaxRefCountList.prototype; MaxRefCountListPrototype.done = noop; @@ -241,7 +241,7 @@ return this.list[i]; }; - var MemoizedBuffer = Ix.MemoizedBuffer = (function () { + var MemoizedBuffer = root.Internals.MemoizedBuffer = (function () { inherits(MemoizedBuffer, Enumerable); function MemoizedBuffer(source, buffer) { diff --git a/src/core/enumerable.js b/src/core/enumerable.js index 8b60a47..bf349c5 100644 --- a/src/core/enumerable.js +++ b/src/core/enumerable.js @@ -1515,7 +1515,7 @@ this.next = next; } - Ix.EnumerableSorter = EnumerableSorter; + Ix.Internals.EnumerableSorter = EnumerableSorter; EnumerableSorter.prototype = { computeKeys: function (elements, count) {