Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed May 23, 2021
1 parent 3a6fc0c commit c851e14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
20 changes: 10 additions & 10 deletions benchmark/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ async function build(dist, out) {
strip({
functions: ['assert', 'deprecate'],
}),
// terser({
// compress: {
// // eslint-disable-next-line @typescript-eslint/naming-convention
// negate_iife: false,
// sequences: 0,
// },
// output: {
// semicolons: false,
// },
// }),
terser({
compress: {
// eslint-disable-next-line @typescript-eslint/naming-convention
negate_iife: false,
sequences: 0,
},
output: {
semicolons: false,
},
}),
],
onwarn(warning) {
let { code } = warning;
Expand Down
14 changes: 12 additions & 2 deletions packages/@glimmer/validator/lib/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,21 @@ function endTrack(): Tracker {
export class TrackFrameOpcode implements UpdatingOpcode {
public source: Source | null = null;
public target: number | null = null;
public revision: Revision = Revisions.UNINITIALIZED;

constructor(private debuggingContext?: string) {
beginTrack(debuggingContext);
}

evaluate(vm: UpdatingVM) {
if (this.source === null || !isDirty(this.source)) {
let { source } = this;

assert(
source === null || isSourceImpl(source),
'VM BUG: Expected track opcode to have a source'
);

if (source === null || this.revision >= getRevision(source)) {
let { target } = this;

assert(target, 'VM BUG: expected a target to exist for a tracking opcode, but it did not');
Expand All @@ -417,19 +425,21 @@ export class EndTrackFrameOpcode implements UpdatingOpcode {
let current = endTrack();

let deps = current.toDeps();
let { maxRevision } = current;
let source = deps;

if (Array.isArray(source)) {
source = new SourceImpl<unknown>(undefined, null, null);
source.deps = deps;
source.revision = source.valueRevision = current.maxRevision;
source.revision = source.valueRevision = maxRevision;
}

if (CURRENT_TRACKER !== null && source !== null) {
CURRENT_TRACKER.add(source);
}

this.begin.source = source;
this.begin.revision = maxRevision;
}
}

Expand Down

0 comments on commit c851e14

Please sign in to comment.