ahnzaz / jstrict Goto Github PK
View Code? Open in Web Editor NEWJavascript Object Oriented framework with strict grammar support
Javascript Object Oriented framework with strict grammar support
Object.defineProperty() 메소드를 이용하면 field에 직접 값 세팅하는 로직에 intercept가 가능하다. 게다가 해당 getter, setter 메소드에 해당 object가 this로 binding되기에 prototype tracking이 가능한 것으로 확인했다.
이를 이용하면 Prototype Chain을 상속구조로 사용하는 현재 구조에서 해당 필드의 알맞은 위치로 값을 이동시켜 줄 수 있을 것으로 기대된다.
예컨데 public scope에 존재하는 field라면 private, protected scope에서는 해당 값의 get, set을 상위 prototype으로 위임하면 결과적으로 public에 도달하여 해당 field에 적용될 것으로 예상한다.
다만 다른 두 개 이상의 scope에 동일한 이름의 field가 정의되어 있을때의 동작에 대해서는 고민이 필요하다.
현재 코드에서는 new Class()로 생성되는 인스턴스들은 최종 결과물의 Public Scope instance만 반환이 되고 Private, Protected scope는 내부적으로만 존재하는 상황이다.
이런 상황에서는 Public Method, Field의 작동에는 문제가 없으나 다른 클래스로 핸들했을 때 protected 이하 field, method에 접근이 불가능한 문제가 있다.
그렇다면 결국 반환되는 instance는 private scope를 반환하고 호출되는 시점에 caller를 확인해서 처리 해야 하는데 문제는 제대로 된 caller를 알 수가 없다는 것이 문제다.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.