GitHub PullRequestReviewCommentEvent at 2014-03-27 02:41:57
Repository: addon-sdk
Actor: jsantell
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla/addon-sdk/pulls/comments/11008812","id":11008812,"diff_hunk":"@@ -129,20 +129,33 @@ function run(options) {\n     catch(error) {\n       console.exception(error);\n     }\n-    // Initialize inline options localization, without preventing addon to be\n-    // run in case of error\n-    try {\n-      require('../l10n/prefs');\n-    }\n-    catch(error) {\n-      console.exception(error);\n-    }\n \n-    // TODO: When bug 564675 is implemented this will no longer be needed\n-    // Always set the default prefs, because they disappear on restart\n-    if (options.prefsURI) {\n-      // Only set if `prefsURI` specified\n-      setDefaultPrefs(options.prefsURI);\n+    // native-options does stuff directly with preferences key from package.json\n+    if (options.preferences) {\n+      try {\n+        require('../preferences/native-options').enable(options.preferences);\n+      } catch (error) {\n+        console.exception(error); \n+      }\n+    } else {\n+      // keeping support for addons packaged with older SDK versions, \n+      // because old bootstrap.js doesn't pass the 'preferences' key\n+\n+      // Initialize inline options localization, without preventing addon to be\n+      // run in case of error\n+      try {\n+        require('../l10n/prefs').enable();\n+      }\n+      catch(error) {\n+        console.exception(error);\n+      }\n+\n+      // TODO: When bug 564675 is implemented this will no longer be needed\n+      // Always set the default prefs, because they disappear on restart\n+      if (options.prefsURI) {\n+        // Only set if `prefsURI` specified","path":"lib/sdk/addon/runner.js","position":41,"original_position":41,"commit_id":"3b789ee957a2b541cb1b3929fc309fd31cf26389","original_commit_id":"3b789ee957a2b541cb1b3929fc309fd31cf26389","user":{"login":"jsantell","id":641267,"avatar_url":"https://avatars.githubusercontent.com/u/641267?","gravatar_id":"595768eaea3925799b659b979de0f93a","url":"https://api.github.com/users/jsantell","html_url":"https://github.com/jsantell","followers_url":"https://api.github.com/users/jsantell/followers","following_url":"https://api.github.com/users/jsantell/following{/other_user}","gists_url":"https://api.github.com/users/jsantell/gists{/gist_id}","starred_url":"https://api.github.com/users/jsantell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsantell/subscriptions","organizations_url":"https://api.github.com/users/jsantell/orgs","repos_url":"https://api.github.com/users/jsantell/repos","events_url":"https://api.github.com/users/jsantell/events{/privacy}","received_events_url":"https://api.github.com/users/jsantell/received_events","type":"User","site_admin":false},"body":"in [jpm](http://github.com/mozilla/jpm), I added a [test in bootstrap](https://github.com/mozilla/jpm/blob/faed335c10deb8dcc505f47c0b7c3dd1ff61bdc0/data/bootstrap.js#L307-L312) to prevent this error from throwing, but this patch may make it irrelevant? not sure","created_at":"2014-03-27T02:41:57Z","updated_at":"2014-03-27T02:41:57Z","html_url":"https://github.com/mozilla/addon-sdk/pull/1368#discussion_r11008812","pull_request_url":"https://api.github.com/repos/mozilla/addon-sdk/pulls/1368","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addon-sdk/pulls/comments/11008812"},"html":{"href":"https://github.com/mozilla/addon-sdk/pull/1368#discussion_r11008812"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addon-sdk/pulls/1368"}}}}