can-reflect
Advanced tools
+2
-2
| { | ||
| "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"; |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
180927
0.53%4923
0.63%Updated