dart-gde / chrome_gen.dart

Deprecated! See dart-gde/chrome.dart
https://github.com/dart-gde/chrome.dart
Other
6 stars 6 forks source link

Error when reading values from CrFile #136

Closed danschultz closed 10 years ago

danschultz commented 10 years ago

When making calls to CrFile.name, the following error is thrown:

Uncaught Error: Class 'File' has no instance method '[]'.

NoSuchMethodError : method not found: '[]'
Receiver: Instance of 'File'
Arguments: ["name"]
Stack Trace: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      CrFile.name (package:chrome_gen/src/files.dart:336:29)

This happens because CrFile reads its values from jsProxy using map notation. At least when getting files using CrFileEntry.file(), the object passed to CrFile.fromProxy() is an HTML File object. So values should be read using dot notation.

devoncarew commented 10 years ago

Thanks for the report!