I’m doing some FF add-on development and I’m seeing syntax like this:
var {Cc, Ci} = require('chrome');
Just curious what that syntax is and if it’s special to FF development or something else.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See Domenic’s answer as to what the syntax is which is called a destructuring assignment. The answer that follows is why this is needed for FF add-on development.
There’s a discussion on what this is and why it is needed at http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/d288b79903b5b434.
Short answer is yes, it’s specific for Firefox add-on development. The relevant documentation can be found at https://addons.mozilla.org/en-US/developers/docs/sdk/1.3/dev-guide/module-development/chrome.html.