Git Product home page Git Product logo

Comments (10)

otakustay avatar otakustay commented on May 26, 2024

这个功能可以给实现了么?

from oo.

Exodia avatar Exodia commented on May 26, 2024

api 如下,这周末实现:
oo.definePropertyAccessor(exports, 'globalData');
typeof exports.setGlobalData === 'function';
typeof exports.getGlobalData === 'function';

oo.definePropertyAccessor(exports, 'globalData', { get: xxx, set: xxxx });
用来自定义 get set

不确定下面这几个 api 是否有必要:
oo.definePropertyGetter(exports, 'globalData');
typeof exports.getGlobalData === 'function';

oo.definePropertySetter(exports, 'globalData');
typeof exports.setGlobalData === 'function';

from oo.

otakustay avatar otakustay commented on May 26, 2024

这里用exports不知道行不行哦……是要用exports还是create生成后的那个class对象?

from oo.

Exodia avatar Exodia commented on May 26, 2024

··这个目前来看,估计要接收class 对象。

还有个地方需要讨论下:

这些针对 class 的方法,是挂在 oo 上,还是直接挂在 class 上?

挂在 oo 上的好处是和 ecma 的风格比较类似;

挂在 class 上的好处是,便捷,直接 ClassObj.inherit, ClassObj.defineAccessor ,还有就是可以在 Class 函数中方便的做一些闭包工作

from oo.

otakustay avatar otakustay commented on May 26, 2024

我比较倾向挂在oo上,挂在class上感觉像是“运行时”随时能去define

from oo.

Exodia avatar Exodia commented on May 26, 2024

如果能让 ie 系列支持Object.defineProperties中的 get/set应该可以满足你的需求? 我打算用 vbscript 去实现 ie 的 getter 和 setter,就不自动生成 setName 和 getName的方法对了。
http://webreflection.blogspot.tw/2011/03/rewind-getters-setters-for-all-ie-with.html

from oo.

otakustay avatar otakustay commented on May 26, 2024

不不,getset是IoC自动注入需要的……

from oo.

Exodia avatar Exodia commented on May 26, 2024

implemented https://github.com/ecomfe/oo/pull/14/files

from oo.

otakustay avatar otakustay commented on May 26, 2024

是不是没有发布版本来着……只要发一个github的tag,edp上就会自动有版本发布,这个你看什么时候合适发版本就做吧

from oo.

Exodia avatar Exodia commented on May 26, 2024

我先发布吧- - 本来想先补充测试用例来这的- -

from oo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.