Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Do not copy entire Strings Object; pass by reference instead #4252

Closed
redmunds opened this issue Jun 17, 2013 · 1 comment
Closed

Do not copy entire Strings Object; pass by reference instead #4252

redmunds opened this issue Jun 17, 2013 · 1 comment
Assignees
Milestone

Comments

@redmunds
Copy link
Contributor

There are a few places in the code that use $.extend() to copy the entire Strings Object like this:

        var templateVars = $.extend({
            title        : title,
            baseUrl      : baseUrl,
            errorMessage : errorMessage
        }, Strings);

Instead, it should be passed by reference:

        var templateVars = {
            title        : title,
            baseUrl      : baseUrl,
            errorMessage : errorMessage,
            Strings      : Strings
        };

Note that string references in dialog templates also need to be updated from SOME_STRING to Strings.SOME_STRING.

Some of the files that need to be updated:

  • help/HelpCommandHandlers.js
  • utils/UpdateNotification.js
  • extensions/default/RecentProjects/main.js
  • extensions/default/WebPlatformDocs/InlineDocsViewer.js
@redmunds
Copy link
Contributor Author

Confirmed. Closing.

JakeStoeffler added a commit to JakeStoeffler/brackets that referenced this issue Jun 19, 2013
peterflynn added a commit that referenced this issue Jan 8, 2014
…rackets into pflynn/JakeStoeffler-languageselector-updated

# By Jake Stoeffler
# Via Jake Stoeffler
* 'languageselector' of https://github.com/JakeStoeffler/brackets:
  Setting default language resets force flag
  Move forced flag to Document
  Replace modal dialog with custom <select>
  Fix API changes to not publicly expose things we shouldn't ;)
  Pass Strings by reference (per #4252)
  Add reset button; add file name to dialog title
  Initial commit of language select dialog

Conflicts:
	src/extensions/default/JSLint/thirdparty/jslint
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants