zen-observable
Advanced tools
Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "zen-observable", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"repository": "zenparsing/zen-observable", | ||
@@ -5,0 +5,0 @@ "description": "An Implementation of ES Observables", |
@@ -30,5 +30,11 @@ // === Symbol Support === | ||
function getSpecies(ctor) { | ||
let symbol = getSymbol("species"); | ||
return symbol ? ctor[symbol] : ctor; | ||
function getSpecies(obj) { | ||
let ctor = obj.constructor; | ||
if (ctor !== undefined) { | ||
ctor = ctor[getSymbol("species")]; | ||
if (ctor === null) { | ||
ctor = undefined; | ||
} | ||
} | ||
return ctor !== undefined ? ctor : Observable; | ||
} | ||
@@ -266,3 +272,3 @@ | ||
let C = getSpecies(this.constructor); | ||
let C = getSpecies(this); | ||
@@ -289,3 +295,3 @@ return new C(observer => this.subscribe({ | ||
let C = getSpecies(this.constructor); | ||
let C = getSpecies(this); | ||
@@ -312,3 +318,3 @@ return new C(observer => this.subscribe({ | ||
let C = getSpecies(this.constructor); | ||
let C = getSpecies(this); | ||
let hasSeed = arguments.length > 1; | ||
@@ -355,3 +361,3 @@ let hasValue = false; | ||
let C = getSpecies(this.constructor); | ||
let C = getSpecies(this); | ||
@@ -358,0 +364,0 @@ return new C(observer => { |
@@ -9,2 +9,3 @@ import { runTests } from "es-observable-tests"; | ||
import filterTests from "./filter.js"; | ||
import speciesTests from "./species.js"; | ||
@@ -17,3 +18,4 @@ runTests(Observable).then(() => { | ||
"filter": filterTests, | ||
"species": speciesTests, | ||
}); | ||
}); |
@@ -30,5 +30,11 @@ 'use strict'; (function(fn, name) { if (typeof exports !== 'undefined') fn(exports, module); else if (typeof self !== 'undefined') fn(name === '*' ? self : (name ? self[name] = {} : {})); })(function(exports, module) { // === Symbol Support === | ||
function getSpecies(ctor) { | ||
var symbol = getSymbol("species"); | ||
return symbol ? ctor[symbol] : ctor; | ||
function getSpecies(obj) { | ||
var ctor = obj.constructor; | ||
if (ctor !== undefined) { | ||
ctor = ctor[getSymbol("species")]; | ||
if (ctor === null) { | ||
ctor = undefined; | ||
} | ||
} | ||
return ctor !== undefined ? ctor : Observable; | ||
} | ||
@@ -266,3 +272,3 @@ | ||
var C = getSpecies(this.constructor); | ||
var C = getSpecies(this); | ||
@@ -289,3 +295,3 @@ return new C(function(observer) { return __this.subscribe({ | ||
var C = getSpecies(this.constructor); | ||
var C = getSpecies(this); | ||
@@ -312,3 +318,3 @@ return new C(function(observer) { return __this.subscribe({ | ||
var C = getSpecies(this.constructor); | ||
var C = getSpecies(this); | ||
var hasSeed = arguments.length > 1; | ||
@@ -355,3 +361,3 @@ var hasValue = false; | ||
var C = getSpecies(this.constructor); | ||
var C = getSpecies(this); | ||
@@ -358,0 +364,0 @@ return new C(function(observer) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35861
18
873