Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #17922
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | JJ <jaejunks@nah.meh> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Source code "objectifying" technique? |
| Date | Thu, 3 Jan 2013 20:13:54 +0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 30 |
| Message-ID | <XnsA13E219E61C5Ejj@0.0.0.55> (permalink) |
| References | <XnsA13DB38A51C6jj@0.0.0.55> <kc4ir7$bh7$1@news.albasani.net> |
| Injection-Date | Thu, 3 Jan 2013 20:13:54 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="f8ea35d8958493b8650c0b3ef1b6a34b"; logging-data="8359"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dzXYiYUizYdFt7FGtAxM36JkxBq1uUoA=" |
| User-Agent | Xnews/5.04.25 |
| X-Face | \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pad{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl |
| Cancel-Lock | sha1:aNWHMAqgD4IbxY1Mp2pv10TnEEY= |
| Xref | csiph.com comp.lang.javascript:17922 |
Show key headers only | View raw
Stefan Weiss <krewecherl@gmail.com> wrote:
> Okay, as long as you're aware of that calling abc() is _not_ the same
> thing as calling theLib.abc(). At least make sure to check if any of
the
> functions use |this|.
Yes, I always watch out for any of their own objects, "this" usage and
bound functions usage. I leave them as is, if it's beyod my capability.
> Depends on the library, but something like this might work:
> ...
That'll do very nicely. Thanks. Got to get used to this.
> Not every collection of functions can be contained in this way, but it
> should work for your typical bunch-of-global-functions-because-
> -the-author-doesn't-know-any-better library.
Like bound functions?
...
Also, do this two conversions have any functionality difference? Or may
be leads to possible error elsewhere?
//original
function abc(){}
//conversion #1
theLib.abc=function abc(){};
//conversion #2
theLib.abc=function(){};
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Source code "objectifying" technique? JJ <jaejunks@nah.meh> - 2013-01-03 10:34 +0000
Re: Source code "objectifying" technique? Stefan Weiss <krewecherl@gmail.com> - 2013-01-03 19:32 +0100
Re: Source code "objectifying" technique? JJ <jaejunks@nah.meh> - 2013-01-03 20:13 +0000
Re: Source code "objectifying" technique? Stefan Weiss <krewecherl@gmail.com> - 2013-01-03 23:57 +0100
Re: Source code "objectifying" technique? Stefan Weiss <krewecherl@gmail.com> - 2013-01-04 00:44 +0100
Re: Source code "objectifying" technique? JJ <jaejunks@nah.meh> - 2013-01-04 02:00 +0000
Re: Source code "objectifying" technique? Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-03 10:37 -0800
Re: Source code "objectifying" technique? Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-03 10:43 -0800
Re: Source code "objectifying" technique? JJ <jaejunks@nah.meh> - 2013-01-03 20:33 +0000
Re: Source code "objectifying" technique? Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-03 13:09 -0800
Re: Source code "objectifying" technique? JJ <jaejunks@nah.meh> - 2013-01-04 02:33 +0000
csiph-web