referencesVia API improvements

NEW
Unassigned

Status

()

Core
JavaScript Engine
5 years ago
3 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
The problems:

1. When trying to check that one object doesn't hold a reference to another,
   if you use referencesVia, you get an error message on stdout. :-P

2. Oh and your test will magically fail in opt builds (oops).

----

So maybe the API should be like this instead:

  // Throw an Error unless the given edge exists.
  assertHasReference(source, edgeName, target);

  // Throw an Error if target is reachable from source,
  // even indirectly.
  assertHasNoReference(source, target);

The latter may have to ignore the parent reference in order to get sane results. Both do nothing when findReferences isn't available.
(Reporter)

Comment 1

5 years ago
Maybe also the prototype reference. I think it's ok for it to be a little ad-hoc.
(Assignee)

Updated

3 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.