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

Side by Side Diff: sky/engine/bindings/core/v8/ScriptController.cpp

Issue 872043003: module.exports should default to an empty object. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/bindings/core/v8/ScriptValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 if (HTMLImport* parent = module.document()->import()) { 289 if (HTMLImport* parent = module.document()->import()) {
290 for (HTMLImportChild* child = static_cast<HTMLImportChild*>(parent->firs tChild()); 290 for (HTMLImportChild* child = static_cast<HTMLImportChild*>(parent->firs tChild());
291 child; child = static_cast<HTMLImportChild*>(child->next())) { 291 child; child = static_cast<HTMLImportChild*>(child->next())) {
292 if (Element* link = child->link()) { 292 if (Element* link = child->link()) {
293 String name = link->getAttribute(HTMLNames::asAttr); 293 String name = link->getAttribute(HTMLNames::asAttr);
294 if (!name.isEmpty()) { 294 if (!name.isEmpty()) {
295 scriptModule.formalDependencies.append(name); 295 scriptModule.formalDependencies.append(name);
296 v8::Handle<v8::Value> actual; 296 v8::Handle<v8::Value> actual;
297 if (Module* childModule = child->module()) 297 if (Module* childModule = child->module())
298 actual = childModule->exports().v8Value(); 298 actual = childModule->exports(scriptState).v8Value();
299 if (actual.IsEmpty()) 299 if (actual.IsEmpty())
300 actual = v8::Undefined(m_isolate); 300 actual = v8::Undefined(m_isolate);
301 scriptModule.resolvedDependencies.append(actual); 301 scriptModule.resolvedDependencies.append(actual);
302 } 302 }
303 } 303 }
304 } 304 }
305 } 305 }
306 306
307 V8ScriptRunner::runModule(m_isolate, m_frame->document(), scriptModule); 307 V8ScriptRunner::runModule(m_isolate, m_frame->document(), scriptModule);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/bindings/core/v8/ScriptValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698