Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Patch for tags/v0.9.3 to make it work on SDK 1.1 #408

Closed
wants to merge 1 commit into from
Closed

Patch for tags/v0.9.3 to make it work on SDK 1.1 #408

wants to merge 1 commit into from

Conversation

kasperl
Copy link
Contributor

@kasperl kasperl commented Jan 10, 2014

Dart SDK 1.1 is shipping soon. We need to update Angular 0.9.3 to work with that somehow.

This is a patch for tags/v0.9.3 that makes the code work on SDK 1.0 and 1.1. It doesn't change the (broken) semantics of only doing a local member lookup (using either ClassMirror.members or ClassMirror.declarations), but it does use ClassMirror.instanceMembers when available (SDK 1.1 running on Dartium) which is better.

Not sure how to go about landing this and pushing out a new release (0.9.3.1?). Ideally, we can update the pub version too so all the tutorials and samples that currently use 0.9.3 automatically get the fix.

….declarations (SDK 1.1+).

This patch makes AngularDart 0.9.3 work on SDK 1.0 and 1.1.
@jbdeboer
Copy link
Contributor

With the dev channel, I'm getting the following error running the tests.

$ dart --version
Dart VM version: 1.1.0-dev.5.0 (Fri Dec 20 05:55:37 2013) on "linux_x64"

$ dart bin/parser_generator_for_spec.dart
Unhandled exception:
Class '_LocalLibraryMirror' has no instance getter 'classes'.

NoSuchMethodError : method not found: 'classes'
Receiver: Instance of '_LocalLibraryMirror'
Arguments: []
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1 getClassMirrorBySymbol (package:di/mirrors.dart:28:35)
#2 _TypeProvider._TypeProvider (package:di/dynamic_injector.dart:272:50)
#3 _ProviderMetadata._ProviderMetadata.forType (package:di/dynamic_injector.dart:320:20)
#4 _registerBinding (package:di/dynamic_injector.dart:50:31)
#5 _HashMap.forEach (dart:collection-patch/collection_patch.dart:146)
#6 DynamicInjector.DynamicInjector._fromParent. (package:di/dynamic_injector.dart:39:30)
#7 List.forEach (dart:core-patch/growable_array.dart:240)
#8 DynamicInjector.DynamicInjector._fromParent (package:di/dynamic_injector.dart:38:20)
#9 DynamicInjector.DynamicInjector (package:di/dynamic_injector.dart:30:9)
#10 main (file:///home/deboer/gits/angular-dart/bin/parser_generator_for_spec.dart:15:27)
#11 _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:214)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)

@kasperl
Copy link
Contributor Author

kasperl commented Jan 10, 2014

Update to 1.1.0-dev.5.6 (released today) and try again.

Cheers,
Kasper
On Jan 10, 2014 4:36 PM, "James deBoer" [email protected] wrote:

With the dev channel, I'm getting the following error running the tests.

$ dart --version
Dart VM version: 1.1.0-dev.5.0 (Fri Dec 20 05:55:37 2013) on "linux_x64"

$ dart bin/parser_generator_for_spec.dart
Unhandled exception:
Class '_LocalLibraryMirror' has no instance getter 'classes'.

NoSuchMethodError : method not found: 'classes'
Receiver: Instance of '

_LocalLibraryMirror' Arguments: [] #0 Object.noSuchMethod
(dart:core-patch/object_patch.dart:45)
#1 https://github.com/angular/angular.dart/pull/1getClassMirrorBySymbol (package:di/mirrors.dart:28:35)
#2 #2 _TypeProvider._TypeProvider
(package:di/dynamic_injector.dart:272:50)
#3 #3 _ProviderMetadata._ProviderMetadata.forType
(package:di/dynamic_injector.dart:320:20)
#4 #4 _registerBinding
(package:di/dynamic_injector.dart:50:31)
#5 #5 _HashMap.forEach
(dart:collection-patch/collection_patch.dart:146)
#6 https://github.com/angular/angular.dart/issues/6DynamicInjector.DynamicInjector._fromParent.
(package:di/dynamic_injector.dart:39:30)
#7 #7 List.forEach
(dart:core-patch/growable_array.dart:240)
#8 https://github.com/angular/angular.dart/pull/8DynamicInjector.DynamicInjector._fromParent
(package:di/dynamic_injector.dart:38:20)
#9 https://github.com/angular/angular.dart/issues/9DynamicInjector.DynamicInjector (package:di/dynamic_injector.dart:30:9)
#10 #10 main
(file:///home/deboer/gits/angular-dart/bin/parser_generator_for_spec.dart:15:27)
#11 #11 _startIsolate.isolateStartHandler
(dart:isolate-patch/isolate_patch.dart:214)
#12 #12
_RawReceivePortImpl._handleMessage
(dart:isolate-patch/isolate_patch.dart:115)


Reply to this email directly or view it on GitHubhttps://github.com//pull/408#issuecomment-32037011
.

@jbdeboer
Copy link
Contributor

Mystery solved: this change needs a new pubspec.lock. Running "pub upgrade" fixes my error.

Tests pass for me as well. Thanks!

@bgourlie
Copy link
Contributor

Tangentially related: pubspec.lock shouldn't be versioned for libraries such as angular IIRC.

@ghost ghost assigned mhevery Jan 10, 2014
@jbdeboer
Copy link
Contributor

@bgourlie The pubspec.lock is used for our test suite. Does it also effect projects which depend on Angular?

@jmesserly
Copy link

Does it also effect projects which depend on Angular?

I just chatted with @munificent (one of the Pub creators) he said checking in a lockfile in this case is totally fine :)

@mhevery
Copy link
Contributor

mhevery commented Jan 11, 2014

MERGED

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

5 participants