List of all available JS functions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

List of all available JS functions

shaharke
Hi,

I've noticed that Riak extends the basic javascript functionality to add syntactic-sugar functions on collections (e.g. forEach, filter, map etc.). Is it possible the Riak simply uses the underscore.js library? If not, where can I find a reference with all available functions?

Thanks,
Shahar
Reply | Threaded
Open this post in threaded view
|

Re: List of all available JS functions

bryan-basho
Administrator
On Thu, Sep 6, 2012 at 5:49 AM, shaharke <[hidden email]> wrote:
> I've noticed that Riak extends the basic javascript functionality to add
> syntactic-sugar functions on collections (e.g. forEach, filter, map etc.).
> Is it possible the Riak simply uses the underscore.js library? If not, where
> can I find a reference with all available functions?

Hi, Shahar. The Javascript functions included with Riak are defined in
a file named "mapred_builtins.js":
https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js

The functions in json2.js from the erlang_js project are also
included: https://github.com/basho/erlang_js/blob/master/priv/json2.js

-Bryan

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: List of all available JS functions

shaharke
Hi Brian,

Thanks for the quick reply. I might be missing here something, but I can't see any of the collection extension functions in any of the js files you mentioned. For example, where did you add the forEach method available on all arrays?

Thanks,
Shahar

On Thu, Sep 6, 2012 at 2:59 PM, bryan-basho [via Riak Users] <[hidden email]> wrote:
On Thu, Sep 6, 2012 at 5:49 AM, shaharke <[hidden email]> wrote:
> I've noticed that Riak extends the basic javascript functionality to add
> syntactic-sugar functions on collections (e.g. forEach, filter, map etc.).
> Is it possible the Riak simply uses the underscore.js library? If not, where
> can I find a reference with all available functions?

Hi, Shahar. The Javascript functions included with Riak are defined in
a file named "mapred_builtins.js":
https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js

The functions in json2.js from the erlang_js project are also
included: https://github.com/basho/erlang_js/blob/master/priv/json2.js

-Bryan

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



If you reply to this email, your message will be added to the discussion below:
http://riak-users.197444.n3.nabble.com/List-of-all-available-JS-functions-tp4025173p4025174.html
To unsubscribe from List of all available JS functions, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: List of all available JS functions

Dan Milon

forEach is a native javascript (ES5) method on Arrays.
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach

danmilon.

On 09/06/2012 05:04 PM, shaharke wrote:

> Hi Brian,
>
> Thanks for the quick reply. I might be missing here something, but I
> can't see any of the collection extension functions in any of the js
> files you mentioned. For example, where did you add the forEach method
> available on all arrays?
>
> Thanks,
> Shahar
>
> On Thu, Sep 6, 2012 at 2:59 PM, bryan-basho [via Riak Users] <[hidden
> email] </user/SendEmail.jtp?type=node&node=4025175&i=0>> wrote:
>
>     On Thu, Sep 6, 2012 at 5:49 AM, shaharke <[hidden email]
>     <http://user/SendEmail.jtp?type=node&node=4025174&i=0>> wrote:
>     > I've noticed that Riak extends the basic javascript
>     functionality to add
>     > syntactic-sugar functions on collections (e.g. forEach, filter,
>     map etc.).
>     > Is it possible the Riak simply uses the underscore.js library?
>     If not, where
>     > can I find a reference with all available functions?
>
>     Hi, Shahar. The Javascript functions included with Riak are
>     defined in
>     a file named "mapred_builtins.js":
>     https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js
>
>     The functions in json2.js from the erlang_js project are also
>     included: https://github.com/basho/erlang_js/blob/master/priv/json2.js
>
>     -Bryan
>
>     _______________________________________________
>     riak-users mailing list
>     [hidden email] <http://user/SendEmail.jtp?type=node&node=4025174&i=1>
>     http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>     ------------------------------------------------------------------------
>     If you reply to this email, your message will be added to the
>     discussion below:
>     http://riak-users.197444.n3.nabble.com/List-of-all-available-JS-functions-tp4025173p4025174.html
>
>     To unsubscribe from List of all available JS functions, click here.
>     NAML
>     <http://riak-users.197444.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: List of all available JS functions
> <http://riak-users.197444.n3.nabble.com/List-of-all-available-JS-functions-tp4025173p4025175.html>
> Sent from the Riak Users mailing list archive
> <http://riak-users.197444.n3.nabble.com/> at Nabble.com.
>
>
> This body part will be downloaded on demand.


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: List of all available JS functions

Sean Cribbs-2
In reply to this post by shaharke
Shahar,

Some of those functions are built-in to the JS runtime. You can refer
to https://developer.mozilla.org/en-US/docs/JavaScript/Reference for
information about built-in functions. Note that the runtime included
with Riak is Spidermonkey 1.8.1, so it will not include some of the
JavaScript 1.5 features.

On Thu, Sep 6, 2012 at 10:04 AM, shaharke <[hidden email]> wrote:

> Hi Brian,
>
> Thanks for the quick reply. I might be missing here something, but I can't
> see any of the collection extension functions in any of the js files you
> mentioned. For example, where did you add the forEach method available on
> all arrays?
>
> Thanks,
> Shahar
>
> On Thu, Sep 6, 2012 at 2:59 PM, bryan-basho [via Riak Users] <[hidden
> email]> wrote:
>>
>> On Thu, Sep 6, 2012 at 5:49 AM, shaharke <[hidden email]> wrote:
>> > I've noticed that Riak extends the basic javascript functionality to add
>> > syntactic-sugar functions on collections (e.g. forEach, filter, map
>> > etc.).
>> > Is it possible the Riak simply uses the underscore.js library? If not,
>> > where
>> > can I find a reference with all available functions?
>>
>> Hi, Shahar. The Javascript functions included with Riak are defined in
>> a file named "mapred_builtins.js":
>> https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js
>>
>> The functions in json2.js from the erlang_js project are also
>> included: https://github.com/basho/erlang_js/blob/master/priv/json2.js
>>
>> -Bryan
>>
>> _______________________________________________
>> riak-users mailing list
>> [hidden email]
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://riak-users.197444.n3.nabble.com/List-of-all-available-JS-functions-tp4025173p4025174.html
>> To unsubscribe from List of all available JS functions, click here.
>> NAML
>
>
>
> ________________________________
> View this message in context: Re: List of all available JS functions
>
> Sent from the Riak Users mailing list archive at Nabble.com.
>
> _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>



--
Sean Cribbs <[hidden email]>
Software Engineer
Basho Technologies, Inc.
http://basho.com/

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com