Merge lp:~daniellimws/unity-js-scopes/unity-js-scopes-bug1523595 into lp:unity-js-scopes

Proposed by Daniel Lim
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 126
Merged at revision: 123
Proposed branch: lp:~daniellimws/unity-js-scopes/unity-js-scopes-bug1523595
Merge into: lp:unity-js-scopes
Diff against target: 55 lines (+11/-2)
3 files modified
examples/simple/simple.js (+1/-1)
src/bindings/index.js (+8/-0)
src/bindings/src/addon.cc (+2/-1)
To merge this branch: bzr merge lp:~daniellimws/unity-js-scopes/unity-js-scopes-bug1523595
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
Review via email: mp+281469@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

Thank you for working on this!

This code doesn't build though, could you fix it?

also:

- could you remove the "no-op" changes (prob tab/space updates)?
- unity::scopes::ScopeMetadata::results_ttl_type returns an enum which is basically in integral type, but you declare it as strings in JS. It should be defined as integers matching the C++ values,

review: Needs Fixing
Revision history for this message
Daniel Lim (daniellimws) wrote :

Sorry I don't know what tabs/space are you referring to.

Revision history for this message
Daniel Lim (daniellimws) wrote :

And where can I get the integral values?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> Sorry I don't know what tabs/space are you referring to.

If you look at the diff below, there are a few diffs that dont seem to change anything

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :
121. By Marcus Tomlinson

Stop the scopes runtime and exit gracefully upon SIGTERM

Revision history for this message
Daniel Lim (daniellimws) wrote :

I've changed the enum. But I don't know how to remove the tabs/spaces

Revision history for this message
Daniel Lim (daniellimws) wrote :

> I've changed the enum. But I don't know how to remove the unwanted diffs

Revision history for this message
Daniel Lim (daniellimws) wrote :

> I've changed the enum. But I don't know how to remove the unwanted diffs

Revision history for this message
Daniel Lim (daniellimws) wrote :

Oops this is awkward. Sorry

Revision history for this message
Daniel Lim (daniellimws) wrote :

Can I change the commits? Is that what I am supposed to do to remove the unwanted changes? If yes, may I get some help on how to do so?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> Can I change the commits? Is that what I am supposed to do to remove the
> unwanted changes? If yes, may I get some help on how to do so?

you can do this:

bzr branch lp:unity-js-scopes trunk
cd trunk
bzr merge lp:~daniellim0611/unity-js-scopes/unity-js-scopes-bug1523595

then with

bzr diff

you can see the diffs, and update your code until the diffs are clean.
You can then

bzr commit -m "your message"

and

bzr push lp:~daniellim0611/unity-js-scopes/unity-js-scopes-bug1523595

it'll mess up the history a bit but it is fine,

122. By daniellim <email address hidden>

Removed no-op changes for index.js

123. By daniellim <email address hidden>

Removed no-op changed for simple.js & index.js

Revision history for this message
Daniel Lim (daniellimws) wrote :

I've removed some of the unwanted changes. The others are quite hard to see the difference.
Apparently the editor I used, atom, auto-removed all the spaces for me. So I used gedit instead.

But regardless of that, is the enumeration correct now?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

Could you make the name of the enum match the c++ one: ResultsTtlType ?

review: Needs Fixing
124. By daniellim <email address hidden>

Modified index.js

Revision history for this message
Daniel Lim (daniellimws) wrote :

Ok changed it. Hope that there are no more silly mistakes.

125. By daniellim <email address hidden>

Removed no-op changes for index.js

126. By daniellim <email address hidden>

Removed no-op changes for simple.js

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

Thank you,

It still doesn't build though. I looked into it and it caused by a limitation of v8cpp (the lib that we use to handle the details of the v8 -> c++ bindings) that doesn't properly handle enum class.

I filed a bug

https://bugs.launchpad.net/bugs/1532879

and it should be commited & released tomorrow. I'll check the code as soon as it is.

Revision history for this message
Daniel Lim (daniellimws) wrote :

Actually I want to apologize. I am in boarding school and the school wifi blocks stuff from ubuntu, so I couldnt upgrade to Ubuntu 15 and Ubuntu 14 doesn't support unity scopes in javascript, therefore I wasn't able to build and test the code. I know that this isn't the right thing to do when coding but I thought it is just as simple as declaring a variable so I did not bother much.

Sorry for all inconvenience caused.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> Actually I want to apologize. I am in boarding school and the school wifi
> blocks stuff from ubuntu, so I couldnt upgrade to Ubuntu 15 and Ubuntu 14
> doesn't support unity scopes in javascript, therefore I wasn't able to build
> and test the code. I know that this isn't the right thing to do when coding
> but I thought it is just as simple as declaring a variable so I did not bother
> much.
>
> Sorry for all inconvenience caused.

no worries, I am here to help you land this branch :)

Revision history for this message
Daniel Lim (daniellimws) wrote :

How's it?
Sorry I hope I can proceed to the next gci task ASAP. I have spent more than 10 days on this already.
I want to get the t-shirt :p

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> How's it?
> Sorry I hope I can proceed to the next gci task ASAP. I have spent more than
> 10 days on this already.
> I want to get the t-shirt :p

The bug fix landed yesterday and now your branch builds and works fine,

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/simple/simple.js'
2--- examples/simple/simple.js 2015-11-08 15:49:12 +0000
3+++ examples/simple/simple.js 2016-01-11 14:26:09 +0000
4@@ -32,6 +32,7 @@
5 console.log(' ' + metadata.hot_key());
6 console.log(' ' + metadata.invisible());
7 console.log(' ' + metadata.scope_directory());
8+ console.log(' ' + metadata.results_ttl_type());
9 console.log(' ' + metadata.location_data_needed());
10 }
11
12@@ -164,4 +165,3 @@
13 preview: function(result, action_metadata) {}
14 }
15 );
16-
17
18=== modified file 'src/bindings/index.js'
19--- src/bindings/index.js 2015-12-18 14:27:50 +0000
20+++ src/bindings/index.js 2016-01-11 14:26:09 +0000
21@@ -166,6 +166,14 @@
22 },
23 };
24
25+// results_ttl_type enumeration type
26+var ResultsTtlType = {
27+ None: 0,
28+ Small: 1,
29+ Medium: 2,
30+ Large: 3
31+}
32+
33 ConnectivityStatus = {
34 Unknown: "Unknown",
35 Connected: "Connected",
36
37=== modified file 'src/bindings/src/addon.cc'
38--- src/bindings/src/addon.cc 2015-12-18 14:27:50 +0000
39+++ src/bindings/src/addon.cc 2016-01-11 14:26:09 +0000
40@@ -379,6 +379,7 @@
41 .add_method("set_scope_state_callback", &Registry::set_scope_state_callback)
42 .add_method("set_list_update_callback", &Registry::set_list_update_callback);
43
44+
45 v8cpp::Class<unity::scopes::ScopeMetadata> scope_metadata(isolate);
46 scope_metadata
47 // unity::scopes::ScopeMetadata
48@@ -395,7 +396,7 @@
49 // .add_method("appearance_attributes", &unity::scopes::ScopeMetadata::appearance_attributes)
50 .add_method("scope_directory", &unity::scopes::ScopeMetadata::scope_directory)
51 // .add_method("serialize", &unity::scopes::ScopeMetadata::serialize)
52- // .add_method("results_ttl_type", &unity::scopes::ScopeMetadata::results_ttl_type)
53+ .add_method("results_ttl_type", &unity::scopes::ScopeMetadata::results_ttl_type)
54 // .add_method("settings_definitions", &unity::scopes::ScopeMetadata::settings_definitions)
55 .add_method("location_data_needed", &unity::scopes::ScopeMetadata::location_data_needed);
56

Subscribers

People subscribed via source and target branches

to all changes: