Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

clues

Package Overview
Dependencies
Maintainers
2
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clues - npm Package Compare versions

Comparing version 4.0.3 to 4.0.4

.circleci/config.yml

7

clues.js

@@ -16,3 +16,3 @@ (function(self) {

if (e.fullref) return e;
let result = {ref : e.ref || ref || fullref, message: e.message || e, fullref: e.fullref || fullref, caller: e.caller || caller, stack: e.stack || '', error: true, notDefined: e.notDefined, report: e.report || report, value: e.value, cache: e.cache};
let result = {ref : e.ref || ref || fullref, message: e.message || e, fullref: e.fullref || fullref, caller: e.caller || caller, stack: e.stack || '', error: true, notDefined: e.notDefined, report: e.report || report, value: e.value, cache: e.cache, cluesHasLogged: e.cluesHasLogged};
return result;

@@ -298,3 +298,6 @@ };

let wrappedEx = createEx(e || {}, fullref, caller, ref, true);
if (e && e.stack && typeof $global.$logError === 'function') $global.$logError(wrappedEx, fullref);
if (e && e.stack && !wrappedEx.cluesHasLogged && typeof $global.$logError === 'function') {
wrappedEx.cluesHasLogged = true;
$global.$logError(wrappedEx, fullref);
}
return storeRef(logic, ref, reject(wrappedEx), fullref, caller);

@@ -301,0 +304,0 @@ };

{
"name": "clues",
"version": "4.0.3",
"version": "4.0.4",
"description": "Lightweight logic tree solver using promises.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -87,2 +87,3 @@ const clues = require('../clues');

$logError : function(e,f) {
this.counter = (this.counter||0)+1;
this.error = e;

@@ -113,6 +114,19 @@ this.fullref = f;

t.same($global.error.message,'error','error passed to $logError');
t.same($global.counter,1,'logError is called once');
t.ok($global.error.stack,'contains a stack');
t.same($global.error.fullref,'stack_error_promise','fullref ok');
});
t.test('promise rejected with a stack', async t => {
const $global = Object.create(Global);
const facts = {
stack_error_promise: () => clues.reject(new Error('error')),
reffed_error: stack_error_promise => stack_error_promise
};
await clues(facts,'reffed_error',$global).then(shouldErr,Object);
t.same($global.error.message,'error','error passed to $logError');
t.same($global.counter,1,'logError is called once');
t.ok($global.error.stack,'contains a stack');
});
t.test('error without a stack (rejection)', async t => {

@@ -119,0 +133,0 @@ const $global = Object.create(Global);

@@ -23,3 +23,6 @@ // See optimization killers https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#1-tooling

%OptimizeFunctionOnNextCall(clues);
clues();
%OptimizeFunctionOnNextCall(clues);
//The next call

@@ -32,3 +35,4 @@ clues()

const d = await execAsync('echo "'+code+'" | node --allow-natives-syntax', { cwd: __dirname });
console.log(d);
t.same(!!((d & 4) || (d & 16)), true);
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc