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
buildProperties = (func) -> | |
buildGetter = (name) -> | |
-> @get name | |
buildSetter = (name) -> | |
(value) -> @set name, value | |
for attr in func.prototype.attributeNames | |
Object.defineProperty func.prototype, attr, | |
get: buildGetter attr | |
set: buildSetter attr |
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
# -*- coding: utf-8 -*- | |
""" | |
codegen | |
~~~~~~~ | |
Extension to ast that allow ast -> python code generation. | |
:copyright: Copyright 2008 by Armin Ronacher. | |
:license: BSD. | |
""" |