Arguments error fix

This commit is contained in:
Abdussamed 2023-11-10 21:37:49 +03:00
parent c71a180d8a
commit fba60407e4
1 changed files with 9 additions and 9 deletions

18
wire.js
View File

@ -11,18 +11,18 @@
let pipeLine = function(){ let pipeLine = function(){
this.reads = []; this.reads = [];
this.writes = []; this.writes = [];
this.read = (fn,pr) => reads.push({fn,pr}); this.read = (fn,pr) => this.reads.push({fn,pr});
this.write = (fn,pr) => writes.push({fn,pr}); this.write = (fn,pr) => this.writes.push({fn,pr});
this.get = (val) => { this.get = (val) => {
let fns = reads.sort((a,b) => (a?.pr|0) - (b?.pr|0)), let fns = this.reads.sort((a,b) => (a?.pr|0) - (b?.pr|0)),
real = val; real = val;
for (const { fn } of fns) { for (const { fn } of fns) {
fn( real, e => real = e ); fn( real, e => real = e );
}; };
return real; return real;
}; };
this.set = () => { this.set = (val) => {
let fns = writes.sort((a,b) => (a?.pr|0) - (b?.pr|0)), let fns = this.writes.sort((a,b) => (a?.pr|0) - (b?.pr|0)),
real = val; real = val;
for (const { fn } of fns) { for (const { fn } of fns) {
fn( real, e => real = e ); fn( real, e => real = e );
@ -284,13 +284,13 @@
é.prototype.equalTo = function(value){ é.prototype.equalTo = function(value){
return é.isSame(value, this.value) return é.isSame(value, this.value)
} }
é.prototype.readLayer = function(value){ é.prototype.readLayer = function(fn,priority){
this.flag = this.flag | 2; this.flag = this.flag | 2;
this.piping.read(a,b) this.piping.read(fn,priority)
} }
é.prototype.writeLayer = function(value){ é.prototype.writeLayer = function(fn,priority){
this.flag = this.flag | 4; this.flag = this.flag | 4;
this.piping.write(a,b) this.piping.write(fn,priority)
} }
try{ try{
module.exports = é; module.exports = é;