Socket
Socket
Sign inDemoInstall

@webqit/subscript

Package Overview
Dependencies
2
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.32 to 2.1.33

2

package.json

@@ -11,3 +11,3 @@ {

"homepage": "https://webqit.io/tooling/subscript",
"version": "2.1.32",
"version": "2.1.33",
"license": "MIT",

@@ -14,0 +14,0 @@ "repository": {

@@ -127,10 +127,10 @@

}
if ( !this.ownerContract || this.params.isFunctionContract ) {
let exitReturnValue = this.exits.get( 'return' );
this.exits.clear();
if ( exitReturnValue !== undefined ) {
returnValue = returnValue instanceof Promise ? returnValue.then( () => exitReturnValue ) : exitReturnValue;
return _await( returnValue, () => {
if ( !this.ownerContract || this.params.isFunctionContract ) {
let exitReturnValue = this.exits.get( 'return' );
this.exits.clear();
if ( exitReturnValue !== undefined ) return exitReturnValue;
}
}
return returnValue;
return returnValue;
} );
}

@@ -140,8 +140,8 @@

if ( this.disposed ) return false;
if ( ![ 'ForOfStatement', 'ForInStatement'].includes( this.graph.type ) || this.subContracts.size !== 1 ) {
if ( ![ 'ForOfStatement', 'ForInStatement' ].includes( this.graph.type ) || this.subContracts.size !== 1 ) {
throw new Error( `Contract ${ this.graph.lineage } is not an iterator.` );
}
let [ [ /* iterationContractId */, iterationInstances ] ] = this.subContracts;
let prev, _await = ( prev, callback ) => prev instanceof Promise ? prev.then( callback ) : callback();
if ( !keys.length || ( keys.includes( 'length') && this.graph.type === 'ForOfStatement' ) ) {
let prev
if ( !keys.length || ( keys.includes( 'length' ) && this.graph.type === 'ForOfStatement' ) ) {
for ( let [ /* iterationId */, iterationInstance ] of iterationInstances ) {

@@ -186,3 +186,3 @@ prev = _await( prev, () => iterationInstance.call() );

};
let prev, entry, refs, _await = ( prev, callback ) => prev instanceof Promise ? prev.then( callback ) : callback();
let prev, entry, refs;
while (

@@ -436,2 +436,6 @@ ( entry = this.$thread.sequence.shift() )

}
}
const _await = ( maybePromise, callback ) => (
maybePromise instanceof Promise ? maybePromise.then( callback ) : callback()
);

@@ -9,3 +9,3 @@

// -----------
let source2 = `
let source = `
/*

@@ -21,11 +21,15 @@ */

let sum = async function sum( param_1, param_2 ) {
return param_1 + (await param_2);
}
let l = list1;
let v = 'length';
let sum = async function** sum( param_1, param_2 ) {
return param_1 + await param_2;
}
let propName = 'length';
if ( 3 ) {
let { [ v ]: length } = 1 ? l : 4;
let { [ propName ]: length } = 1 ? l : 4;
console.log( 'List1s length is:', length );
}
console.log( '-----------------------------------------------' );
for ( let num of list1 ) {

@@ -35,2 +39,5 @@ if ( num === 'four' ) break;

}
console.log( '-----------------------------------------------' );
top: {

@@ -45,5 +52,8 @@ l1: for ( let item1 of list1 ) {

}
switch( param3 ) {
console.log( '-----------------------------------------------' );
switch( funcTrigger ) {
case 'sum':
return sum( param1, param2 );
return sum( funcParam1, funcParam2 );
default:

@@ -54,49 +64,41 @@ console.log( 'the end!' )

let source3 = `
let count = 10, doubleCount = count * 2, quadCount = doubleCount * 2;
//console.log( count, doubleCount, quadCount );
`;
globalThis.a = '';
SubscriptFunction.compilerParams.globalsNoObserve.push( 'console' );
let subscriptFunction = new SubscriptFunction( 'funcTrigger', 'funcParam1', 'funcParam2', source );
Observer.observe( globalThis, mutations => {
subscriptFunction.thread( ...mutations.map( mu => mu.path ) );
}, { subtree: true } );
console.log( '.....................sideEffects', subscriptFunction.sideEffects );
let source4 = `
let app = document.state;
$(this.namespace.error).html(app.network?.error ? (app.network?.online ? 'Network Error - ' : "You're Offline - ") + app.network?.error : '404 - Not Found!');
globalThis.targetEntries = {};
globalThis.entries = { one: { name: 'one' }, two: { name: 'two' } };
Observer.link( globalThis, 'entries', entries );
setTimeout(() => {
entries[ 'one' ] = { name: 'New one' };
subscriptFunction.thread( [ 'entries', 'one', 'name' ] );
}, 4000);
`;
globalThis.d = undefined;
SubscriptFunction.compilerParams.globalsNoObserve.push( 'console' );
let subscriptFunction = new SubscriptFunction( 'param1', 'param2', 'param3', source4 );
console.log( '.....................sideEffects', subscriptFunction.sideEffects );
// -----------
globalThis.someState = false;
globalThis.tests = { a: true, b: false };
globalThis.document = { state: { title: 'Hello from Subscript!' }, head: { meta1: 'Meta prop1' } };
globalThis.list1 = [ 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten' ];
globalThis.list2 = [ 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten' ];
globalThis.entries = { one: { name: 'one' }, two: { name: 'two' } };
globalThis.targetEntries = {};
Observer.link( globalThis, 'tests', tests );
Observer.link( globalThis, 'document', document );
Observer.link( globalThis, 'list1', list1 );
Observer.link( globalThis, 'list2', list2 );
Observer.link( globalThis, 'entries', entries );
setTimeout(() => {
Observer.set( list1, 0, 'new one' );
}, 4500);
Observer.observe( globalThis, mutations => {
subscriptFunction.thread( ...mutations.map( mu => mu.path ) );
}, { subtree: true } );
console.log('');
let result = subscriptFunction( 'sum', '55', '55' );
console.log( '---result---->', await result );
setTimeout(async () => {
console.log( '---thread---->', await subscriptFunction.thread( [ 'funcParam2' ] ) );
}, 5000);
console.log('');
console.log('--------------------------------------------------');
console.log('');
console.log( JSON.stringify( subscriptFunction.runtime.graph, null, 3 ) );
//0console.log( JSON.stringify( subscriptFunction.runtime.graph, null, 3 ) );
console.log('');
console.log('--------------------------------------------------');
console.log('');
console.log( subscriptFunction.originalSource );
//console.log( subscriptFunction.originalSource );
console.log('');

@@ -110,29 +112,1 @@ console.log('--------------------------------------------------');

//process.exit();
let result;// = subscriptFunction( '55', '55', 'sum' );
console.log( '------->', result );
setTimeout(() => {
//someState = true;
//console.log( '------->', subscriptFunction.thread( [ 'someState' ] ) );
entries[ 'one' ] = { name: 'New one' };
subscriptFunction.thread( [ 'entries', 'one', 'name' ] );
/*
Observer.proxy( list1 ).push( 'eleven' );
//Observer.set( globalThis.document, 'title', {} );
//Observer.set( globalThis, 'globe', {} );
Observer.set( globalThis.tests, 'b', true );
setTimeout(() => {
//Observer.set( globalThis.document, 'title', {} );
//Observer.set( globalThis, 'globe', {} );
//Observer.set( globalThis.document, 'state', { title: 'NEW document title' } );
Observer.set( globalThis, 'tests', tests );
return;
setTimeout(() => {
Observer.set( list, 0, 'new one' );
}, 4000);
}, 4000);
*/
}, 4000);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc