[gjs: 1/2] Remove usage of Lang in non-legacy code



commit 39d23306e3f941734e79b2ddf6bca49da9daf4d2
Author: Sonny Piers <sonny fastmail net>
Date:   Mon Aug 5 03:29:06 2019 +0200

    Remove usage of Lang in non-legacy code

 installed-tests/js/minijasmine.js | 3 +--
 modules/cairo.js                  | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/installed-tests/js/minijasmine.js b/installed-tests/js/minijasmine.js
index 6af74e34..b7a6e4f4 100644
--- a/installed-tests/js/minijasmine.js
+++ b/installed-tests/js/minijasmine.js
@@ -1,7 +1,6 @@
 #!/usr/bin/env gjs
 
 const GLib = imports.gi.GLib;
-const Lang = imports.lang;
 
 function _removeNewlines(str) {
     let allNewlines = /\n/g;
@@ -44,7 +43,7 @@ window._jasmineRetval = 0;
 
 // Install Jasmine API on the global object
 let jasmineInterface = jasmineRequire.interface(jasmineCore, window._jasmineEnv);
-Lang.copyProperties(jasmineInterface, window);
+Object.assign(window, jasmineInterface);
 
 // Reporter that outputs according to the Test Anything Protocol
 // See http://testanything.org/tap-specification.html
diff --git a/modules/cairo.js b/modules/cairo.js
index a8477e29..25b834a0 100644
--- a/modules/cairo.js
+++ b/modules/cairo.js
@@ -21,8 +21,6 @@
 /* exported Antialias, Content, Extend, FillRule, Filter, FontSlant, FontWeight,
 Format, LineCap, LineJoin, Operator, PatternType, SurfaceType */
 
-const Lang = imports.lang;
-
 var Antialias = {
     DEFAULT: 0,
     NONE: 1,
@@ -146,5 +144,5 @@ var SurfaceType = {
 };
 
 // Merge stuff defined in native code
-Lang.copyProperties(imports.cairoNative, this);
+Object.assign(this, imports.cairoNative);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]