Doge

Author:
Jeena Lee
Related Publication:
How to implement a new DOM API for Servo

Abstract

The Doge standard defines process related to doge-ing.

Doge class

typedef sequence<DOMString> DogeInit;
[Constructor(optional DogeInit init),
 Exposed=(Window,Worker)]
interface Doge {
  void append(DOMString word);
  DOMString random();
};

A Doge object has an associated such list.

The Doge(init) constructor, when invoked, must run these steps:

  1. Let doge be a new Doge object.

  2. If init is given, for each word in init, append word to the associated such list.

  3. Return doge.

The append(word) method, when invoked, must append word to the associated such list.

The random() method, when invoked, must run these steps:

  1. Let list be the associated such list.

  2. If list is empty, throw a TypeError.

  3. Return a randomly chosen word from list.