This file contains 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 Subclass { | |
callBaseSayHello() { | |
this.sayHello(); | |
} | |
} | |
Object.setPrototypeOf(Subclass.prototype, baseProto); |
This file contains 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
function classify(mixin) { | |
const Surrogate = class {}; | |
Surrogate.prototype = mixin; | |
return Surrogate; | |
} | |
const baseProto = { | |
sayHello() { | |
console.log('hello'); | |
} |
This file contains 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
// Allowed. | |
class A {} | |
class B extends A {} | |
// Not allowed. | |
const A = {}; | |
class B extends A {} |
This file contains 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
var fs = require('fs'); | |
if (process.argv.length < 3) { | |
console.log('JavaScript.js: the JavaScript to JavaScript transpiler.'); | |
console.log('Please profile a source file.'); | |
process.exit(1); | |
} | |
fs.readFile(process.argv[3], 'utf8', function(error, data) { | |
if (error) { | |
console.error(error.message); |
This file contains 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 2009 Andrew Noyes | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains 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
/** | |
* @fileoverview externalLinks function, which sorts | |
* through all of the links on a given page, and if they are | |
* http:, https:, or mailto: links, a class is applied and their | |
* target is set to _blank. Also includes supporting addClass | |
* function, which appends CSS classes to elements without | |
* over-writing existing classes. | |
* @author Andrew Noyes noyesa@gmail.com | |
*/ |
This file contains 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
/** | |
* @fileoverview array_merge and supporting functions. | |
* Designed to mimic PHP's array_merge function, however | |
* this function also takes into account that objects are | |
* used in place of associative arrays in JavaScript. | |
* @author Andrew Noyes noyesa@gmail.com | |
*/ | |
(function () { | |
/** |
NewerOlder