Skip to content

Commit 261607a

Browse files
committed
Small code cleanup.
1 parent 27b8702 commit 261607a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/overlay/overlay_service.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ var OverlayServicePrototype = function()
3636
*/
3737
this.create_overlay = function(callback, config)
3838
{
39-
var config = config || {};
39+
config = config || {};
4040

4141
if (config.x == null || config.y == null || config.w == null || config.h == null)
42+
{
4243
opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
4344
"Too few arguments to OverlayService#create_overlay.");
45+
}
4446

4547
var window_id = config.window_id || this._window_id;
4648
var overlay_type = config.overlay_type || OverlayService.OverlayType.AREA;
@@ -59,7 +61,7 @@ var OverlayServicePrototype = function()
5961
window_id,
6062
overlay_type,
6163
insertion,
62-
area_overlay || null
64+
area_overlay
6365
];
6466
this._overlay.requestCreateOverlay(tag, msg);
6567
};
@@ -72,13 +74,13 @@ var OverlayServicePrototype = function()
7274
*/
7375
this.remove_overlay = function(callback, config)
7476
{
75-
var config = config || {};
77+
config = config || {};
7678
var window_id = config.window_id || this._window_id;
77-
var overlay_id = config.overlay_id || null;
79+
var overlay_id = typeof config.overlay_id == "number" ? config.overlay_id : null;
7880
var tag = this._tag_manager.set_callback(this, this._callback_handler, [callback]);
7981
var msg = [
8082
window_id,
81-
typeof overlay_id == "number" ? overlay_id : null
83+
overlay_id
8284
];
8385
this._overlay.requestRemoveOverlay(tag, msg);
8486
};

src/profiler/profiler_service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var ProfilerService = function()
1313

1414
this.start_profiler = function(callback, config)
1515
{
16-
var config = config || {};
16+
config = config || {};
1717
var start_mode = config.start_mode || ProfilerService.StartMode.IMMEDIATE;
1818
var window_id = config.window_id || this._window_id;
1919
var tag = this._tag_manager.set_callback(this, this._callback_handler, [callback, true]);
@@ -26,7 +26,7 @@ var ProfilerService = function()
2626

2727
this.stop_profiler = function(callback, config)
2828
{
29-
var config = config || {};
29+
config = config || {};
3030
var tag = this._tag_manager.set_callback(this, this._callback_handler, [callback, false]);
3131
var msg = [
3232
config.session_id
@@ -36,7 +36,7 @@ var ProfilerService = function()
3636

3737
this.get_events = function(callback, config)
3838
{
39-
var config = config || {};
39+
config = config || {};
4040
var tag = this._tag_manager.set_callback(this, this._callback_handler, [callback]);
4141
var msg = [
4242
config.session_id,
@@ -52,7 +52,7 @@ var ProfilerService = function()
5252

5353
this.release_session = function(callback, config)
5454
{
55-
var config = config || {};
55+
config = config || {};
5656
var tag = this._tag_manager.set_callback(this, this._callback_handler, [callback]);
5757
var msg = [
5858
typeof config.session_id == "number" ? config.session_id : null

0 commit comments

Comments
 (0)