public function end_collecting_javascript_requirements() {
        if ($this->savedrequires === null) {
            throw new coding_exception('JavaScript collection has not been started.');
        }
        $this->_requires = $this->savedrequires;
        $this->savedrequires = null;
    }