OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 | 1333 |
1334 // Install the "constructor" property on the {prototype}. | 1334 // Install the "constructor" property on the {prototype}. |
1335 JSObject::AddProperty(prototype, factory->constructor_string(), string_fun, | 1335 JSObject::AddProperty(prototype, factory->constructor_string(), string_fun, |
1336 DONT_ENUM); | 1336 DONT_ENUM); |
1337 | 1337 |
1338 // Install the String.prototype methods. | 1338 // Install the String.prototype methods. |
1339 SimpleInstallFunction(prototype, "charAt", Builtins::kStringPrototypeCharAt, | 1339 SimpleInstallFunction(prototype, "charAt", Builtins::kStringPrototypeCharAt, |
1340 1, true); | 1340 1, true); |
1341 SimpleInstallFunction(prototype, "charCodeAt", | 1341 SimpleInstallFunction(prototype, "charCodeAt", |
1342 Builtins::kStringPrototypeCharCodeAt, 1, true); | 1342 Builtins::kStringPrototypeCharCodeAt, 1, true); |
| 1343 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0, |
| 1344 false); |
| 1345 SimpleInstallFunction(prototype, "trimLeft", |
| 1346 Builtins::kStringPrototypeTrimLeft, 0, false); |
| 1347 SimpleInstallFunction(prototype, "trimRight", |
| 1348 Builtins::kStringPrototypeTrimRight, 0, false); |
1343 } | 1349 } |
1344 | 1350 |
1345 { | 1351 { |
1346 // --- S y m b o l --- | 1352 // --- S y m b o l --- |
1347 Handle<JSObject> prototype = | 1353 Handle<JSObject> prototype = |
1348 factory->NewJSObject(isolate->object_function(), TENURED); | 1354 factory->NewJSObject(isolate->object_function(), TENURED); |
1349 Handle<JSFunction> symbol_fun = | 1355 Handle<JSFunction> symbol_fun = |
1350 InstallFunction(global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, | 1356 InstallFunction(global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, |
1351 prototype, Builtins::kSymbolConstructor); | 1357 prototype, Builtins::kSymbolConstructor); |
1352 symbol_fun->shared()->set_construct_stub( | 1358 symbol_fun->shared()->set_construct_stub( |
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3787 } | 3793 } |
3788 | 3794 |
3789 | 3795 |
3790 // Called when the top-level V8 mutex is destroyed. | 3796 // Called when the top-level V8 mutex is destroyed. |
3791 void Bootstrapper::FreeThreadResources() { | 3797 void Bootstrapper::FreeThreadResources() { |
3792 DCHECK(!IsActive()); | 3798 DCHECK(!IsActive()); |
3793 } | 3799 } |
3794 | 3800 |
3795 } // namespace internal | 3801 } // namespace internal |
3796 } // namespace v8 | 3802 } // namespace v8 |
OLD | NEW |