Skip to content

Convert core.js to class#1325

Merged
waltjones merged 2 commits into
masterfrom
waltjones/core-js-to-class
Sep 23, 2025
Merged

Convert core.js to class#1325
waltjones merged 2 commits into
masterfrom
waltjones/core-js-to-class

Conversation

@waltjones

@waltjones waltjones commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

Description of the change

Converts core.js to class syntax. More changes will follow. This gets the file indentation diff out of the way in one PR.

Note:
This refactor preserves the previous behavior of allowing Rollbar to behave like an instance after calling Rollbar.init().

Type of change

  • Refactor

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@matux matux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two functions that still use the prototype syntax in lines 518:526:

Rollbar.prototype.loadFull = function () {
  logger.info(
    'Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.',
  );
};

Rollbar.prototype._createItem = function (args) {
  return _.createItem(args, logger, this);
};

Not sure if this intentional.

@waltjones

Copy link
Copy Markdown
Contributor Author

Overlooked, thank you!

@waltjones waltjones merged commit bcb3f2d into master Sep 23, 2025
4 checks passed
@waltjones waltjones deleted the waltjones/core-js-to-class branch September 23, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants