W3C home > Mailing lists > Public > spec-prod@w3.org > April to June 2015

What guidance can we give people about ReSpec and adding event listeners

From: Shane McCarron <shane@aptest.com>
Date: Fri, 10 Apr 2015 12:31:09 -0500
Message-ID: <CAOk_reHTE_phuBF=RQ0VzRBYx2tUB_ZO-+_3F_hA+FwHM6Xx9Q@mail.gmail.com>
To: "spec-prod@w3.org Prod" <spec-prod@w3.org>
I ran into an interesting problem today. Even if ReSpec is the first script
in a sequence, there is a risk that subsequent scripts will load and
execute first.  So if, for example, I have code like:

respecEvents.sub('end', function(message) { });

It can throw an error because respecEvents is not yet defined.

What guidance can we give spec authors to avoid this sort of race condition?

-- 
Shane McCarron
Managing Director, Applied Testing and Technology, Inc.
Received on Friday, 10 April 2015 17:31:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:55:20 UTC