Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: src/builtins/builtins-symbol.cc

Issue 2900703002: [es2015] Precompute the descriptive string for symbols. (Closed)
Patch Set: Address feedback. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/arm64/builtins-arm64.cc ('k') | src/builtins/builtins-symbol-gen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-symbol.cc
diff --git a/src/builtins/builtins-symbol.cc b/src/builtins/builtins-symbol.cc
index 77bb09d0f764f033fc06845022d5c534f5eac75f..8a66e07015564ff66aa811993dc55914c13d142d 100644
--- a/src/builtins/builtins-symbol.cc
+++ b/src/builtins/builtins-symbol.cc
@@ -16,14 +16,12 @@ namespace internal {
// ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case.
BUILTIN(SymbolConstructor) {
HandleScope scope(isolate);
- Handle<Symbol> result = isolate->factory()->NewSymbol();
Handle<Object> description = args.atOrUndefined(isolate, 1);
if (!description->IsUndefined(isolate)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description,
Object::ToString(isolate, description));
- result->set_name(*description);
}
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate, isolate->factory()->NewSymbol(description));
}
// ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Construct]] case.
« no previous file with comments | « src/builtins/arm64/builtins-arm64.cc ('k') | src/builtins/builtins-symbol-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698