Open Bug 808254 Opened 12 years ago Updated 2 years ago

referencesVia API improvements

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect

Tracking

()

People

(Reporter: jorendorff, Unassigned)

Details

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.
Maybe also the prototype reference. I think it's ok for it to be a little ad-hoc.
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.