This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* toExplicitRe | |
* Converts implicit concatenations of RegExps into explicit ones | |
* by adding dot "." symbol as the concatenation symbol. | |
* | |
* The explicit format of RegExps is used by https://gist.github.com/1239804 | |
* | |
* Examples: | |
* | |
* - abc => a.b.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Printer extends Isolate { | |
main() { | |
port.receive((message, replyTo) { | |
if (message == null) port.close(); | |
else print(message); | |
}); | |
} | |
} | |
main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
// Simple test program invoked with an option to eagerly | |
// compile all code that is loaded in the isolate. | |
// VMOptions=--compile_all | |
class HelloDartTest { | |
static testMain() { | |
print("Hello, Darter!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* class.js | |
* @author Dmitry A. Soshnikov | |
*/ | |
function Class(params) { | |
/** | |
* Constructor function | |
* If not specified, use default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* r-proto-class.js | |
* Ruby's semantics | |
* | |
* Features: | |
* - super calls | |
* - using Object.create for inheritance | |
* - Class.new is a wrapper over Class.allocate and Class.initialize | |
* | |
* See also version w/ class(...) wrapper: https://gist.github.com/1367025 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* r-proto-class-class.js | |
* Ruby's semantics | |
* | |
* Features: | |
* - super calls | |
* - using Object.create for inheritance | |
* - Class.new is a wrapper over Class.allocate and Class.initialize | |
* | |
* See also version w/o class(...) wrapper: https://gist.github.com/1366953 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://mail.mozilla.org/pipermail/es-discuss/2011-November/018440.html | |
// see original lib here: | |
// https://gist.github.com/1366953 | |
// https://gist.github.com/1330574 | |
var Class = { | |
/** | |
*allocate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by Dmitry Soshnikov <[email protected]> | |
// on "noSuchMethod" hook via proxies | |
// written on December 15, 2011 | |
// Below is tl;dr | |
// but if you want really never-ending tl;dr, try this | |
// original old thread from 2010 on es-discuss: | |
// https://mail.mozilla.org/pipermail/es-discuss/2010-October/011929.html | |
// Small disclaimer and note: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Mark and Sweep Garbage Collection technique. | |
* MIT Style License | |
* by Dmitry Soshnikov | |
*/ | |
// This diff describes the simplest version of mark and sweep | |
// GC in order to understand the basic idea. In real practice the | |
// implementation can be much tricker and optimized. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Automatic Reference Counting (ARC) Garbage Collection technique. | |
* | |
* This diff describes Reference counting GC technique. | |
* See also previous lesson on Mark and Sweep GC: | |
* https://gist.github.com/4391763 | |
* | |
* Covered topics: | |
* | |
* 1. Reference value in ECMAScript (JS specific) |