11cb0ef41Sopenharmony_ci// Copyright 2019 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_cinamespace string { 61cb0ef41Sopenharmony_ciextern runtime StringEscapeQuotes(Context, String): String; 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-createhtml 91cb0ef41Sopenharmony_citransitioning builtin CreateHTML(implicit context: Context)( 101cb0ef41Sopenharmony_ci receiver: JSAny, methodName: String, tagName: String, attr: String, 111cb0ef41Sopenharmony_ci attrValue: JSAny): String { 121cb0ef41Sopenharmony_ci const tagContents: String = ToThisString(receiver, methodName); 131cb0ef41Sopenharmony_ci let result = '<' + tagName; 141cb0ef41Sopenharmony_ci if (attr != kEmptyString) { 151cb0ef41Sopenharmony_ci const attrStringValue: String = 161cb0ef41Sopenharmony_ci StringEscapeQuotes(context, ToString_Inline(attrValue)); 171cb0ef41Sopenharmony_ci result = result + ' ' + attr + '=\"' + attrStringValue + '\"'; 181cb0ef41Sopenharmony_ci } 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci return result + '>' + tagContents + '</' + tagName + '>'; 211cb0ef41Sopenharmony_ci} 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.anchor 241cb0ef41Sopenharmony_citransitioning javascript builtin StringPrototypeAnchor( 251cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 261cb0ef41Sopenharmony_ci return CreateHTML( 271cb0ef41Sopenharmony_ci receiver, 'String.prototype.anchor', 'a', 'name', arguments[0]); 281cb0ef41Sopenharmony_ci} 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.big 311cb0ef41Sopenharmony_citransitioning javascript builtin 321cb0ef41Sopenharmony_ciStringPrototypeBig( 331cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 341cb0ef41Sopenharmony_ci return CreateHTML( 351cb0ef41Sopenharmony_ci receiver, 'String.prototype.big', 'big', kEmptyString, kEmptyString); 361cb0ef41Sopenharmony_ci} 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.blink 391cb0ef41Sopenharmony_citransitioning javascript builtin 401cb0ef41Sopenharmony_ciStringPrototypeBlink( 411cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 421cb0ef41Sopenharmony_ci return CreateHTML( 431cb0ef41Sopenharmony_ci receiver, 'String.prototype.blink', 'blink', kEmptyString, kEmptyString); 441cb0ef41Sopenharmony_ci} 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.bold 471cb0ef41Sopenharmony_citransitioning javascript builtin 481cb0ef41Sopenharmony_ciStringPrototypeBold( 491cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 501cb0ef41Sopenharmony_ci return CreateHTML( 511cb0ef41Sopenharmony_ci receiver, 'String.prototype.bold', 'b', kEmptyString, kEmptyString); 521cb0ef41Sopenharmony_ci} 531cb0ef41Sopenharmony_ci 541cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor 551cb0ef41Sopenharmony_citransitioning javascript builtin 561cb0ef41Sopenharmony_ciStringPrototypeFontcolor( 571cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 581cb0ef41Sopenharmony_ci return CreateHTML( 591cb0ef41Sopenharmony_ci receiver, 'String.prototype.fontcolor', 'font', 'color', arguments[0]); 601cb0ef41Sopenharmony_ci} 611cb0ef41Sopenharmony_ci 621cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.fontsize 631cb0ef41Sopenharmony_citransitioning javascript builtin 641cb0ef41Sopenharmony_ciStringPrototypeFontsize( 651cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 661cb0ef41Sopenharmony_ci return CreateHTML( 671cb0ef41Sopenharmony_ci receiver, 'String.prototype.fontsize', 'font', 'size', arguments[0]); 681cb0ef41Sopenharmony_ci} 691cb0ef41Sopenharmony_ci 701cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.fixed 711cb0ef41Sopenharmony_citransitioning javascript builtin 721cb0ef41Sopenharmony_ciStringPrototypeFixed( 731cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 741cb0ef41Sopenharmony_ci return CreateHTML( 751cb0ef41Sopenharmony_ci receiver, 'String.prototype.fixed', 'tt', kEmptyString, kEmptyString); 761cb0ef41Sopenharmony_ci} 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.italics 791cb0ef41Sopenharmony_citransitioning javascript builtin 801cb0ef41Sopenharmony_ciStringPrototypeItalics( 811cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 821cb0ef41Sopenharmony_ci return CreateHTML( 831cb0ef41Sopenharmony_ci receiver, 'String.prototype.italics', 'i', kEmptyString, kEmptyString); 841cb0ef41Sopenharmony_ci} 851cb0ef41Sopenharmony_ci 861cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.link 871cb0ef41Sopenharmony_citransitioning javascript builtin 881cb0ef41Sopenharmony_ciStringPrototypeLink( 891cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 901cb0ef41Sopenharmony_ci return CreateHTML( 911cb0ef41Sopenharmony_ci receiver, 'String.prototype.link', 'a', 'href', arguments[0]); 921cb0ef41Sopenharmony_ci} 931cb0ef41Sopenharmony_ci 941cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.small 951cb0ef41Sopenharmony_citransitioning javascript builtin 961cb0ef41Sopenharmony_ciStringPrototypeSmall( 971cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 981cb0ef41Sopenharmony_ci return CreateHTML( 991cb0ef41Sopenharmony_ci receiver, 'String.prototype.small', 'small', kEmptyString, kEmptyString); 1001cb0ef41Sopenharmony_ci} 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.strike 1031cb0ef41Sopenharmony_citransitioning javascript builtin 1041cb0ef41Sopenharmony_ciStringPrototypeStrike( 1051cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 1061cb0ef41Sopenharmony_ci return CreateHTML( 1071cb0ef41Sopenharmony_ci receiver, 'String.prototype.strike', 'strike', kEmptyString, 1081cb0ef41Sopenharmony_ci kEmptyString); 1091cb0ef41Sopenharmony_ci} 1101cb0ef41Sopenharmony_ci 1111cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.sub 1121cb0ef41Sopenharmony_citransitioning javascript builtin 1131cb0ef41Sopenharmony_ciStringPrototypeSub( 1141cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 1151cb0ef41Sopenharmony_ci return CreateHTML( 1161cb0ef41Sopenharmony_ci receiver, 'String.prototype.sub', 'sub', kEmptyString, kEmptyString); 1171cb0ef41Sopenharmony_ci} 1181cb0ef41Sopenharmony_ci 1191cb0ef41Sopenharmony_ci// https://tc39.github.io/ecma262/#sec-string.prototype.sup 1201cb0ef41Sopenharmony_citransitioning javascript builtin 1211cb0ef41Sopenharmony_ciStringPrototypeSup( 1221cb0ef41Sopenharmony_ci js-implicit context: NativeContext, receiver: JSAny)(...arguments): String { 1231cb0ef41Sopenharmony_ci return CreateHTML( 1241cb0ef41Sopenharmony_ci receiver, 'String.prototype.sup', 'sup', kEmptyString, kEmptyString); 1251cb0ef41Sopenharmony_ci} 1261cb0ef41Sopenharmony_ci} 127