Skip to content

Instantly share code, notes, and snippets.

View vincesp's full-sized avatar

vincesp

  • Zürich, Switzerland
View GitHub Profile
@vincesp
vincesp / PrivateFoo.js
Last active June 15, 2016 01:26
Private class members aren't really private in TypeScript. What is the right solution?
function Base() {
var foo = 0;
return {
greet: function () {
++foo;
return "Hello";
},
fly: function() {
return "Flying";
}
//
// https://www.linkedin.com/grp/post/86782-6068598162933764098
//
#include <iostream>
#include <iomanip>
#include <vector>
#include <deque>
#include <memory>
#include <array>
@vincesp
vincesp / 1 None-compiling TypeScript.ts
Last active August 29, 2015 14:08
TypeScript compilation flaw
class AbstractProxy {
private privateBuffer:String = 'abstract';
public usePrivateBuffer = () => {
alert(this.privateBuffer);
}
}
/*
This doesn't compile