🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

can-reflect

Package Overview
Dependencies
Maintainers
13
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-reflect - npm Package Compare versions

Comparing version

to
1.17.8

4

package.json
{
"name": "can-reflect",
"version": "1.17.7",
"version": "1.17.8",
"description": "reflection on unknown data types",

@@ -37,3 +37,3 @@ "homepage": "http://canjs.com",

"can-namespace": "^1.0.0",
"can-symbol": "^1.3.0"
"can-symbol": "^1.6.4"
},

@@ -40,0 +40,0 @@ "devDependencies": {

@@ -6,2 +6,3 @@ var QUnit = require('steal-qunit');

var testHelpers = require('../../can-reflect-test_helpers');
var clone = require('steal-clone');

@@ -151,2 +152,30 @@ QUnit.module('can-reflect: type reflections');

QUnit.test("isSymbolLike with polyfill", function(assert) {
var done = assert.async();
var origSymbol = window.Symbol;
function FakeSymbol(key) {
return { key: key };
}
FakeSymbol.for = function() {};
window.Symbol = FakeSymbol;
var loader = clone({});
loader.import("can-symbol")
.then(function(canSymbol) {
loader.import("./type")
.then(function(typeReflections) {
if(typeof Symbol !== "undefined") {
ok(!typeReflections.isSymbolLike(Symbol("a polyfilled symbol")), "polyfilled Symbol not symbol-like");
}
ok(typeReflections.isSymbolLike(canSymbol("a polyfilled canSymbol")), "canSymbol Symbol");
// clean up
window.Symbol = origSymbol;
done();
});
});
});
QUnit.test("isPromise", function() {

@@ -153,0 +182,0 @@ QUnit.ok(!typeReflections.isPromise({}), "Object is not a promise");

@@ -400,5 +400,15 @@ "use strict";

var supportsSymbols = typeof Symbol !== "undefined" && typeof Symbol.for === "function";
var supportsNativeSymbols = (function() {
var symbolExists = typeof Symbol !== "undefined" && typeof Symbol.for === "function";
if (!symbolExists) {
return false;
}
var symbol = Symbol("a symbol for testing symbols");
return typeof symbol === "symbol";
}());
var isSymbolLike;
if(supportsSymbols) {
if(supportsNativeSymbols) {
isSymbolLike = function(symbol) {

@@ -405,0 +415,0 @@ return typeof symbol === "symbol";