Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Issue 27514003: A few API changes: (Closed)

Created:
7 years, 2 months ago by justinfagnani
Modified:
7 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

A few API changes: Remove Callback in favor of directly using closures or JsFunction.withThis(). Move jsify() to a named constructor on JsObject. - Throw on types other than Map and Iterable. - Handle cycles Add JsObject.fromDartObject() which force a transferrable native to be proxied. Still to do: Reach a conclusion on Serializable BUG= R=vsm@google.com Committed: https://code.google.com/p/dart/source/detail?r=28902

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove Serializable #

Patch Set 3 : Implement transferrables for Blob, Date, KeyRange, ImageData and Node #

Total comments: 1

Patch Set 4 : More tests, especially for illegal arguments #

Total comments: 7

Patch Set 5 : typed data support #

Total comments: 10

Patch Set 6 : make thisArg optional in JsFunction.apply #

Patch Set 7 : rebased and addressed some comments #

Patch Set 8 : add test for jsify handling cycles #

Total comments: 2

Patch Set 9 : PTAL #

Total comments: 3

Patch Set 10 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+678 lines, -715 lines) Patch
M sdk/lib/js/dart2js/js_dart2js.dart View 1 2 3 4 5 6 9 chunks +96 lines, -81 lines 1 comment Download
M sdk/lib/js/dartium/js_dartium.dart View 1 2 3 4 5 6 7 8 1 chunk +69 lines, -374 lines 2 comments Download
M tests/html/js_test.dart View 1 2 3 4 5 6 7 8 9 9 chunks +507 lines, -256 lines 0 comments Download
M tools/dom/scripts/systemnative.py View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M tools/dom/src/native_DOMImplementation.dart View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
justinfagnani
This CL corresponds to the Dartium CL here: https://chromiumcodereview.appspot.com/26729002/ It's important we keep the APIs ...
7 years, 2 months ago (2013-10-16 18:36:13 UTC) #1
alexandre.ardhuin
We should add a test for `new JsObject.fromBrowserObject`. About API changes to be implemented in ...
7 years, 2 months ago (2013-10-16 19:32:11 UTC) #2
justinfagnani
PTAL Added tests for illegal arguments and for JsObject.fromBrowserObject. Alexandre, I think in general the ...
7 years, 2 months ago (2013-10-18 03:19:08 UTC) #3
alexandre.ardhuin
>Alexandre, I think in general the approach of returning a JsArray is still fine >since ...
7 years, 2 months ago (2013-10-18 07:03:44 UTC) #4
alexandre.ardhuin
https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart File sdk/lib/js/dart2js/js_dart2js.dart (right): https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart#newcode7 sdk/lib/js/dart2js/js_dart2js.dart:7: import 'dart:html' show Blob, ImageData, Node; When we started ...
7 years, 2 months ago (2013-10-18 08:09:36 UTC) #5
justinfagnani
On 2013/10/18 08:09:36, alexandre.ardhuin wrote: > https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart > File sdk/lib/js/dart2js/js_dart2js.dart (right): > > https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart#newcode7 > ...
7 years, 2 months ago (2013-10-18 17:43:49 UTC) #6
vsm
lgtm It'd be good to know the impact on code size of bringing in dart:html, ...
7 years, 2 months ago (2013-10-18 21:34:16 UTC) #7
Jacob
https://chromiumcodereview.appspot.com/27514003/diff/138001/sdk/lib/js/dart2js/js_dart2js.dart File sdk/lib/js/dart2js/js_dart2js.dart (right): https://chromiumcodereview.appspot.com/27514003/diff/138001/sdk/lib/js/dart2js/js_dart2js.dart#newcode196 sdk/lib/js/dart2js/js_dart2js.dart:196: /* nit: /* --> /** https://chromiumcodereview.appspot.com/27514003/diff/138001/sdk/lib/js/dart2js/js_dart2js.dart#newcode207 sdk/lib/js/dart2js/js_dart2js.dart:207: dynamic apply([thisArg, ...
7 years, 2 months ago (2013-10-18 22:03:43 UTC) #8
justinfagnani
one more time... https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart File sdk/lib/js/dart2js/js_dart2js.dart (right): https://codereview.chromium.org/27514003/diff/18001/sdk/lib/js/dart2js/js_dart2js.dart#newcode7 sdk/lib/js/dart2js/js_dart2js.dart:7: import 'dart:html' show Blob, ImageData, Node; ...
7 years, 2 months ago (2013-10-18 22:38:40 UTC) #9
justinfagnani
my comments on Jacob's patchset 9. Jacob, your Dart side is lgtm https://codereview.chromium.org/27514003/diff/248001/tests/html/js_test.dart File tests/html/js_test.dart ...
7 years, 2 months ago (2013-10-19 04:18:46 UTC) #10
Jacob
https://codereview.chromium.org/27514003/diff/248001/tests/html/js_test.dart File tests/html/js_test.dart (right): https://codereview.chromium.org/27514003/diff/248001/tests/html/js_test.dart#newcode545 tests/html/js_test.dart:545: test('handles cycles', () { On 2013/10/19 04:18:46, justinfagnani wrote: ...
7 years, 2 months ago (2013-10-19 04:35:54 UTC) #11
Jacob
Committed patchset #10 manually as r28902 (presubmit successful).
7 years, 2 months ago (2013-10-19 04:36:16 UTC) #12
alexandre.ardhuin
7 years, 2 months ago (2013-10-20 07:17:00 UTC) #13
Message was sent while issue was closed.
A little late on this :(

Moreover with the last continuous build and the following test has 2 problems.

  final JsFunction s = context['String'];
  print(s.apply(['a'])); // display "" instead of "a"
  print(s.apply(['a'], thisArg: 'b')); // fail with the following error

NoSuchMethodError: incorrect number of arguments passed to method named 'apply'
Receiver: Instance of 'JsFunction'
Tried calling: apply(_GrowableList len:1, thisArg: "b")
Found: apply(thisArg, args)

https://codereview.chromium.org/27514003/diff/338001/sdk/lib/js/dart2js/js_da...
File sdk/lib/js/dart2js/js_dart2js.dart (right):

https://codereview.chromium.org/27514003/diff/338001/sdk/lib/js/dart2js/js_da...
sdk/lib/js/dart2js/js_dart2js.dart:172: bool instanceof(type) {
`type` should be JsFunction

https://codereview.chromium.org/27514003/diff/338001/sdk/lib/js/dartium/js_da...
File sdk/lib/js/dartium/js_dartium.dart (right):

https://codereview.chromium.org/27514003/diff/338001/sdk/lib/js/dartium/js_da...
sdk/lib/js/dartium/js_dartium.dart:72: bool hasProperty(String property) native
"JsObject_hasProperty";
`property` should be dynamic like in js_dart2js.dart

https://codereview.chromium.org/27514003/diff/338001/sdk/lib/js/dartium/js_da...
sdk/lib/js/dartium/js_dartium.dart:74: void deleteProperty(JsFunction name)
native "JsObject_deleteProperty";
`name` should be dynamic like in js_dart2js.dart

Powered by Google App Engine
This is Rietveld 408576698