Skip to content

Instantly share code, notes, and snippets.

View Gozala's full-sized avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
@Gozala
Gozala / expample.js
Created May 29, 2011 11:09
Some stream experiments
/* vim:set ts=2 sw=2 sts=2 expandtab */
/*jshint asi: true undef: true es5: true node: true devel: true
forin: false latedef: false globalstrict: true */
/*global define: true */
"use strict";
var fs = require('fs')
var path = require('path')

Module Constructor

This is a proposal for the inclusion of an additional primordial variable to all ECMAScript contexts.

  • There MUST be a primordial function Module(text, fileName, lineNo)
    • text MUST be parsed the body of a strict-mode Function
    • Module MAY throw a SyntaxError
    • fileName is an optional name for the text, for debuggers
  • lineNo defaults to 1, is coerced to Number internally, and represents the line
<script src="ref-send.js"></script>
<script>
(function () {
var delay = function (timeout) {
var deferred = Q.Deferred();
setTimeout(deferred.resolve, timeout);
return deferred.promise;
};