Skip to content

Instantly share code, notes, and snippets.

@atannus
Last active August 29, 2015 14:01
Show Gist options
  • Save atannus/b2731427b6e90059651e to your computer and use it in GitHub Desktop.
Save atannus/b2731427b6e90059651e to your computer and use it in GitHub Desktop.
// a.js
//goog.provide('myapp.A');
myapp.A = function() {}
myapp.A.prototype.move = function() {
console.log('moveA');
}
// b.js
//goog.provide('myapp.B');
//goog.require('myapp.A');
myapp.B = function() {};
goog.inherits(myapp.B, myapp.A);
myapp.B.prototype.move = function() {
goog.base(this, 'move');
console.log('moveB');
}
// Create a B
b = new myapp.B();
// Call move on B outputs:
// 'moveA'
// 'moveB'
b.move();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment