[LNT] r267715 - [profile] Do not use string.startsWith

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 06:45:08 PDT 2016


Author: kbeyls
Date: Wed Apr 27 08:45:08 2016
New Revision: 267715

URL: http://llvm.org/viewvc/llvm-project?rev=267715&view=rev
Log:
[profile] Do not use string.startsWith

... as it isn't available in some modern browsers.

Modified:
    lnt/trunk/lnt/server/ui/static/lnt_profile.js

Modified: lnt/trunk/lnt/server/ui/static/lnt_profile.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_profile.js?rev=267715&r1=267714&r2=267715&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_profile.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_profile.js Wed Apr 27 08:45:08 2016
@@ -427,6 +427,10 @@ function Profile(element, runid, testid,
                     'to view a performance profile</i></center>');
 }
 
+function startsWith(string, startString) {
+    return string.substr(0, startString.length) === startString;
+}
+
 Profile.prototype = {
     reset: function() {
         $(this.element).empty();
@@ -465,7 +469,7 @@ Profile.prototype = {
 
     _display: function() {
         try {
-            if (this.displayType.startsWith('cfg')) {
+            if (startsWith(this.displayType, 'cfg')) {
                 var instructionSet = this.displayType.split('-')[1];
                 this._display_cfg(instructionSet);
             } else




More information about the llvm-commits mailing list