Path to ES6, ES7?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 11:33 AM
Is there current roadmap to upgrade the platform to ES6, or 7? I know Helsinki upgraded it to ES5.
- 15,894 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 03:46 PM
Hi All!
This is actually something way too important to let it pass... I'm currently working in complex Schedule Jobs that would be easier to maintain if I could actually us Classes.
Chuck, any luck with the Platform team? I know some major things were updated related to coding for London.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018 04:52 AM
I haven't heard anything in the London information I've been reviewing.
Have you submitted an enhancement request? It's a better path for requesting new features than the community. 🙂
Enhancement requests: Tell us how you would improve the ServiceNow product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018 06:51 AM
Hi Chuck! Thank you for pointing that out! I'll submit the enhancement.
Now related to Prototype, I noticed that preferred new syntax for 1.6.0 is not working.
The following code works, which is the legacy class-based code:
/** obsolete syntax **/
var Person = Class.create();
Person.prototype = {
initialize: function(name) {
this.name = name;
},
say: function(message) {
return this.name + ': ' + message;
}
};
var guy = new Person('Miro');
guy.say('hi');
// -> "Miro: hi"
var Pirate = Class.create();
// inherit from Person class:
Pirate.prototype = Object.extend(new Person(), {
// redefine the speak method
say: function(message) {
return this.name + ': ' + message + ', yarr!';
}
});
var john = new Pirate('Long John');
john.say('ahoy matey');
// -> "Long John: ahoy matey, yarr!"
And the following is the preferred:
/** new, preferred syntax **/
// properties are directly passed to `create` method
var Person = Class.create({
initialize: function(name) {
this.name = name;
},
say: function(message) {
return this.name + ': ' + message;
}
});
// when subclassing, specify the class you want to inherit from
var Pirate = Class.create(Person, {
// redefine the speak method
say: function($super, message) {
return $super(message) + ', yarr!';
}
});
var john = new Pirate('Long John');
john.say('ahoy matey');
// -> "Long John: ahoy matey, yarr!"
Should we stick to the legacy one, even though the new one is backward-compatible?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019 05:04 AM
Hi,
this workaround could help with the super issue:
var ClassA= Class.create();
ClassA.prototype = {
initialize: function() {
},
doGreatStuff : function(x){
gs.print("Polymorphie is the greatest!!!");
this.doIt(x);
},
doIt : function(x){
gs.print("Call doIt ClassA: " + x + " " + this.type);
},
type : "A"
};
var ClassB = Class.create();
ClassB.prototype = Object.extendsObject(ClassA, {
initialize: function() {
},
doIt : function(x){
ClassA.prototype.doIt.call(this, x); //instead of super.doIt(x)
gs.print("Call doIt ClassB: " + x + " " + this.type);
},
type : "B"
});
var y = new ClassB();
y.doGreatStuff("Input");
//*** Script: Polymorphie is the greatest!!!
//*** Script: Call doIt ClassA: Input B
//*** Script: Call doIt ClassB: Input B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018 10:14 AM
I would really like to promote this post
Theres a huge difference from ES5 and forward
Any news about an upgrade?